:root {
  /* Dark theme (default) */
  --title-bar-height: 50px;
  --bg-secondary: #1b1e24;
  --bg-primary: #121418;
  --text-primary: #E8E8E8;
  --border-color: #2A2D33;
  --hover-bg: #181b20;
  --banner-gradient: linear-gradient(to top, #1A1D21 0%, #121418 100%);
  --primary-color: #5B8FFF;
  --secondary-color: #6092ff;
  --text-secondary: #B0B0B0;
  --bg-primary-rgb: 18, 20, 24;
  --bg-secondary-rgb: 27, 30, 36;
  --hover-bg-rgb: 24, 27, 32;
  --primary-color-rgb: 91, 143, 255;
  --secondary-color-rgb: 96, 146, 255;
  /* Narrow left rail: projects strip (+ gap) only; tab lists live in split picker / modals */
  --sidebar-rail-width: 86px;
  /* Responsive tab grid: card column clamp (avoids huge stretched cards) */
  --boards-grid-min-col: 150px;
  --boards-grid-max-col: 260px;

  /* Status colors */
  --color-danger: #ef4444;
  --color-danger-rgb: 239, 68, 68;
  --color-success: #10b981;
  --color-success-rgb: 16, 185, 129;
  --color-warning: #fbbf24;
  --color-warning-rgb: 251, 191, 36;
  --color-info: #3b82f6;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.15);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.2);
  --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.35);
  --shadow-inset: inset 0 2px 8px rgba(0, 0, 0, 0.12);
  --shadow-primary-sm: 0 2px 8px rgba(var(--primary-color-rgb), 0.3);
  --shadow-primary-md: 0 4px 12px rgba(var(--primary-color-rgb), 0.3);
  --shadow-primary-lg: 0 6px 22px rgba(var(--primary-color-rgb), 0.48);
  --shadow-sheet: 0 -12px 48px rgba(0, 0, 0, 0.45);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: all 0.2s ease;
  --transition-slow: all 0.3s ease;
  --transition-bg: background 0.15s ease;
  --transition-color: color 0.15s ease;
  --transition-border: border-color 0.15s ease;

  /* Border radius */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 12px;
  --radius-2xl: 16px;
  --radius-pill: 999px;

  /* Z-index scale */
  --z-dropdown: 1000;
  --z-modal: 1500;
  --z-tooltip: 1600;
  --z-titlebar: 20000;

  /* Opacity */
  --opacity-disabled: 0.5;
  --opacity-backdrop: 0.55;
}

#title-bar-logo img {
  filter: brightness(0) invert(1);
}

body {
  margin: 0;
  padding: 0;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
  height: 100vh;
  transition: background-color 0.3s, color 0.3s;
  overflow: hidden;
}

#app-container {
  height: 100vh;
  display: flex;
  flex-direction: column;
}

#title-bar {
  background: var(--bg-primary);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  height: var(--title-bar-height);
  padding: 0 14px;
  padding-right: 0;
  -webkit-app-region: drag;
  user-select: none;
  z-index: 20000;
  position: relative;
  overflow: visible;
}

/* Left and right wraps take equal flex space so the center is truly centered */
.title-bar-left-wrap {
  flex: 1 1 0%;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.title-bar-right-wrap {
  flex: 1 1 0%;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

/* Force dark theme for title bar when logged out */
body.logged-out #title-bar {
  background: #121418 !important; /* Force dark --bg-primary */
  color: #E8E8E8 !important; /* Force dark text-primary */
}

body.logged-out #title-bar * {
  color: #E8E8E8 !important;
}

#title-bar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
}

#title-bar-center {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 500px;
  min-width: 0;
  pointer-events: none;
  padding: 0 20px;
  box-sizing: border-box;
}
body.logged-out #title-bar-center {
  display: none;
}
#title-bar-center > * {
  pointer-events: auto;
}

/* Project name in center of title bar - never shrink so badge stays visible when modal/search is open */
#title-bar-project-name-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  flex: 0 0 auto;
  margin-right: 12px;
}
#title-bar-project-name-wrap #project-name-display {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 4px;
  line-height: 1.2;
}
#title-bar-project-name-wrap #project-name-display .sidebar-access-level-icon,
#title-bar-project-name-wrap #project-name-display .title-bar-role-badge-wrap {
  flex-shrink: 0;
}

#title-bar-project-name-wrap.project-name-clickable {
  cursor: pointer;
  -webkit-app-region: no-drag;
  align-self: stretch;
  height: var(--title-bar-height);
  padding: 10px 10px 10px 6px;
  border-radius: 6px;
  transition: background 0.2s ease, color 0.2s ease, transform 0.18s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
  height: 40px;
  border-radius: 50px;
  background: rgba(var(--bg-secondary-rgb), 0.45);
  border: 1px solid rgba(255, 255, 255, 0.07);
}
#title-bar-project-name-wrap.project-name-clickable:hover {
  background: rgba(var(--hover-bg-rgb), 0.75);
  color: var(--primary-color);
  border-color: rgba(var(--primary-color-rgb), 0.35);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22), 0 0 0 -52px rgba(var(--primary-color-rgb), 0.12);
  transform: translateY(-1px);
}
#title-bar-project-name-wrap.project-name-clickable:hover #project-name-display {
  color: var(--primary-color);
}

#title-bar-controls {
  display: flex;
  gap: 5px;
  -webkit-app-region: no-drag;
  align-items: center;
  height: 100%;
  flex: 0 0 auto;
}

/* Time and user info on right side of title bar */
.title-bar-user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  border-right: 1px solid rgba(var(--border-color), 0.4);
}

html.aviquill-pref--hide-titlebar-time .title-bar-group.title-bar-user-info {
  display: none !important;
}

/* Time button – same height and style as other title bar icon buttons */
.title-bar-time-btn {
  background: transparent;
  border: none;
  color: var(--text-primary);
  height: 50px;
  min-width: 50px;
  padding: 0 12px;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.05em;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-app-region: no-drag;
  outline: none;
  user-select: none;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.title-bar-time-btn:hover {
  background: rgba(var(--hover-bg-rgb), 0.5);
  color: var(--primary-color);
  text-decoration: none;
}

/* Connection Status Indicator */
#connection-status {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  margin-right: 8px;
  transition: all 0.3s ease;
  -webkit-app-region: no-drag;
}

#connection-status.offline {
  background: rgba(var(--color-danger-rgb), 0.1);
  color: var(--color-danger);
}

#connection-status.online {
  background: rgba(var(--color-success-rgb), 0.1);
  color: var(--color-success);
}

#connection-status.connecting {
  background: rgba(var(--color-warning-rgb), 0.1);
  color: var(--color-warning);
}

#connection-status-icon {
  width: 14px;
  height: 14px;
  animation: none;
}

#connection-status.connecting #connection-status-icon {
  animation: pulse 1.5s ease-in-out infinite;
}

.connection-status-text {
  font-size: 11px;
  font-weight: 500;
}

/* Add left section to contain logo and history controls */
#title-bar-left {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex: 0 1 auto;
}

/* Update logo styles to work in the new layout */
#title-bar-logo {
  font-weight: 400;
  font-size: 0.8rem;
  line-height: 1;
  color: var(--text-primary);
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  height: 100%;
}

/* App version display */
.app-version {
  font-size: 0.7rem;
  color: var(--text-secondary);
  margin-left: 8px;
  font-weight: 300;
  opacity: 0.8;
  transition: opacity 0.2s ease;
}

.app-version:hover {
  opacity: 1;
}

/* Developer indicator */
.developer-indicator {
  font-size: 0.6rem;
  color: var(--primary-color);
  background: rgba(var(--primary-color-rgb), 0.1);
  border: 1px solid rgba(var(--primary-color-rgb), 0.3);
  border-radius: 3px;
  padding: 2px 6px;
  margin-left: 6px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  transition: all 0.2s ease;
  opacity: 0.9;
  cursor: pointer;
  user-select: none;
  -webkit-app-region: no-drag;
}

.developer-indicator:hover {
  opacity: 1;
  background: rgba(var(--primary-color-rgb), 0.15);
  border-color: rgba(var(--primary-color-rgb), 0.5);
  transform: scale(1.05);
}

.developer-indicator:active {
  transform: scale(0.95);
}

.developer-indicator.hidden {
  display: none !important;
}

/* Hide only middle groups if needed; show first (user info), second (icons), last (window controls) */
#title-bar-controls .title-bar-group:not(:first-child):not(:nth-child(2)):not(:last-child) {
  display: none;
}

/* Show user info, icon buttons, and window control buttons */
#title-bar-controls .title-bar-group:first-child,
#title-bar-controls .title-bar-group:nth-child(2),
#title-bar-controls .title-bar-group:last-child {
  display: flex;
}

/* Show all dividers */
#title-bar-controls .title-bar-divider {
  display: block;
}

#title-bar.unfocused .title-bar-btn,
#title-bar.unfocused .right-btn,
#title-bar.unfocused #title-bar-logo,
#title-bar.unfocused .title-bar-datetime,
#title-bar.unfocused #title-bar-project-name-wrap,
#title-bar.unfocused #theme-toggle,
#title-bar.unfocused #btn-discord,
#title-bar.unfocused #btn-notifications,
#title-bar.unfocused #btn-settings,
#title-bar.unfocused #sidebar-visibility-toggle {
  opacity: 0.5;
  transition: opacity 0.2s ease;
}

#title-bar.unfocused .title-bar-btn:hover,
#title-bar.unfocused .right-btn:hover,
#title-bar.unfocused .title-bar-datetime:hover,
#title-bar.unfocused #theme-toggle:hover,
#title-bar.unfocused #btn-discord:hover,
#title-bar.unfocused #btn-notifications:hover,
#title-bar.unfocused #btn-settings:hover,
#title-bar.unfocused #sidebar-visibility-toggle:hover {
  opacity: 1;
}

.title-bar-group {
  display: flex;
  gap: 4px;
  align-items: center;
}

/* Hide divider when logged out */
body.logged-out .title-bar-divider {
  display: none !important;
}

.title-bar-divider {
  width: 1px;
  height: 26px;
  background-color: var(--border-color);
  margin: 0 4px;
}

.title-bar-btn {
  background: none;
  border: none;
  color: var(--text-primary);
  width: 50px;
  height: 50px;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: var(--transition-bg);
  cursor: pointer;
  outline: none;
  user-select: none;
}

/* Title bar icon buttons (music, notifications) - same as .right-btn / #btn-settings */
#theme-toggle,
#btn-notifications {
  background: none;
  border: none;
  color: var(--text-primary);
  width: 50px;
  height: 50px;
  font-size: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: var(--transition-bg);
  cursor: pointer;
  -webkit-app-region: no-drag;
  outline: none;
  user-select: none;
  overflow: visible;
}

/* Reused by todo/recipe modals for action buttons (class name kept for compatibility) */
.contentmap-preview-minimize {
  background: none;
  border: none;
  color: var(--text-primary);
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.contentmap-preview-minimize:hover:not(:disabled) {
  background: rgba(var(--hover-bg-rgb), 0.5);
}

.right-btn {
  background: none;
  border: none;
  color: var(--text-primary);
  width: 50px;
  height: 50px;
  font-size: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: var(--transition-bg);
  cursor: pointer;
  -webkit-app-region: no-drag;
  outline: none;
  user-select: none;
  overflow: visible;
}

/* Notification badge */
#notification-badge,
#btn-notifications .notification-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  background-color: rgb(239, 68, 68);
  color: white;
  border-radius: 50%;
  min-width: 18px;
  width: 18px;
  height: 18px;
  box-sizing: border-box;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: bold;
  z-index: 10;
  padding: 0 4px;
  overflow: visible;
  flex-shrink: 0;
  pointer-events: none;
}

#notification-badge.visible,
#btn-notifications .notification-badge.visible {
  display: flex;
}

/* Title bar settings button - only apply to title bar */
#title-bar #btn-settings,
#title-bar #sidebar-visibility-toggle {
  background: none;
  border: none;
  color: var(--text-primary);
  width: 50px;
  height: 50px;
  font-size: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: var(--transition-bg);
  cursor: pointer;
  -webkit-app-region: no-drag;
  outline: none;
  user-select: none;
}

#theme-toggle:hover,
#btn-notifications:hover,
#title-bar #btn-settings:hover,
.right-btn:hover,
.title-bar-btn:hover {
  background: rgba(var(--hover-bg-rgb), 0.5);
  color: var(--primary-color);
}

/* Sidebar toggle: same hover background as other title icons, keep icon color stable */
#title-bar #sidebar-visibility-toggle:hover {
  background: rgba(var(--hover-bg-rgb), 0.5);
  color: var(--text-primary);
}

/* Discord button specific styling */
#btn-discord:hover {
  background: #5865f2;
  color: white;
}

#btn-discord:hover svg {
  color: white;
}

/* Discord button active state (modal visible) - icon only */
#btn-discord.active {
  background: rgba(var(--hover-bg-rgb), 0.5);
  border: none;
  color: var(--primary-color);
}

#btn-discord.active svg {
  color: var(--primary-color);
  fill: none;
}

/* Notifications button active state (modal visible) */
#btn-notifications.active {
  background: rgba(var(--hover-bg-rgb), 0.5);
  border: none;
  color: var(--primary-color);
}

#btn-notifications.active svg {
  color: var(--primary-color);
  stroke: var(--primary-color);
  fill: none;
}



.title-bar-group .right-btn svg,
#theme-toggle svg,
#btn-notifications svg,
#title-bar #btn-settings svg,
#title-bar #sidebar-visibility-toggle svg {
  width: 22px;
  height: 22px;
  stroke: var(--text-primary);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

/* Sidebar toggle: filled panel when sidebar is hidden (Show sidebar state) */
#title-bar #sidebar-visibility-toggle svg path {
  fill: none;
}

body.sidebar-hidden #title-bar #sidebar-visibility-toggle svg rect {
  fill: currentColor;
  stroke: none;
}

/* Premium Upgrade Button */
#premium-upgrade-btn {
  background: linear-gradient(
    135deg,
    var(--primary-color) 0%,
    var(--secondary-color) 100%
  );
  border: none;
  color: white;
  height: 50px;
  width: 50px;
  padding: 0 12px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.3s ease;
  cursor: pointer;
  -webkit-app-region: no-drag;
  outline: none;
  user-select: none;
  box-shadow: 0 2px 8px rgba(var(--primary-color-rgb), 0.3);
  position: relative;
  overflow: hidden;
  min-width: 80px;
}

#premium-upgrade-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

#premium-upgrade-btn:hover::before {
  left: 100%;
}

#premium-upgrade-btn:hover {
  background: linear-gradient(
    135deg,
    var(--secondary-color) 0%,
    var(--primary-color) 100%
  );
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(var(--primary-color-rgb), 0.4);
}

#premium-upgrade-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(var(--primary-color-rgb), 0.3);
}

#premium-upgrade-btn svg {
  width: 18px;
  height: 18px;
  stroke: white;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

#premium-upgrade-btn .premium-text {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  white-space: nowrap;
}

/* Premium badge state - smaller, just icon */
#premium-upgrade-btn.premium-user {
  padding: 0 8px;
  min-width: 32px;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  box-shadow: 0 2px 8px rgba(var(--primary-color-rgb), 0.4);
}

#premium-upgrade-btn.premium-user:hover {
  background: linear-gradient(135deg, var(--secondary-color) 0%, var(--primary-color) 100%);
  box-shadow: 0 4px 12px rgba(var(--primary-color-rgb), 0.5);
}

#premium-upgrade-btn.premium-user .upgrade-icon,
#premium-upgrade-btn.premium-user .premium-text {
  display: none;
}

#premium-upgrade-btn.premium-user .premium-badge {
  display: block !important;
  width: 18px;
  height: 18px;
  stroke: white;
  stroke-width: 1;
  fill: white;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

/* Dark theme adjustments */
[data-theme="dark"] #premium-upgrade-btn {
  background: linear-gradient(
    135deg,
    var(--primary-color) 0%,
    var(--secondary-color) 100%
  );
  box-shadow: 0 2px 8px rgba(var(--primary-color-rgb), 0.4);
}

[data-theme="dark"] #premium-upgrade-btn:hover {
  background: linear-gradient(
    135deg,
    var(--secondary-color) 0%,
    var(--primary-color) 100%
  );
  box-shadow: 0 4px 12px rgba(var(--primary-color-rgb), 0.5);
}

/* Welcome Popup - premium modal matching app aesthetic */
.welcome-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.55);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.welcome-popup.show {
  opacity: 1;
  visibility: visible;
}

.welcome-popup.hide {
  opacity: 0;
  visibility: hidden;
}

.welcome-popup-content {
  position: relative;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 0;
  max-width: 380px;
  width: 90%;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
  transform: scale(0.95) translateY(16px);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.welcome-popup.show .welcome-popup-content {
  transform: scale(1) translateY(0);
}

.welcome-popup-inner {
  padding: 24px 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Header: icon + title/name in one row */
.welcome-popup-header {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 14px;
  text-align: left;
}

.welcome-popup-header .welcome-popup-icon-wrap {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 50%;
  background: var(--hover-bg);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
}

.welcome-popup-header .welcome-popup-icon-wrap svg {
  color: var(--primary-color);
  width: 22px;
  height: 22px;
}

.welcome-popup-header-text {
  min-width: 0;
  flex: 1;
}

.welcome-popup-header h3 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.welcome-popup-name {
  margin: 2px 0 0 0 !important;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--primary-color) !important;
  letter-spacing: 0;
}

.welcome-popup-inner > p:not(.welcome-popup-name) {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.5;
  text-align: left;
}

.welcome-popup p strong {
  color: var(--primary-color);
  font-weight: 600;
}

/* Responsive title bar adjustments */
@media (max-width: 1200px) {
  #title-bar-center {
    max-width: 540px;
    width: 45%;
    min-width: 250px;
    padding: 0 15px;
  }
}

@media (max-width: 1000px) {
  #title-bar-center {
    max-width: 350px;
    width: 40%;
    min-width: 220px;
    padding: 0 10px;
  }
  
  #title-bar-center .sidebar-search-bar input {
    font-size: 12px;
    padding: 10px 12px;
  }
}

@media (max-width: 800px) {
  #title-bar-center {
    max-width: 300px;
    width: 35%;
    min-width: 200px;
    padding: 0 8px;
  }
  
  #title-bar-center .sidebar-search-bar input {
    font-size: 11px;
    padding: 10px 12px;
  }
  
  #title-bar-center .sidebar-search-bar input::placeholder {
    font-size: 11px;
  }
}

@media (max-width: 600px) {
  #title-bar-center {
    display: none;
  }
}

.title-bar-btn#close-btn svg line {
  stroke: #FF0000;
}

.title-bar-btn#close-btn:hover {
  background: #FF0000;
  color: #FFFFFF;
}

#main-content-wrapper {
  display: flex;
  flex: 1;
  height: calc(100vh - 50px);
}

#main-content {
  flex: 1;
  padding: 0px 10px 20px 64px;
  background: var(--bg-secondary);
  transition: all 0.25s cubic-bezier(.4,0,.2,1);
  position: relative;
  width: calc(100% - var(--sidebar-rail-width)); /* Main column beside left rail */
  border-radius: 16px;
  margin: 0px 8px 35px 8px;
  overflow: hidden;
  height: calc(100vh - var(--title-bar-height) - 8px - 35px - 0px); /* Fixed height: viewport - title bar - top margin - bottom margin */
  display: flex;
  flex-direction: column;
}

/* Full-width editor column when the left sidebar is toggled off */
body.sidebar-hidden #sidebar {
  width: 0 !important;
  min-width: 0 !important;
  max-width: 0 !important;
  overflow: hidden;
  pointer-events: none;
  margin: 0;
  padding: 0;
  border: none;
}

body.sidebar-hidden #main-content {
  width: calc(100% - 16px);
}

/* Content container: drag-over (dashed border) and drop-pulse for image/text editors */
.content-container.drag-over {
  border: 2px dashed var(--primary-color) !important;
  border-radius: 12px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.content-container.drop-pulse {
  animation: content-container-drop-pulse 0.6s ease-out;
}
@keyframes content-container-drop-pulse {
  0% { box-shadow: 0 0 0 0 rgba(var(--primary-color-rgb), 0.5); }
  50% { box-shadow: 0 0 0 12px rgba(var(--primary-color-rgb), 0); }
  100% { box-shadow: 0 0 0 0 rgba(var(--primary-color-rgb), 0); }
}

/* Toggle Buttons Container */
.toggle-buttons-container {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 12px 12px 6px;
  border-top-right-radius: 15px;
  border-bottom-right-radius: 15px;
  z-index: 500;
  transition: transform 0.25s cubic-bezier(.4,0,.2,1);
}

/* Border radius for scrolled down state */

#sidebar {
  background: var(--bg-primary);
  flex: 0 0 var(--sidebar-rail-width);
  width: var(--sidebar-rail-width);
  min-width: var(--sidebar-rail-width);
  max-width: var(--sidebar-rail-width);
  transition: all 0.25s cubic-bezier(.4,0,.2,1);
  display: flex;
  flex-direction: row;
  overflow: visible;
  position: relative;
}
#sidebar.expanded {
  width: var(--sidebar-rail-width);
  min-width: var(--sidebar-rail-width);
  max-width: var(--sidebar-rail-width);
}

/* Wrapper for projects strip + toolstrip (left bar of sidebar) */
.sidebar-bar-wrapper {
  display: flex;
  flex-direction: row;
  flex-shrink: 0;
  height: 100%;
  max-height: calc(100% - 75px);
  min-height: 0;
  gap: 6px;
  padding-left: 8px;
}

/* Projects strip: square initials, scroll like toolstrip (same max-height and scroll hints as toolstrip) */
#sidebar-projects-strip,
.sidebar-projects-strip {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 75px;
  min-width: 75px;
  flex-shrink: 0;
  height: 100%;
  max-height: 100%; /* Wrapper already reserves FAB space */
  min-height: 0;
  background: linear-gradient(
    180deg,
    rgba(var(--bg-secondary-rgb), 0.55) 0%,
    rgba(var(--bg-primary-rgb), 0.98) 42%,
    rgba(var(--bg-primary-rgb), 1) 100%
  );
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  border-radius: 19px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  position: relative;
  padding: 3px 0 3px;
  --toolstrip-scroll-hint-size: 20px;
  --toolstrip-scroll-hint-edge: rgba(255, 255, 255, 0.22);
}
#sidebar-projects-strip::-webkit-scrollbar,
.sidebar-projects-strip::-webkit-scrollbar {
  display: none;
}
/* Scroll-edge hints (same as toolstrip): need width/align-self because strip has align-items: center */
#sidebar-projects-strip::before,
.sidebar-projects-strip::before,
#sidebar-projects-strip::after,
.sidebar-projects-strip::after {
  content: '';
  display: block;
  width: 100%;
  align-self: stretch;
  position: sticky;
  left: 0;
  right: 0;
  height: var(--toolstrip-scroll-hint-size);
  flex-shrink: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  transition: opacity 0.2s ease;
  background: linear-gradient(
    to bottom,
    rgba(var(--bg-primary-rgb), 0.98) 0%,
    transparent 100%
  );
  box-shadow: inset 0 1px 0 var(--toolstrip-scroll-hint-edge);
}
#sidebar-projects-strip::after,
.sidebar-projects-strip::after {
  margin-top: calc(-1 * var(--toolstrip-scroll-hint-size));
  height: var(--toolstrip-scroll-hint-size);
  background: linear-gradient(
    to top,
    rgba(var(--bg-primary-rgb), 0.98) 0%,
    transparent 100%
  );
  box-shadow: inset 0 -1px 0 var(--toolstrip-scroll-hint-edge);
}
#sidebar-projects-strip::before,
.sidebar-projects-strip::before {
  margin-bottom: calc(-1 * var(--toolstrip-scroll-hint-size));
  top: 0;
}
#sidebar-projects-strip::after,
.sidebar-projects-strip::after {
  bottom: 0;
}
#sidebar-projects-strip.toolstrip-can-scroll-up::before,
.sidebar-projects-strip.toolstrip-can-scroll-up::before {
  opacity: 1;
}
#sidebar-projects-strip.toolstrip-can-scroll-down::after,
.sidebar-projects-strip.toolstrip-can-scroll-down::after {
  opacity: 1;
}

/* While switching project: fade strip tiles and block clicks / reorder until load finishes */
body.project-switch-loading .sidebar-projects-strip > .sidebar-project-btn,
body.project-switch-loading .sidebar-projects-strip > .sidebar-project-create-btn,
body.project-switch-loading .sidebar-projects-strip > .sidebar-projects-separator {
  opacity: 0.4;
  pointer-events: none;
  cursor: default;
  transition: opacity 0.2s ease;
}

body.project-switch-loading #content-wrapper-empty-state {
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.sidebar-project-btn.sidebar-project-draggable {
  cursor: pointer;
  touch-action: pan-y;
}

body.dragging-sidebar-project-strip {
  cursor: grabbing !important;
}

/* Ghost tile: solid primary fill like tab row content while dragging (text-only tiles are otherwise transparent). */
.sidebar-project-btn.sidebar-project-strip-dragging {
  opacity: 1 !important;
  background: rgba(var(--primary-color-rgb), 0.92) !important;
  color: #fff !important;
  border: 2px dashed rgba(255, 255, 255, 0.75) !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  cursor: grabbing !important;
  transition: none;
  pointer-events: none;
  -webkit-font-smoothing: antialiased;
}

.sidebar-project-btn.sidebar-project-strip-dragging .sidebar-project-btn-initials {
  color: #fff !important;
}

.sidebar-project-btn.sidebar-project-strip-dragging .sidebar-project-btn-back-hint {
  color: rgba(255, 255, 255, 0.9) !important;
}

.sidebar-project-btn.sidebar-project-strip-dragging .sidebar-project-btn-face {
  background: rgba(0, 0, 0, 0.12) !important;
  border-radius: 12px;
}

.sidebar-project-btn.sidebar-project-strip-dragging .sidebar-project-btn-face::after {
  opacity: 0 !important;
}

.sidebar-project-btn.sidebar-project-strip-dragging.has-thumb .sidebar-project-btn-face {
  background: transparent !important;
}

.sidebar-project-strip-placeholder {
  box-sizing: border-box;
  flex-shrink: 0;
  margin: 0 auto;
  pointer-events: none;
  background: rgba(var(--primary-color-rgb), 0.1);
  border: 2px dashed rgba(var(--primary-color-rgb), 0.55);
  border-radius: 16px;
  opacity: 1;
  transition: none;
  min-width: 68px;
  min-height: 68px;
  width: 68px;
  height: 68px;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.12);
}

.sidebar-project-btn {
  width: 68px;
  height: 68px;
  min-width: 68px;
  min-height: 68px;
  padding: 0;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  background: rgba(var(--bg-secondary-rgb), 0.45);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 16px;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  transition:
    background 0.2s ease,
    color 0.2s ease,
    transform 0.18s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}
.sidebar-project-btn-face {
  flex: 1;
  width: 100%;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  border-radius: 13px;
}
.sidebar-project-btn-face::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  box-shadow: inset 0 0 0 2px rgba(var(--primary-color-rgb), 0.85);
  background: rgba(0, 0, 0, 0.12);
}
.sidebar-project-btn-thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}
.sidebar-project-btn.has-thumb .sidebar-project-btn-initials {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}
.sidebar-project-btn.has-thumb.has-thumb-error .sidebar-project-btn-initials {
  position: relative;
  opacity: 1;
  width: auto;
  height: auto;
  overflow: visible;
}
/* Back-arrow hint below initials on active project when a tool is open (click project to go back) */
.sidebar-project-btn-back-hint {
  display: none;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
  color: inherit;
  opacity: 0.85;
}
.sidebar-project-btn-back-hint svg {
  display: block;
}
.sidebar-projects-strip.tool-open .sidebar-project-btn.active .sidebar-project-btn-back-hint {
  display: flex;
}
.sidebar-project-btn:hover {
  background: rgba(var(--hover-bg-rgb), 0.75);
  color: var(--primary-color);
  border-color: rgba(var(--primary-color-rgb), 0.35);
  box-shadow:
    0 6px 18px rgba(0, 0, 0, 0.22),
    0 0 0 1px rgba(var(--primary-color-rgb), 0.12);
  transform: translateY(-1px);
}
.sidebar-project-btn.has-thumb:hover .sidebar-project-btn-face::after {
  opacity: 1;
}
.sidebar-project-btn.active {
  background: linear-gradient(
    145deg,
    rgba(var(--primary-color-rgb), 0.32) 0%,
    rgba(var(--secondary-color-rgb), 0.18) 100%
  );
  color: #fff;
  border-color: rgba(var(--primary-color-rgb), 0.45);
  box-shadow:
    0 4px 18px rgba(var(--primary-color-rgb), 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.sidebar-project-btn.has-thumb.active .sidebar-project-btn-face::after {
  opacity: 1;
  box-shadow: inset 0 0 0 2px rgba(var(--primary-color-rgb), 1);
  background: rgba(0, 0, 0, 0.2);
}
.sidebar-project-btn.has-thumb.active:hover .sidebar-project-btn-face::after {
  box-shadow:
    inset 0 0 0 3px rgba(var(--primary-color-rgb), 1),
    inset 0 0 0 1px rgba(255, 255, 255, 0.5);
  background: rgba(0, 0, 0, 0.28);
}
.sidebar-project-btn.active:hover {
  background: linear-gradient(
    145deg,
    rgba(var(--primary-color-rgb), 0.4) 0%,
    rgba(var(--secondary-color-rgb), 0.26) 100%
  );
  transform: translateY(-1px);
}

/* Separator between your projects and shared projects */
.sidebar-projects-separator {
  flex-shrink: 0;
  width: 70%;
  height: 1px;
  margin-top: 8px;
  margin-bottom: 8px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.12) 35%,
    rgba(var(--primary-color-rgb), 0.25) 50%,
    rgba(255, 255, 255, 0.12) 65%,
    transparent
  );
}

/* Margin only between items so the first item has no top spacing */
.sidebar-project-btn + .sidebar-project-btn,
.sidebar-project-btn + .sidebar-project-create-btn {
  margin-top: 6px;
}

/* Reorder placeholder: same vertical rhythm as real tiles (adjacent-sibling rules) */
.sidebar-project-btn + .sidebar-project-strip-placeholder {
  margin-top: 6px;
}
.sidebar-project-strip-placeholder + .sidebar-project-btn,
.sidebar-project-strip-placeholder + .sidebar-project-create-btn {
  margin-top: 6px;
}

.sidebar-project-create-btn {
  width: 68px;
  height: 68px;
  min-width: 68px;
  min-height: 68px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(var(--bg-secondary-rgb), 0.35);
  border: 2px dashed rgba(var(--primary-color-rgb), 0.28);
  border-radius: 16px;
  color: var(--text-secondary);
  cursor: pointer;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.12);
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.18s ease;
}
.sidebar-project-create-btn:hover {
  background: rgba(var(--primary-color-rgb), 0.12);
  border-color: rgba(var(--primary-color-rgb), 0.65);
  color: var(--primary-color);
  box-shadow:
    inset 0 2px 10px rgba(0, 0, 0, 0.1),
    0 0 20px rgba(var(--primary-color-rgb), 0.15);
  transform: translateY(-1px);
}
/* Same disabled look as AI tools / split editor — dimmed but clickable to open subscription */
.sidebar-project-create-btn.premium-disabled {
  opacity: 0.4;
  cursor: pointer;
}
.sidebar-project-create-btn.premium-disabled:hover {
  opacity: 0.6;
  background: rgba(var(--hover-bg-rgb), 0.2);
  color: var(--text-primary);
}
.sidebar-project-create-btn svg {
  flex-shrink: 0;
}

.todo-indicator {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  background: var(--warning, #ffb300);
  border-radius: 50%;
  border: 1px solid var(--bg-primary);
  z-index: 10;
  animation: pulse 2s infinite;
}

.todo-indicator.overdue {
  background: var(--danger, #ff4d4f);
}

.todo-indicator.today {
  background: var(--warning, #ffb300);
}

.todo-indicator.tomorrow {
  background: var(--primary-color);
}

@keyframes pulse {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.2);
    opacity: 0.7;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

#sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px 0 0;
  flex-shrink: 0;
  gap: 8px;
  width: 100%;
}
/* Welcome section – osu!-inspired card (keeps app color theme) */
#welcome-section {
  transition: opacity 0.3s ease, transform 0.3s ease, margin 0.3s ease;
}

#welcome-section.hidden {
  opacity: 0;
  transform: translateY(-20px);
  margin: 0;
  pointer-events: none;
}

.welcome-card {
  position: relative;
  text-align: left;
  padding: 14px 14px 14px 18px;
  border-radius: 12px;
  background: rgba(var(--bg-secondary-rgb), 0.6);
  border: 1px solid rgba(var(--border-color), 0.5);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15),
              inset 0 1px 0 rgba(255, 255, 255, 0.03);
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

#welcome-section:hover .welcome-card {
  border-color: rgba(var(--primary-color-rgb), 0.25);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2),
              0 0 0 1px rgba(var(--primary-color-rgb), 0.08),
              inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.welcome-card-accent {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg,
    var(--primary-color) 0%,
    rgba(var(--primary-color-rgb), 0.6) 50%,
    var(--primary-color) 100%);
  border-radius: 4px 0 0 4px;
  opacity: 0.9;
}

.welcome-card-content {
  position: relative;
  z-index: 1;
}

#project-name-display {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1.3;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.bm-section-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 10px 12px 10px 6px;
  margin: 2px 0px;
  cursor: pointer;
  border-radius: 8px 8px;
  border: 1px solid color-mix(in srgb, var(--border-color) 72%, transparent);
  color: var(--text-primary);
  transition: transform 0.22s cubic-bezier(0.34, 2.2, 0.64, 1),
              padding 0.22s cubic-bezier(0.34, 2.2, 0.64, 1),
              border-left-width 0.22s cubic-bezier(0.34, 2.2, 0.64, 1),
              background 0.15s ease,
              box-shadow 0.15s ease,
              color 0.15s ease,
              border-color 0.15s ease;
  flex: 1;
}

#boards-header,
#favorites-header,
.bm-section-header {
  min-height: 40px;
  box-sizing: border-box;
}

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

.bm-section-title {
  flex: 1;
  font-size: 0.8rem;
  font-weight: 600;
  color: currentColor;
  letter-spacing: 0.02em;
}

.bm-section-toggle {
  background: none;
  border: none;
  color: currentColor;
  cursor: pointer;
  padding: 2px;
  margin-right: 2px;
  margin-left: 3px;
  border-radius: 4px;
  transition: color 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  pointer-events: none; /* Prevent button from interfering with header click */
}

.bm-section-header:hover .bm-section-toggle,
.bm-section-row:hover .bm-section-toggle {
  color: var(--text-primary);
}

.bm-section-toggle svg {
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.bm-section-toggle.collapsed svg {
  transform: rotate(-90deg);
}

.bm-section-content {
  max-height: 200px;
  overflow-y: auto;
  overflow-x: visible;
  transition: max-height 0.3s ease, padding 0.3s ease;
  margin: 0px;
  box-sizing: border-box;
  border-radius: 0 0 8px 8px;
}

.bm-section-content.collapsed {
  max-height: 0;
  overflow: hidden;
  padding: 0;
}

.bm-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px 0 15px 0;
  min-height: 0;
  overflow: visible;
}

.bm-tag-item {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  padding-right: 2px;
  background: rgba(var(--bg-secondary-rgb), 0.4);
  border: 1px solid var(--border-color);
  border-radius: 45px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  transition: border-color 0.15s ease,
              background 0.15s ease;
  user-select: none;
  position: relative;
  overflow: visible;
  white-space: nowrap;
}

.bm-tag-item:hover {
  background: rgba(var(--hover-bg-rgb), 0.5);
  border-color: var(--primary-color);
}

.bm-tag-item:active {
  transform: scale(0.96);
  transition-duration: 0.08s;
  transition-timing-function: cubic-bezier(0.34, 2.2, 0.64, 1);
}

.bm-tag-item.active {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  color: white;
  border-color: transparent;
}

.bm-tag-item.active:hover {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
}

.bm-tag-item.active:active {
  transform: scale(0.96);
}

.bm-tag-badge {
  margin-left: 5px;
  font-size: 0.7rem;
  opacity: 0.85;
  padding: 1px 4px;
  border-radius: 4px;
  font-weight: 600;
}

.bm-tag-item:not(.active) .bm-tag-badge {
  color: var(--text-secondary);
}

.bm-tag-item.active .bm-tag-badge {
  background: rgba(255, 255, 255, 0.2);
  padding: 1px 5px;
}

/* When viewing a shared project, hide main app banner and collapse space */
#sidebar.no-banner #banner {
  display: none !important;
}

#banner {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 946px;
  min-height: unset;
  max-height: unset;
  transition: width 0.25s cubic-bezier(.4,0,.2,1), opacity 0.25s cubic-bezier(.4,0,.2,1);
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  box-shadow: none;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  user-select: none;
}
#banner img,
#banner video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  left: 0;
  top: 0;
  z-index: 1;
}
@media (max-width: 600px) {
  #banner {
    min-height: 60px;
    height: 22vw;
  }
}

#banner-gradient-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
  background: linear-gradient(to top, 
    var(--bg-secondary) 0%,
    rgba(255, 255, 255, 0) 100%
  );
}

#boards-header-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Section header styles */
#boards-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px 10px 6px;
  margin: 2px 0px;
  border-radius: 8px 8px;
  border: 1px solid color-mix(in srgb, var(--border-color) 72%, transparent);
  background: rgba(var(--bg-secondary-rgb), 0.72);
  color: var(--text-primary);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: transform 0.22s cubic-bezier(0.34, 2.2, 0.64, 1),
              padding 0.22s cubic-bezier(0.34, 2.2, 0.64, 1),
              border-left-width 0.22s cubic-bezier(0.34, 2.2, 0.64, 1),
              background 0.15s ease,
              box-shadow 0.15s ease,
              color 0.15s ease,
              border-color 0.15s ease;
  cursor: pointer;
  flex: 1;
}

#boards-header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-right: 4px;
}

#boards-header-actions .board-action-btn {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

#boards-header-actions .board-action-btn:hover {
  background: rgba(var(--primary-color-rgb), 0.12);
  color: var(--primary-color);
  border-color: var(--primary-color);
}

#boards-header.drag-over {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  border-left-color: rgba(255, 255, 255, 0.5);
  border-bottom-color: transparent;
  box-shadow: 0 2px 12px rgba(var(--primary-color-rgb), 0.35);
}

#boards-header.drag-over #boards-label,
#boards-header.drag-over #boards-arrow {
  color: white;
}

/* Pulse when arc toolstrip is open: shows where the new tab will be added */
#boards-header.arc-add-target-pulse {
  animation: arc-add-target-pulse 1.4s ease-in-out infinite;
}

@keyframes arc-add-target-pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(var(--primary-color-rgb), 0.25);
  }
  50% {
    box-shadow: 0 0 0 4px rgba(var(--primary-color-rgb), 0.35), 0 2px 8px rgba(0, 0, 0, 0.06);
  }
}

#boards-label {
  font-size: 0.8rem;
  color: currentColor;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#boards-toggle {
  background: none;
  border: none;
  color: currentColor;
  font-size: 0.9rem;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  transition: var(--transition-bg);
  pointer-events: none;
}
#boards-toggle:hover {
  background: var(--hover-bg);
}
#boards-arrow {
  display: inline-block;
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  width: 10px;
  height: 10px;
}

#boards-arrow::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translate(-50%, -75%) rotate(45deg);
}
#boards-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 5000px; /* large so content can expand */
  overflow: hidden;
  position: relative;
  padding: 10px 4px 14px 8px;
  margin: 0;
  border-radius: 0 0 8px 8px;
  background: transparent;
}
#boards-list::before {
  content: none;
}
#boards-list.collapsed {
  max-height: 0;
  padding: 0;
  margin: 0;
}
body.logged-out #boards-list {
  max-height: 0;
  padding: 0;
  margin: 0;
  display: none !important;
}

/* Universal boards grid layout (sidebar + split tab picker).
   auto-fill + capped max track width: many columns when wide, never ultra-wide cards. */
.boards-list.boards-list--grid {
  display: grid;
  grid-template-columns: repeat(
    auto-fill,
    minmax(
      min(100%, var(--boards-grid-min-col)),
      min(100%, var(--boards-grid-max-col))
    )
  );
  gap: 6px;
  align-items: start;
  justify-content: start;
  min-width: 0;
  overflow-x: hidden;
}

body:not(.sidebar-hidden) #sidebar {
  width: var(--sidebar-rail-width);
  min-width: var(--sidebar-rail-width);
  max-width: var(--sidebar-rail-width);
}

body:not(.sidebar-hidden) #main-content {
  width: calc(100% - var(--sidebar-rail-width));
}

/* Grid cards: same DOM order as list (actions, then content, then preview) — use grid so
   actions sit to the left of the title row instead of absolutely positioned above it */
.board-item.board-grid-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-rows: auto minmax(72px, 1fr);
  align-items: start;
  align-self: stretch;
  column-gap: 6px;
  row-gap: 4px;
  min-height: 132px;
  padding: 8px 10px 10px;
  position: relative;
  border-radius: 12px;
  border-top: 1px solid var(--border-color);
  border-right: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  border-left: none;
  border-left: 3px solid var(--board-color);
  background: rgba(var(--bg-secondary-rgb), 0.4);

  /* Smooth hover transition for background, transform, and shadow */
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}


/* Hover effect for unselected cards */
.board-item.board-grid-card:hover {
  background: rgba(var(--hover-bg-rgb), 0.5); /* Slightly darker background */
  border-left-color: var(--board-color);

  /* New subtle hover enhancements */
  transform: scale(1.02); /* Slightly grow card */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08); /* Soft shadow for depth */
}

/* Selected card style stays mostly the same */
.board-item.board-grid-card.selected {
  background: rgba(var(--primary-color-rgb), 0.15);
  border-top: 1px solid var(--primary-color);
  border-right: 1px solid var(--primary-color);
  border-bottom: 1px solid var(--primary-color);
  border-left-color: var(--board-color);
  /* Optional: subtle scale for selected card to distinguish it */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Keep selected card content clean */
.board-item.board-grid-card.selected .board-content {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
}

.board-item.board-grid-card .board-actions-left {
  grid-column: 1;
  grid-row: 1;
  position: static;
  align-self: center;
  justify-self: start;
  z-index: 2;
  max-width: 0;
}

.board-item.board-grid-card .board-actions-right {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
  align-self: center;
}

.board-item.board-grid-card .board-content {
  grid-column: 2;
  grid-row: 1;
  flex: 0 0 auto;
  margin-top: 0;
  width: 100%;
  min-width: 0;
  align-self: center;
}

.board-item.board-grid-card .board-grid-preview {
  grid-column: 1 / -1;
  grid-row: 2;
  min-width: 0;
}

.board-item.board-grid-card .board-text {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
}

.board-item.board-grid-card .board-type-icon {
  flex-shrink: 0;
}

.board-grid-preview {
  flex: 1;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  min-width: 0;
  border-radius: 10px;
  background: transparent;
  overflow: hidden;
}
body.logged-out #boards-header {
  display: none !important;
}
/* Board item – left border uses tab color (like group headers); hover widens left border only */
.board-item {
  --board-color: var(--primary-color);
  background: transparent;
  color: var(--text-primary);
  font-size: 0.85rem;
  cursor: pointer;
  transition: transform 0.12s cubic-bezier(0.34, 1.56, 0.64, 1),
              background 0.15s ease,
              box-shadow 0.15s ease,
              padding-left 0.22s cubic-bezier(0.34, 2.2, 0.64, 1),
              border-left-width 0.22s cubic-bezier(0.34, 2.2, 0.64, 1);
  margin-right: 0px;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 4px;
  position: relative;
  justify-content: space-between;
  max-width: 100%;
}

.board-content {
  color: var(--text-primary);
}

.board-item:not(.selected):active {
  transform: scale(0.995);
  transition-duration: 0.2s;
  transition-timing-function: cubic-bezier(0.34, 1.56, 0.64, 1);
}

.board-item:active {
  transform: scale(0.995);
  transition-duration: 0.2s;
  transition-timing-function: cubic-bezier(0.34, 1.56, 0.64, 1);
}

.board-item.selected {
  color: var(--text-primary);
}

.board-item.selected:active {
  transform: none;
}

/* Board actions strip – appears from the left on hover, pushes tab content */
.board-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  max-width: 0;
  min-width: 0;
  overflow: hidden;
  flex-shrink: 0;
  transition: max-width 0.22s cubic-bezier(0.34, 2.2, 0.64, 1);
}

.board-item:hover .board-actions:not(.board-actions-left):not(.board-actions-right) {
  max-width: 160px;
}

.board-actions-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.board-item .board-actions-left {
  max-width: 0;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
  transition: max-width 0.16s ease, opacity 0.16s ease;
}

.board-item .board-actions-right {
  max-width: 0;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
  transition: max-width 0.16s ease, opacity 0.16s ease;
}

.board-item.boards-actions-left-active .board-actions-left {
  max-width: 80px;
  opacity: 1;
  pointer-events: auto;
}

.board-item.boards-actions-left-active .board-actions-right {
  max-width: 0;
  opacity: 0;
  pointer-events: none;
}

.board-item.boards-actions-right-active .board-actions-right {
  max-width: 44px;
  opacity: 1;
  pointer-events: auto;
}

.board-item .board-actions-left .board-action-btn,
.board-item .board-actions-right .board-action-btn {
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  opacity: 1;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.board-item .board-actions-left .board-action-btn:hover,
.board-item .board-actions-right .board-action-btn:hover {
  background: rgba(var(--primary-color-rgb), 0.12);
  color: var(--primary-color);
}

.board-action-btn {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.95rem;
  cursor: pointer;
  opacity: 0.85;
  transition: opacity 0.12s ease, background 0.12s ease, color 0.12s ease, transform 0.1s ease;
}

/* Tag cloud header actions – reuse board-actions strip with hover reveal */
.bm-tag-add-btn {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.bm-tag-add-btn:hover {
  background: rgba(var(--primary-color-rgb), 0.12);
  color: var(--primary-color);
  border-color: var(--primary-color);
}

.bm-tag-add-btn.boards-menu-tag-add-btn {
  width: 28px;
  height: 28px;
  min-height: 0;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: var(--primary-color);
  color: #fff;
  transition: background 0.14s ease, transform 0.1s ease, box-shadow 0.14s ease;
}

.bm-tag-add-btn.boards-menu-tag-add-btn:hover {
  background: var(--secondary-color);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(var(--primary-color-rgb), 0.3);
}

.bm-tag-add-btn.boards-menu-tag-add-btn:active {
  transform: scale(0.95);
  box-shadow: none;
}

/* Tag cloud tag hover edit button */
.bm-tag-item {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.bm-tag-edit-btn {
  border: none;
  background: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.75rem;
  opacity: 0;
  padding: 4px 6px;
  border-radius: 45px;
  transition: opacity 0.12s ease, color 0.12s ease, background 0.15s ease;
}

.bm-tag-item:hover .bm-tag-edit-btn,
.bm-tag-item.active .bm-tag-edit-btn {
  opacity: 1;
}

/* Unselected: icon keeps same color as boards list (text-secondary) until icon is hovered */

/* Tag hovered AND edit button hovered: icon turns primary */
.bm-tag-item:not(.active):hover .bm-tag-edit-btn:hover {
  background: rgba(var(--primary-color-rgb), 0.12);
  color: var(--primary-color);
}

.bm-tag-edit-btn:hover {
  background: rgba(var(--primary-color-rgb), 0.12);
  color: var(--primary-color);
}

/* Selected tag: same icon colors as sidebar .board-item.selected .board-action-btn */
.bm-tag-item.active .bm-tag-edit-btn {
  color: rgba(255, 255, 255, 0.9);
}

.bm-tag-item.active .bm-tag-edit-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

/* Tag modal for creating/renaming tags – styled like project/settings sheets */
.tag-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 1600;
  animation: presetSheetBackdropIn 0.3s ease-out;
}

.tag-modal {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  margin: 0;
  border-radius: 24px 24px 0 0;
  background: var(--bg-primary);
  box-shadow:
    0 -8px 32px rgba(0, 0, 0, 0.4),
    0 -2px 0 0 rgba(var(--primary-color-rgb), 0.35),
    0 0 0 1px var(--border-color);
  animation: presetSheetSlideUp 0.38s cubic-bezier(0.32, 0.72, 0, 1) forwards;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 20px 20px;
}

.tag-modal-title {
  font-size: 0.95rem;
  font-weight: 600;
}

.tag-modal-input {
  padding: 8px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background: var(--bg-primary);
  color: var(--text-primary);
}

.tag-modal-pending-wrap {
  margin-top: 6px;
}

.tag-modal-pending-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.tag-modal-pending-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-modal-pending-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: rgba(var(--primary-color-rgb), 0.12);
  color: var(--text-primary);
  font-size: 0.78rem;
  padding: 2px 4px 2px 10px;
}

.tag-modal-pending-chip-text {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tag-modal-pending-chip-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}

.tag-modal-pending-chip-remove:hover {
  background: rgba(0, 0, 0, 0.12);
  color: var(--text-primary);
}

.tag-modal-suggestions {
  margin-top: 4px;
  padding-top: 6px;
  border-top: 1px solid var(--border-color);
  max-height: 140px;
  overflow-y: auto;
}

.tag-modal-suggestions-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.tag-modal-suggestions-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.tag-suggestion-chip {
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.78rem;
  padding: 2px 8px;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

.tag-suggestion-chip:hover {
  background: rgba(var(--primary-color-rgb), 0.12);
  color: var(--primary-color);
  border-color: rgba(var(--primary-color-rgb), 0.6);
}

.tag-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 6px;
}

/* Add-tag button below tab details row */
.board-tags-actions-row {
  margin-top: 6px;
  display: flex;
  justify-content: flex-start;
}

.board-add-tag-button {
  cursor: pointer;
  padding: 7px 14px !important;
  padding-right: 8px !important;
  font-size: 0.8rem !important;
  border-radius: 45px;
  background: linear-gradient(
    120deg,
    rgba(var(--primary-color-rgb), 0.07),
    rgba(var(--primary-color-rgb), 0.03)
  ) !important;
  border: 1px dashed rgba(var(--primary-color-rgb), 0.35) !important;
  color: rgba(var(--primary-color-rgb), 0.8) !important;
  transition: background 0.18s ease, box-shadow 0.18s ease, color 0.18s ease, border-color 0.18s ease !important;
  user-select: none;
}

.board-add-tag-button:hover {
  background: linear-gradient(
    120deg,
    rgba(var(--primary-color-rgb), 0.18),
    rgba(var(--primary-color-rgb), 0.08)
  ) !important;
  border-color: rgba(var(--primary-color-rgb), 0.65) !important;
  box-shadow: 0 2px 10px rgba(var(--primary-color-rgb), 0.18) !important;
  color: var(--primary-color) !important;
}

/* Same press as .btn-primary / .btn-secondary */
.board-add-tag-button:active {
  transform: scale(0.95);
  box-shadow: none;
}

.board-action-btn:hover {
  opacity: 1;
  background: rgba(var(--primary-color-rgb), 0.12);
  color: var(--primary-color);
}

.board-item.selected .board-action-btn {
  color: var(--text-primary);
}

.board-item.selected .board-action-btn:hover {
  background: rgba(var(--primary-color-rgb), 0.12);
  color: var(--primary-color);
}

.board-content {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.board-text {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

/* Board type icon: left side of tab title, small; hidden on hover */
.board-type-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-left: 0;
  width: 14px;
  height: 14px;
  color: var(--text-secondary);
  opacity: 0.85;
  transition: opacity 0.12s ease;
}

.board-type-icon .board-type-icon-svg {
  width: 100%;
  height: 100%;
}

.board-item.selected .board-type-icon {
  color: var(--text-secondary);
}

.board-item:hover .tab-share-indicator {
  opacity: 1;
  background: rgba(var(--primary-color-rgb), 0.1);
  transform: scale(1.1);
}

.board-item.selected .tab-share-indicator {
  color: var(--primary-color);
}

.board-delete {
  box-sizing: content-box;
  background: transparent;
  border: none;
  border-radius: 4px;
  color: var(--text-secondary);
  font-size: 1.15rem;
  padding: 4px;
  margin: -4px -4px -4px auto;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.12s ease, transform 0.1s ease, background 0.12s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  margin-left: auto;
}

.board-item:hover .board-delete {
  opacity: 1;
  color: var(--text-primary);
}

.board-item.selected .board-delete {
  color: var(--text-primary);
}

.board-delete:hover {
  opacity: 1 !important;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  transform: scale(1.1);
}

.board-item.selected .board-delete:hover {
  background: rgba(var(--primary-color-rgb), 0.12);
  color: var(--primary-color);
}

#theme-toggle {
  background: none;
  border: none;
  color: var(--text-primary);
  width: 35px;
  height: 35px;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-bg);
}

#theme-toggle:hover {
  background: var(--hover-bg);
}

/* Profile Modal Styles */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(20, 20, 20, 0.7);
  z-index: 1000;
  display: none;
  justify-content: center;
  align-items: center;
}

/* Titlebar modals: same backdrop as settings (dark overlay + blur) */
#time-modal {
  background: rgba(0, 0, 0, 0.5) !important;
}

/* Profile Pictures Container Styles */
.profile-pictures-container {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.profile-picture {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  object-fit: cover;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.profile-picture:hover {
  transform: scale(1.1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  z-index: 10;
  position: relative;
}

/* Profile content layout */
.profile-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.profile-content span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.modal-content {
  max-width: 800px;
  width: 90%;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-secondary);
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
  margin: 0;
  padding: 0;
}

/* mainModalSlideIn animation moved to animations.css */

/* linkModalSlideIn animation moved to animations.css */

/* youtubeModalSlideIn animation moved to animations.css */

/* discordModalSlideIn animation moved to animations.css */

.modal-content h2 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-primary);
}
.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.modal-close {
  align-self: flex-end;
  background: var(--hover-bg);
  color: var(--text-primary);
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  cursor: pointer;
  font-size: 1rem;
  transition: var(--transition-bg);
  min-width: 120px;
  text-align: center;
}
.modal-close:hover {
  background: var(--primary-color);
  color: #fff;
}

/* Webkit browsers */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
  background: #00000000;
  border-radius: 8px;
}
::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 8px;
  min-height: 40px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--secondary-color);
}
::-webkit-scrollbar-corner {
  background: var(--hover-bg);
}

/* Dark mode scrollbars */
[data-theme="dark"] ::-webkit-scrollbar {
  background: #00000000;
}
[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background: var(--primary-color);
}
[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
  background: var(--secondary-color);
}
[data-theme="dark"] ::-webkit-scrollbar-corner {
  background: var(--bg-primary);
}



/* Favorites section header */
#favorites-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px 10px 6px;
  margin: 2px 0px;
  border-radius: 8px 8px;
  border: 1px solid color-mix(in srgb, var(--border-color) 72%, transparent);
  background: rgba(var(--bg-secondary-rgb), 0.72);
  color: var(--text-primary);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: transform 0.22s cubic-bezier(0.34, 2.2, 0.64, 1),
              padding 0.22s cubic-bezier(0.34, 2.2, 0.64, 1),
              border-left-width 0.22s cubic-bezier(0.34, 2.2, 0.64, 1),
              background 0.15s ease,
              box-shadow 0.15s ease,
              color 0.15s ease,
              border-color 0.15s ease;
  cursor: pointer;
}

#favorites-label {
  font-size: 0.9rem;
  color: currentColor;
  font-weight: 500;
  letter-spacing: 0.01em;
}

#favorites-toggle {
  background: none;
  border: none;
  color: currentColor;
  font-size: 0.9rem;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  transition: var(--transition-bg);
  pointer-events: none;
}

#favorites-toggle:hover {
  background: var(--hover-bg);
}

#favorites-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 5000px; /* large so content can expand */
  overflow: hidden;
  position: relative;
  padding: 10px 4px 10px 8px;
  margin: 0;
  border-radius: 0 0 8px 8px;
  background: var(--bg-primary);
}

.board-favorite {
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.1rem;
  padding: 0 4px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  margin-right: 4px;
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
}

.board-item:hover .board-favorite {
  opacity: 0.7;
}

.board-favorite:hover {
  opacity: 1 !important;
  background: var(--hover-bg);
  color: #FFD700;
}

.board-favorite.active {
  opacity: 1;
  color: #FFD700;
}

.btn-primary {
  background: var(--primary-color);
  color: var(--text-primary);
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.15s;
  text-align: center;
}

.btn-primary:hover {
  background: var(--secondary-color) !important;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(var(--primary-color-rgb), 0.3);
}

.btn-secondary {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.15s;
  text-align: center;
}

.btn-secondary:hover {
  background: rgba(var(--primary-color-rgb), 0.2);
  color: var(--primary-color);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn-primary:active,
.btn-secondary:active {
  transform: scale(0.95);
}

/* Disabled buttons (works for any primary/secondary button anywhere) */
.btn-primary:disabled,
.btn-primary[disabled],
.btn-secondary:disabled,
.btn-secondary[disabled] {
  background: var(--bg-primary) !important;
  color: var(--text-secondary) !important;
  cursor: not-allowed !important;
  opacity: 0.6 !important;
  pointer-events: auto !important;
  transform: none !important;
}

/* Remove hover effects when disabled */
.btn-primary:disabled:hover,
.btn-primary[disabled]:hover,
.btn-secondary:disabled:hover,
.btn-secondary[disabled]:hover {
  background: var(--bg-primary) !important;
  color: var(--text-secondary) !important;
  transform: none !important;
  box-shadow: none !important;
}

/* Make sure the header and search section don't scroll */
#sidebar-header,
#search-section {
  flex-shrink: 0;
}

/* Adjust the favorites and boards sections to fit within the scrollable area */
#favorites-section {
  display: flex;
  flex-direction: column;
  gap: 0px;
  min-width: 0;
}

.link-modal-content {
  max-width: 400px;
  width: 90%;
  animation: linkModalSlideIn 0.3s ease-out;
}

.link-content {
  padding: 20px;
  display: flex;
  flex-direction: column;
}

#link-url-input {
  padding: 8px;
  margin-bottom: 16px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  outline: none;
}

#link-url-input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(var(--primary-color-rgb), 0.1);
}

/* Custom link modal action styles */
.link-action-edit {
  color: var(--primary-color);
  cursor: text;
  margin: 0 8px;
  text-decoration: underline;
}
.link-action-edit:hover {
  color: var(--secondary-color);
}

.link-action-remove {
  color: var(--primary-color);
  cursor: pointer;
  margin: 0 8px;
  text-decoration: underline;
}
.link-action-remove:hover {
  color: var(--secondary-color);
}

/* Remove custom tooltip styles */
#boards-header[title]:hover::after,
.board-item[title]::after,
#favorites-header[title]:hover::after {
  display: none;
}

/* Board hover tooltip – speech bubble to the right of tab, arrow points left */
.tab-hover-tooltip {
  position: fixed;
  z-index: 10000;
  transform: translateY(-50%);
  padding: 8px 14px;
  max-width: 280px;
  background: var(--bg-secondary, #fff);
  color: var(--text-primary, #222);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.35;
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12), 0 0 0 1px var(--border-color, rgba(0, 0, 0, 0.08));
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.tab-hover-tooltip.show {
  opacity: 1;
}
.tab-hover-tooltip .tab-tooltip-label {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Delete Tab Modal – bottom sheet styles in settings-modal.css (sheet-overlay) */


.right-btn.active,
#title-bar #btn-settings.active {
  background: rgba(var(--hover-bg-rgb), 0.5);
  color: var(--primary-color);
}
.right-btn.active svg,
#title-bar #btn-settings.active svg {
  stroke: var(--primary-color) !important;
  fill: none;
}

/* Vertical tab UI for collapsed sidebar */
#vertical-tab-ui {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-primary);
  z-index: 10;
}

.vertical-tab {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  padding: 16px 8px;
  margin: 8px auto;
  transition: all 0.15s ease;
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 300px;
  position: relative;
  color: var(--text-primary);
}

/* dark mode support for vertical tab */
.dark .vertical-tab {
  color: var(--text-secondary);
}

.vertical-tab .tab-text {
  margin-top: 16px;
  font-size: 1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100px;
}

.rename-input {
  background: var(--bg-secondary);
  border: 1px solid var(--primary-color);
  border-radius: 4px;
  padding: 2px 4px;
  font-size: 0.95rem;
  color: var(--text-primary);
  width: 100%;
  min-width: 0;
  outline: none;
}

.rename-input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(var(--primary-color-rgb), 0.1);
}

#banner {
  transition: opacity 0.3s ease-in-out, pointer-events 0.3s ease-in-out, left 0.2s ease-in-out;
}

body.logged-out .requires-login,
body.logged-out #search-section,
body.logged-out .loading-indicator,
body.logged-out .title-bar-user-info,
body.logged-out #btn-settings {
  display: none !important;
}

body.logged-out #sidebar {
  display: none;
}

body.logged-out #main-content {
  display: none;
}

/* fadeIn animation moved to animations.css */

#favorites-section:empty,
#favorites-section:has(#favorites-list:empty),
body.logged-out #favorites-section {
  display: none !important;
}

/* Loading indicator */
.loading-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  margin: 48px 0;
  opacity: 0;
  transition: all 0.3s ease-in-out;
  transform: translateY(-10px);
}

.loading-indicator.fade-in,
.section-visible .loading-indicator {
  opacity: 1;
  transform: translateY(0);
}

.loading-indicator::before {
  content: '';
  width: 20px;
  height: 20px;
  margin-right: 10px;
  border: 2px solid var(--text-primary);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* spin animation moved to animations.css */

/* fadeInOut animation moved to animations.css */

.section-hidden {
  display: none !important;
}

.section-visible {
  display: block !important;
  animation: fadeIn 0.3s ease-in-out;
}

/* Wrapper so collaborator circles can be hovered (title-bar-center is no-drag only on direct children; this has no-drag so hovers work) */
.title-bar-collaborators-wrap {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  -webkit-app-region: no-drag;
  pointer-events: auto;
}

/* Wrapper so role badge (owner / editor / viewer) can be hovered to see tooltip */
.title-bar-role-badge-wrap {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  -webkit-app-region: no-drag;
  pointer-events: auto;
}

/* Recipients container styles */
.recipients-container {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0 10px 0 0;
  padding: 4px 0;
}

.recipient-circle {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary-color);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
  border: 2px solid var(--bg-primary);
  position: relative;
  overflow: hidden;
}

.recipient-circle:hover {
  transform: scale(1.1);
  z-index: 10;
}

.recipient-circle.recipient-circle--away {
  opacity: 0.38;
  filter: grayscale(0.35);
}

.recipient-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.recipient-initials {
  background: var(--primary-color);
  color: white;
}

/* Login error message */
.login-error-message {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  min-width: 350px;
  max-width: 500px;
}

.error-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}

.error-icon {
  font-size: 32px;
}

.error-text h3 {
  margin: 0 0 8px 0;
  color: var(--text-primary);
  font-size: 18px;
}

.error-text p {
  margin: 0 0 16px 0;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.4;
}

.retry-login-btn {
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.retry-login-btn:hover {
  background: var(--primary-color-hover, var(--primary-color));
  transform: translateY(-1px);
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

#login-prompt-modal .error-message {
  color: #ff4444;
  background-color: rgba(255, 68, 68, 0.1);
  padding: 10px;
  border-radius: 4px;
  margin: 10px 0;
  text-align: center;
  font-size: 14px;
}

/* Project strip context: no bar chrome — each button matches sidebar toggle */
.project-actions-bar {
  position: fixed;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0;
  padding-top: 6px;
  z-index: 10000;
  background: none;
  border: none;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.project-actions-btn {
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: rgba(var(--bg-secondary-rgb), 0.52);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow:
    inset 0 1px 4px rgba(0, 0, 0, 0.1),
    0 4px 18px rgba(0, 0, 0, 0.12);
  color: var(--text-primary);
  cursor: pointer;
  padding: 0;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.15s ease;
}

.project-actions-btn:hover {
  background: rgba(var(--hover-bg-rgb), 0.88);
  border-color: rgba(var(--primary-color-rgb), 0.45);
  color: var(--primary-color);
  box-shadow:
    inset 0 1px 3px rgba(0, 0, 0, 0.08),
    0 6px 22px rgba(var(--primary-color-rgb), 0.22);
  transform: translateY(-2px);
}

.project-actions-btn:active {
  transform: translateY(0) scale(0.96);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.12);
}

.project-actions-btn--destructive:hover {
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.5);
  background: rgba(220, 53, 69, 0.14);
  box-shadow:
    inset 0 1px 3px rgba(0, 0, 0, 0.08),
    0 6px 22px rgba(248, 113, 113, 0.22);
}

.project-actions-btn--destructive:active {
  color: #fca5a5;
}

.project-actions-btn:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 2px rgba(var(--primary-color-rgb), 0.45),
    inset 0 1px 4px rgba(0, 0, 0, 0.1);
}

.project-actions-btn--destructive:focus-visible {
  box-shadow:
    0 0 0 2px rgba(248, 113, 113, 0.5),
    inset 0 1px 4px rgba(0, 0, 0, 0.1);
}

.project-actions-btn svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  flex-shrink: 0;
}

#boards-list.collapsed #boards-arrow::before,
body.logged-out #boards-arrow::before,
#boards-header.collapsed #boards-arrow::before {
  transform: translate(-50%, -50%) rotate(-45deg);
}

/* mindmap-home-btn when used in title bar (element removed; kept for any legacy ref) */
.mindmap-home-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  margin-right: 8px;
  border: none;
  background: none;
  box-shadow: none;
  border-radius: 0;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.15s;
  pointer-events: auto;
  -webkit-app-region: no-drag;
  z-index: 1;
}

/* Color shades preview styles */
.color-shades-preview {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

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

.shade-label {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 500;
}

.shade-preview {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Dark mode adjustments for shade previews */
[data-theme="dark"] .shade-preview {
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .shade-label {
  color: var(--text-secondary);
}

#discord-community-modal[style*="display: flex"] {
  display: flex !important;
}

.discord-community-modal-content.discord-sheet-panel.app-bottom-sheet {
  max-width: 600px;
  max-height: 85vh;
}

.discord-sheet-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.discord-sheet-body {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
}

.discord-sheet-footer {
  flex-shrink: 0;
  display: flex;
  gap: 12px;
  padding: 16px 24px 150px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  background: transparent;
}

.discord-community-content {
  text-align: center;
  padding: 20px 0;
}

.discord-icon {
  margin-bottom: 20px;
  color: #5865F2;
}

.discord-icon svg {
  filter: drop-shadow(0 2px 4px rgba(88, 101, 242, 0.3));
}

.discord-community-content h4 {
  margin: 0 0 10px 0;
  font-size: 1.5rem;
  color: var(--text-primary);
  font-weight: 600;
}

.discord-community-content p {
  margin: 0 0 25px 0;
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.5;
}

.discord-join-btn {
  background: #5865F2;
  color: white;
  border: none;
  padding: 9px 24px;
  border-radius: 43px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  justify-content: center;
}

.discord-join-btn:hover {
  background: #4752C4;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(88, 101, 242, 0.3);
}

.discord-join-btn:active {
  transform: translateY(0);
}

/* Dark mode adjustments for Discord popup */
[data-theme="dark"] .discord-community-content h4 {
  color: var(--text-primary);
}

[data-theme="dark"] .benefit-item span:last-child {
  color: var(--text-primary);
}

/* Responsive design for Discord benefits */
@media (max-width: 480px) {
  .discord-sheet-footer {
    flex-direction: column;
    gap: 8px;
  }
}

#notifications-modal[style*="display: flex"] {
  display: flex !important;
}

.notifications-modal-content.notifications-sheet-panel.app-bottom-sheet {
  max-width: 450px;
  max-height: 85vh;
}

.notifications-sheet-close {
  width: 36px;
  height: 36px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--hover-bg);
  border: none;
  border-radius: 10px;
  color: var(--text-primary);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}

.notifications-sheet-close:hover {
  background: rgba(var(--primary-color-rgb), 0.2);
  color: var(--primary-color);
}

.notifications-sheet-close svg {
  width: 20px;
  height: 20px;
}

.notifications-sheet-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  min-height: 0;
  padding: 20px 24px 24px;
  background: transparent;
}

.notifications-sheet-footer {
  flex-shrink: 0;
  padding: 16px 24px 150px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  background: transparent;
}

.notifications-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 20px 0;
}

.notifications-icon {
  margin-bottom: 16px;
  color: var(--text-secondary);
  opacity: 0.6;
}

.notifications-content h4 {
  margin: 0 0 8px 0;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-primary);
}

.notifications-content p {
  margin: 0 0 12px 0;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.5;
}


/* notifications close button: pill styles in settings-modal.css (.app-bottom-sheet) */

/* Shell background: .app-bottom-sheet on panel */
[data-theme="dark"] .notifications-modal-content {
  background: transparent;
}

/* Email Status Indicators */
.email-tag .email-status {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.email-tag .email-status.accepted {
  color: #10b981;
}

.email-tag .email-status.declined {
  color: #ef4444;
}

.email-tag .email-status.pending {
  color: #f59e0b;
}

.accepted-dot, .declined-dot, .pending-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.accepted-dot {
  background-color: #10b981;
}

.declined-dot {
  background-color: #ef4444;
}

.pending-dot {
  background-color: #f59e0b;
}

.email-actions {
  display: flex;
  gap: 4px;
  align-items: center;
}

.email-actions button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s;
}

.email-actions button:hover {
  background-color: rgba(0, 0, 0, 0.1);
}


.remove-email {
  color: #6b7280;
}

.responded-at {
  font-size: 0.75rem;
  color: #6b7280;
  margin-left: 4px;
}
/* Email Invitation Notification Items */
.notification-item {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 12px;
  transition: all 0.2s ease;
  position: relative;
  display: flex;
  flex-direction: column;
}

.notification-item-content {
  flex: 1;
  min-width: 0;
}

.notification-item-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.notification-item-body {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-bottom: 6px;
}

.notification-item-time {
  font-size: 11px;
  color: var(--text-secondary);
  opacity: 0.75;
}

.notification-item-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.notification-accept-btn {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  border: none;
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
}

.notification-accept-btn:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(16, 185, 129, 0.4);
}

.notification-decline-btn {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
  border: none;
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
}

.notification-decline-btn:hover {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(239, 68, 68, 0.4);
}

.notification-item:hover {
  background: var(--bg-hover);
  border-color: var(--accent-color);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.notification-item.unread {
  border-left: 4px solid var(--accent-color);
  background: linear-gradient(135deg, var(--bg-primary) 0%, rgba(var(--accent-color-rgb), 0.05) 100%);
}

.notification-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.notification-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.3;
}

.notification-time {
  font-size: 12px;
  color: var(--text-secondary);
  background: var(--bg-tertiary);
  padding: 4px 8px;
  border-radius: 12px;
  white-space: nowrap;
  margin-left: 12px;
}

.notification-message {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.4;
  margin: 0 0 12px 0;
}

.notification-actions-inline {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.notification-action-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 80px;
  text-align: center;
}

.accept-btn {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
}

.accept-btn:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(16, 185, 129, 0.4);
}

.decline-btn {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
  box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
}

.decline-btn:hover {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(239, 68, 68, 0.4);
}

/* Email invitation specific styling */
.notification-item[data-type="email_invitation"] {
  background: linear-gradient(135deg, var(--bg-primary) 0%, rgba(59, 130, 246, 0.05) 100%);
  border: 1px solid var(--primary-color);
}

.notification-item[data-type="email_invitation"]:hover {
  border-color: var(--primary-color);
  background: linear-gradient(135deg, var(--bg-hover) 0%, rgba(59, 130, 246, 0.1) 100%);
}

.notification-item[data-type="email_invitation"].unread {
  border-left: 4px solid var(--primary-color);
  background: linear-gradient(135deg, var(--bg-primary) 0%, rgba(59, 130, 246, 0.08) 100%);
}

/* Notification list container */
.notification-list {
  max-height: 650px;
  overflow-y: auto;
  padding: 8px;
}

.notification-list::-webkit-scrollbar {
  width: 6px;
}

.notification-list::-webkit-scrollbar-track {
  background: var(--bg-tertiary);
  border-radius: 3px;
}

.notification-list::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}

.notification-list::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

/* Dark theme adjustments */
[data-theme="dark"] .notification-item {
  background: var(--bg-primary);
  border-color: var(--border-color);
}

[data-theme="dark"] .notification-item:hover {
  background: var(--bg-hover);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .notification-item.unread {
  background: linear-gradient(135deg, var(--bg-primary) 0%, rgba(var(--accent-color-rgb), 0.1) 100%);
}

[data-theme="dark"] .notification-time {
  background: var(--bg-secondary);
  color: var(--text-secondary);
}

/* App Loading Screen */
.app-loading-screen {
  position: fixed;
  top: var(--title-bar-height); /* Start below title bar */
  left: 0;
  width: 100%;
  height: calc(100% - var(--title-bar-height)); /* Adjust height to not cover title bar */
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  transition: opacity 0.3s ease-out;
}

.app-loading-screen.hidden {
  opacity: 0;
  pointer-events: none;
}

.app-loading-content {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.app-loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border-color);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.app-loading-text {
  font-size: 18px;
  font-weight: 500;
  color: var(--text-primary);
}

.app-loading-status {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: -10px;
}

/* Collapse title bar elements during app loading - collapsed by default until loading completes */
#premium-upgrade-btn {
  display: none;
}

/* Show title bar elements after app has loaded */
body.app-loaded #premium-upgrade-btn {
  display: flex;
}

.sidebar-bar-wrapper {
  user-select: none;        /* Prevent text selection */
  pointer-events: none;     /* Prevent mouse interactions (clicks) */
}

.sidebar-bar-wrapper * {
  pointer-events: auto;     /* Keep buttons clickable if needed */
  outline: none;            /* Remove focus outline */
}

.sidebar-bar-wrapper button,
.sidebar-bar-wrapper input,
.sidebar-bar-wrapper a {
  pointer-events: auto;     /* allow buttons/links to be interactive again if needed */
  user-select: none;        /* still prevent text selection on them */
}

.sidebar-bar-wrapper:focus,
.sidebar-bar-wrapper *:focus {
  outline: none;            /* remove keyboard focus outline */
}

/* Disable text selection for time modal UI */
#time-modal {
  user-select: none;
}

/* Prevent selection on layout + text display */
#time-modal div,
#time-modal span {
  user-select: none;
}

/* Remove focus outline from non-input elements */
#time-modal *:not(input):not(textarea):not(select) {
  outline: none;
}

/* Prevent accidental drag highlight on modal container */
.time-modal-content,
.time-immersive,
.time-now,
.time-footer {
  user-select: none;
}

/* =============================
   Welcome Popup – Lock Selection & Focus
   ============================= */

/* Entire popup: no text selection */
.welcome-popup,
.welcome-popup * {
  user-select: none !important;
}

/* Prevent popup container from being focusable */
.welcome-popup {
  outline: none;
}

/* Header text + paragraphs not focusable or selectable */
.welcome-popup h3,
.welcome-popup p,
.welcome-popup-name,
.welcome-popup-icon-wrap,
.welcome-popup-icon-wrap * {
  pointer-events: none;  /* no interaction needed */
}

/* Keep ONLY the close button interactive */
.welcome-popup-close {
  pointer-events: auto !important;
  user-select: none !important;
}


/* =========================
   Welcome Screen - App Mode
   ========================= */

/* Prevent text selection everywhere in welcome */
#welcome-content,
#welcome-content *:not(input):not(textarea) {
  user-select: none !important;
}

/* Prevent image dragging */
#welcome-content img {
  -webkit-user-drag: none;
  pointer-events: none; /* logo shouldn't be clickable */
}

/* Prevent SVG dragging/selection */
#welcome-content svg {
  pointer-events: none;
}

/* Prevent focus outlines on non-interactive elements */
#welcome-content h1,
#welcome-content h2,
#welcome-content h3,
#welcome-content p,
#welcome-content div {
  outline: none;
}

/* Feature cards should not be selectable */
.feature-card {
  user-select: none;
  pointer-events: none; /* they aren't interactive */
}

/* Allow real interactive elements */
#welcome-content button {
  pointer-events: auto !important;
  user-select: none;
}

/* Remove focus ring unless keyboard navigating */
#welcome-content button:focus {
  outline: none;
}

/* Force-hide create affordances while in shared viewer mode. */
body.viewer-mode #boards-header-actions,
body.viewer-mode #bm-tag-add-btn,
body.viewer-mode .split-board-panes-menu-boards-header-actions,
body.viewer-mode .split-board-panes-menu-tag-add-btn,
body.viewer-mode #add-btn,
body.viewer-mode .board-add-tag-button {
  display: none !important;
}

/* In viewer mode, text editor toolbars should not be visible. */
body.viewer-mode .content-container.read-only .ql-toolbar,
body.viewer-mode .content-container.read-only .ql-snow.ql-toolbar {
  display: none !important;
}

/* ───────────── Split Editor: Boards Menu Overlay ───────────── */

.boards-menu-overlay {
  position: absolute;
  inset: 0;
  z-index: 80;
  --split-board-grid-columns: 3;
  --boards-menu-header-height: 36px;
  display: none;
  flex-direction: column;
  box-sizing: border-box;
  pointer-events: none;
  overflow: hidden;
  border-radius: 14px;
  background:
    radial-gradient(ellipse 80% 40% at 50% 0%, rgba(var(--primary-color-rgb), 0.11), transparent 65%),
    rgba(var(--bg-primary-rgb), 0.25);
  border: 1px solid rgba(var(--primary-color-rgb), 0.14);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    0 8px 32px rgba(0, 0, 0, 0.22);
}

.content-container.boards-menu-underlay-hidden > :not(.boards-menu-overlay) {
  visibility: hidden;
  pointer-events: none;
}

.boards-menu-overlay.is-open {
  display: flex;
  pointer-events: auto;
  animation: splitMenuIn 0.18s cubic-bezier(0.2, 0, 0, 1) both;
}

.boards-menu-overlay[hidden]:not(.is-open) {
  display: none !important;
}

@keyframes splitMenuIn {
  from { opacity: 0; transform: scale(0.984) translateY(5px); }
  to   { opacity: 1; transform: scale(1)    translateY(0); }
}

/* ── Toolbar ── */
.boards-menu-toolbar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px 8px 14px;
  cursor: grab;
  -webkit-user-select: none;
  user-select: none;
}

.boards-menu-toolbar .boards-menu-search,
.boards-menu-toolbar [data-boards-menu-input] {
  cursor: text;
  -webkit-user-select: text;
  user-select: text;
}

.boards-menu-toolbar button,
.boards-menu-toolbar .board-pane-close,
.boards-menu-toolbar a[href] {
  cursor: pointer;
}

body.board-pane-reordering
  .boards-menu-overlay.is-open
  .boards-menu-toolbar {
  cursor: grabbing;
}

/* Search bar – self-contained, no sidebar dependency */
.boards-menu-search {
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  min-width: 300px;
  width: 300px;
  max-width: 300px;
  gap: 6px;
  padding: 5px 2px 7px;
  background: transparent;
  border: none;
  border-bottom: 1px solid color-mix(in srgb, var(--border-color) 70%, transparent);
  border-radius: 0;
  transition: border-color 0.15s ease;
  box-sizing: border-box;
}

.boards-menu-search:hover {
  border-bottom-color: rgba(255, 255, 255, 0.75);
}

.boards-menu-search:focus-within {
  border-bottom-color: var(--primary-color);
}

.boards-menu-search input {
  flex: 1;
  min-width: 0;
  width: 300px;
  max-width: 300px;
  padding: 6px 4px 4px 2px;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--text-primary);
  font-size: 0.875rem;
  font-family: inherit;
  outline: none;
  transition: color 0.15s ease;
  box-sizing: border-box;
}

.boards-menu-search input:focus {
  outline: none;
  background: transparent;
}

.boards-menu-search input::placeholder {
  color: var(--text-secondary);
  opacity: 0.75;
}

.boards-menu-search-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 32px;
  align-self: flex-end;
  padding-bottom: 2px;
  background: transparent;
  pointer-events: none;
  transition: color 0.15s ease;
}

.boards-menu-search-icon {
  color: var(--text-secondary);
  opacity: 0.85;
}

.boards-menu-search:focus-within .boards-menu-search-icon {
  color: var(--primary-color);
  opacity: 1;
}

.boards-menu-search:has(input.tag-filter-active) {
  border-bottom-color: var(--primary-color);
}

/* ── Sections scroll area ── */
.boards-menu-sections-scroll {
  flex: 1;
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-x: none;
  padding: 8px 10px 12px;
  box-sizing: border-box;
}

/* ── Section shells ── */
.boards-menu-overlay .boards-menu-tags-section,
.boards-menu-overlay .boards-menu-favorites-section,
.boards-menu-overlay .boards-menu-boards-section {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: none;
  background: transparent;
  box-sizing: border-box;
}

.boards-menu-overlay
  .boards-menu-tags-content.bm-section-content {
  margin: 0;
  border-radius: 0;
}

/* ── Tags section ── */
.boards-menu-tags-section {
  flex-shrink: 0;
  max-height: none;
  padding: 0;
  overflow: visible;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 6px;
  margin-bottom: 2px;
}

.boards-menu-tags-content.bm-section-content:not(.collapsed) {
  max-height: none;
  overflow-x: hidden;
  overflow-y: visible;
}

.boards-menu-tag-list.bm-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
}

/* ── Favorites section ── */
.boards-menu-favorites-section {
  flex-shrink: 0;
  max-height: none;
  padding: 0;
  overflow: visible;
}

.boards-menu-favorites-block {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.boards-menu-favorites-scroll {
  max-height: none;
  overflow-x: hidden;
  overflow-y: visible;
  padding: 20px;
  box-sizing: border-box;
}

.boards-menu-favorites-list.boards-list--grid {
  min-width: 0;
  overflow-x: hidden;
}

/* ── Boards section ── */
.boards-menu-boards-section {
  flex: 0 0 auto;
  max-height: none;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: visible;
  padding: 0;
  box-sizing: border-box;
}

/* ── Section header rows ── */
.boards-menu-overlay .bm-section-row {
  align-items: center;
  min-height: 0;
  margin: 0;
  flex-shrink: 0;
}

/* Section header bar — transparent, no card look */
.boards-menu-overlay .bm-section-header {
  height: auto;
  min-height: 0;
  max-height: none;
  margin: 0;
  padding: 15px 4px 10px 2px;
  border: none;
  border-radius: 0;
  background: transparent;
}

.boards-menu-overlay .bm-section-header .bm-section-title {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-secondary);
  opacity: 0.6;
  pointer-events: none;
  user-select: none;
}

.boards-menu-overlay .bm-section-header.arc-add-target-pulse,
.boards-menu-overlay [data-boards-menu-boards-header].arc-add-target-pulse {
  animation: arc-add-target-pulse 1.4s ease-in-out infinite;
}

/* Full-width header row */
.boards-menu-overlay .bm-section-header.boards-menu-section-header {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.boards-menu-overlay
  .bm-section-header.boards-menu-section-header
  .bm-section-title {
  min-width: 0;
}

/* ── Section action buttons (Add Tab / Add Group) ── */
.boards-menu-boards-header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  margin-left: auto;
}

.boards-menu-boards-header-actions .board-action-btn {
  width: 28px;
  height: 28px;
  padding: 0;
  flex-shrink: 0;
  border: none;
  border-radius: 8px;
  background: var(--primary-color);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.14s ease, transform 0.1s ease, box-shadow 0.14s ease;
}

.boards-menu-boards-header-actions .board-action-btn:hover {
  background: var(--secondary-color);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(var(--primary-color-rgb), 0.3);
}

.boards-menu-boards-header-actions .board-action-btn:active {
  transform: scale(0.95);
  box-shadow: none;
}

/* ── Boards block ── */
.boards-menu-boards-block {
  flex: 0 0 auto;
  max-height: none;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: visible;
  transition: max-height 0.24s ease, opacity 0.18s ease;
}

.boards-menu-boards-block.collapsed {
  flex: 0 0 auto;
  max-height: 0;
  min-height: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.boards-menu-boards-scroll {
  flex: 0 0 auto;
  max-height: none;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: visible;
  overscroll-behavior-x: none;
  box-sizing: border-box;
}

.boards-menu-overlay .boards-menu-tag-list.bm-tag-list {
  padding: 8px;
  box-sizing: border-box;
}

.boards-menu-overlay .boards-menu-boards-scroll {
  padding: 20px;
  box-sizing: border-box;
}

/* ── Tab grid ── */
.boards-menu-overlay .boards-list.boards-list--grid {
  grid-template-columns: repeat(var(--split-board-grid-columns), minmax(0, 1fr));
  justify-content: start;
  justify-items: stretch;
  align-items: start;
  min-width: 0;
  overflow-x: visible;
}

.boards-menu-overlay .board-item.board-grid-card {
  width: 100%;
  box-sizing: border-box;
}

/* New Board tile in boards grid */
.boards-menu-new-board-tile {
  --board-color: rgba(var(--primary-color-rgb), 0.5);
  cursor: pointer;
  background: linear-gradient(
    135deg,
    rgba(var(--primary-color-rgb), 0.06) 0%,
    rgba(var(--primary-color-rgb), 0.02) 100%
  ) !important;
  border: 1px dashed rgba(var(--primary-color-rgb), 0.3) !important;
  transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease !important;
}

.boards-menu-new-board-tile:hover {
  background: linear-gradient(
    135deg,
    rgba(var(--primary-color-rgb), 0.13) 0%,
    rgba(var(--primary-color-rgb), 0.05) 100%
  ) !important;
  border-color: rgba(var(--primary-color-rgb), 0.6) !important;
  box-shadow: 0 4px 18px rgba(var(--primary-color-rgb), 0.15), inset 0 0 0 1px rgba(var(--primary-color-rgb), 0.08) !important;
  transform: scale(1.02) !important;
}

.boards-menu-new-board-tile .board-text {
  color: rgba(var(--primary-color-rgb), 0.85);
  font-weight: 500;
  letter-spacing: 0.01em;
}

.boards-menu-new-board-preview {
  align-items: center;
  justify-content: center;
  min-height: 120px;
  border-radius: 8px;
}

.boards-menu-new-board-preview svg {
  color: rgba(var(--primary-color-rgb), 0.55);
  filter: drop-shadow(0 0 6px rgba(var(--primary-color-rgb), 0.4));
  transition: color 0.2s ease, filter 0.2s ease, transform 0.2s ease;
}

.boards-menu-new-board-tile:hover .boards-menu-new-board-preview svg {
  color: rgba(var(--primary-color-rgb), 0.9);
  filter: drop-shadow(0 0 10px rgba(var(--primary-color-rgb), 0.65));
  transform: scale(1.15);
}

/* Add Tag tile in tags grid */
.boards-menu-add-tag-tile {
  cursor: pointer;
  padding: 7px 14px !important;
  padding-right: 8px !important;
  font-size: 0.8rem !important;
  background: linear-gradient(
    120deg,
    rgba(var(--primary-color-rgb), 0.07),
    rgba(var(--primary-color-rgb), 0.03)
  ) !important;
  border: 1px dashed rgba(var(--primary-color-rgb), 0.35) !important;
  color: rgba(var(--primary-color-rgb), 0.8) !important;
  transition: background 0.18s ease, box-shadow 0.18s ease, color 0.18s ease, border-color 0.18s ease !important;
}

.boards-menu-add-tag-tile span:first-child {
  color: rgba(var(--primary-color-rgb), 0.8);
  font-weight: 500;
}

.boards-menu-add-tag-tile .bm-tag-badge {
  color: rgba(var(--primary-color-rgb), 0.9) !important;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px 3px;
  border-radius: 4px;
}

.boards-menu-add-tag-tile:hover {
  background: linear-gradient(
    120deg,
    rgba(var(--primary-color-rgb), 0.18),
    rgba(var(--primary-color-rgb), 0.08)
  ) !important;
  border-color: rgba(var(--primary-color-rgb), 0.65) !important;
  box-shadow: 0 2px 10px rgba(var(--primary-color-rgb), 0.18) !important;
  color: var(--primary-color) !important;
}

.boards-menu-add-tag-tile:hover span:first-child {
  color: var(--primary-color);
}

.boards-menu-add-tag-tile:hover .bm-tag-badge {
  color: var(--primary-color);
}





/* Wrapper for content-wrapper so scroll fades can be positioned over it */
.content-wrapper-outer {
  flex: 1;
  min-height: 0;
  position: relative;
  display: flex;
  flex-direction: column;
}

/* Split pane: drag-reorder from top (title row + tags); no visible handle */
body.board-pane-reordering {
  cursor: grabbing;
  -webkit-user-select: none;
  user-select: none;
}

/* Dots above the drop slot during split reorder (fixed, no layout space) */
.board-pane-reorder-indicator {
  display: none;
  position: fixed;
  z-index: 10004;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 12px;
  padding: 4px 10px;
  margin: 0;
  pointer-events: none;
  left: 0;
  top: 0;
  transform: translate(-50%, -100%);
  box-sizing: border-box;
}
.board-pane-reorder-indicator.visible {
  display: flex;
}
.board-pane-reorder-indicator .board-pane-reorder-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-secondary, #888);
  opacity: 0.32;
  transition:
    opacity 0.12s ease,
    transform 0.12s ease;
}
.board-pane-reorder-indicator .board-pane-reorder-dot.is-active-slot {
  opacity: 1;
  transform: scale(1.45);
  background: var(--primary-color, #ff8ba7);
}

/* Split reorder: floating ghost (like sidebar board drag) */
.board-pane-dragging-ghost {
  cursor: grabbing !important;
  opacity: 0.94;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.2);
  outline: 2px dashed var(--primary-color, #ff8ba7);
  outline-offset: 0;
  border-radius: 8px;
  will-change: left, top;
}

/* Empty slot in the row while dragging — match .content-container top offset */
.board-pane-reorder-placeholder {
  flex: 0 0 auto;
  box-sizing: border-box;
  margin-top: 70px;
  border: 2px dashed var(--primary-color, #ff8ba7);
  border-radius: 15px;
  background: rgba(var(--primary-color-rgb, 255, 140, 167), 0.14);
  pointer-events: none;
  align-self: flex-start;
}

#sidebar.no-banner #content-wrapper .board-pane-reorder-placeholder {
  margin-top: 0;
}

body.board-pane-reordering .split-pane-top-drag-zone {
  touch-action: none;
}
.split-pane-top-drag-zone > .board-pane-details-row {
  cursor: grab;
  -webkit-user-select: none;
  user-select: none;
}
/* Title field still allows normal text selection when focused / editing */
.split-pane-top-drag-zone > .board-pane-details-row .board-title-input {
  cursor: text;
  -webkit-user-select: text;
  user-select: text;
}
.split-pane-top-drag-zone > .board-pane-details-row .board-title-color,
.split-pane-top-drag-zone > .board-pane-details-row .board-pane-row-end-cluster,
.split-pane-top-drag-zone > .board-tags-list .board-tag {
  cursor: auto;
}
.split-pane-top-drag-zone > .board-pane-details-row .board-pane-close,
.split-pane-top-drag-zone > .board-tags-list .board-add-tag-button {
  cursor: pointer;
}

/* Split pane tag row only: no chip press-down scale (boards menu overlay still uses .board-tag :active below) */
[id^="board-pane-content-"] .split-pane-top-drag-zone .board-tag:active,
[id^="board-pane-content-"] .split-pane-top-drag-zone .board-tag.selected:active {
  transform: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}

/* View-only shared boards: same grab affordance as editable splits (read-only class
   is for editor chrome, not “no reorder”). */
.content-container.read-only .split-pane-top-drag-zone > .board-pane-details-row,
.content-container.read-only .split-pane-top-drag-zone > .board-tags-list {
  cursor: grab;
  -webkit-user-select: none;
  user-select: none;
}

/* Title field stays normal (not grab) — cursor does not inherit grab from row */
.content-container.read-only .split-pane-top-drag-zone > .board-pane-details-row .board-title-input {
  cursor: default;
  -webkit-user-select: none;
  user-select: none;
}

#content-wrapper {
  width: 100%;
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  overflow-x: auto;
  overflow-y: hidden;
  flex: 1;
  min-height: 0; /* Allow flex item to shrink */
  padding-bottom: 45px;
  gap: 15px;
}

.content-wrapper-empty-state {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  gap: 8px;
  padding: 24px;
  color: var(--text-secondary, #666);
  font-size: 15px;
  text-align: center;
  min-height: 0;
  visibility: hidden;
  pointer-events: none;
  -webkit-user-select: none;
  user-select: none;
}
.content-wrapper-empty-state.visible {
  visibility: visible;
  pointer-events: auto;
}
.content-wrapper-empty-state .content-wrapper-empty-hint {
  font-size: 13px;
  opacity: 0.85;
}

.content-wrapper-empty-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  max-width: 400px;
  padding: 36px 40px 40px;
  border-radius: 22px;
  background: rgba(var(--bg-secondary-rgb, 245, 245, 245), 0.72);
  border: 1px solid rgba(255, 255, 255, 0.11);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    inset 0 -1px 0 rgba(0, 0, 0, 0.06),
    0 4px 24px rgba(0, 0, 0, 0.12),
    0 0 0 1px rgba(0, 0, 0, 0.04);
}

.content-wrapper-empty-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.038em;
  line-height: 1.2;
  color: var(--text-primary, #222);
}

.content-wrapper-empty-sub {
  margin: -4px 0 0 0;
  max-width: 30ch;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--text-secondary, #666);
}

/* Pill CTA — reads as a real action, not a vague icon tile */
.content-wrapper-add-board-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 6px;
  padding: 14px 26px 14px 22px;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #fff;
  background: linear-gradient(
    135deg,
    rgba(var(--primary-color-rgb, 100, 149, 237), 1) 0%,
    rgba(var(--secondary-color-rgb, 147, 112, 219), 0.92) 100%
  );
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    filter 0.2s ease;
}

.content-wrapper-add-board-btn__icon {
  display: block;
  flex-shrink: 0;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.content-wrapper-add-board-btn__label {
  line-height: 1;
}

.content-wrapper-add-board-btn:hover {
  filter: brightness(1.03);
  transform: translateY(-2px) scale(1.01);
  box-shadow:
    0 8px 20px rgba(var(--primary-color-rgb, 100, 149, 237), 0.28),
    0 1px 0 rgba(255, 255, 255, 0.18) inset;
}

.content-wrapper-add-board-btn:hover .content-wrapper-add-board-btn__icon {
  transform: scale(1.12);
}

.content-wrapper-add-board-btn:active {
  transform: translateY(-1px) scale(0.98);
  filter: brightness(0.96);
  box-shadow:
    0 6px 18px rgba(var(--primary-color-rgb, 100, 149, 237), 0.35),
    0 1px 0 rgba(255, 255, 255, 0.15) inset;
}

.content-wrapper-add-board-btn:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 3px rgba(var(--primary-color-rgb, 100, 149, 237), 0.45),
    0 8px 28px rgba(var(--primary-color-rgb, 100, 149, 237), 0.35),
    0 1px 0 rgba(255, 255, 255, 0.22) inset;
}

@media (prefers-reduced-motion: reduce) {
  .content-wrapper-add-board-btn,
  .content-wrapper-add-board-btn__icon {
    transition: none;
  }

  .content-wrapper-add-board-btn:hover .content-wrapper-add-board-btn__icon {
    transform: none;
  }
}

/* Project switch: centered loading (spinner + label only — not the add-board control) */
.project-switch-center-loading {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(var(--bg-secondary-rgb, 245, 245, 245), 0.92);
  visibility: hidden;
  pointer-events: none;
  -webkit-user-select: none;
  user-select: none;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  opacity: 0;
}
.project-switch-center-loading.visible {
  visibility: visible;
  pointer-events: auto;
  opacity: 1;
}
.project-switch-center-loading-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  max-width: 280px;
}
.project-switch-center-loading-spinner-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
}
.project-switch-center-loading-spinner {
  width: 40px;
  height: 40px;
  margin-right: 0;
  border-width: 3px;
}
.project-switch-center-loading-text {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-primary, #222);
}

/* Left/right scroll fade indicators when more content is scrollable */
.scroll-fade {
  position: absolute;
  top: 70px;
  bottom: 36px; /* align with content-wrapper padding-bottom */
  width: 32px;
  pointer-events: none;
  z-index: 5;
  opacity: 1;
  transition: opacity 0.2s ease;
}
.scroll-fade.hidden {
  opacity: 0;
}
/* Default: fades use --bg-primary (direction not toward selected editor) */
.scroll-fade-left {
  left: 0;
  background: linear-gradient(to right, var(--bg-primary), transparent);
  border-left: 1px solid white;
}
.scroll-fade-right {
  right: 0;
  background: linear-gradient(to left, var(--bg-primary), transparent);
  border-right: 1px solid white;
}
/* When selected editor is off-screen in that direction, use primary color */
.scroll-fade-left.toward-selected {
  background: linear-gradient(to right, var(--primary-color), transparent);
}
.scroll-fade-right.toward-selected {
  background: linear-gradient(to left, var(--primary-color), transparent);
}

.content-container {
  flex: 1 1 50%; /* Allow shrinking and growing, base size 50% */
  margin-top: 70px;
  min-width: 750px;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 2;
  transition: transform 0.3s ease-in-out;
  height: calc(100vh - 235px); /* Fixed height minus top margin */
  border-radius: 15px;
  padding: 15px;
  background: rgba(var(--bg-primary-rgb), 0.6);
}

/* Split panes only: raised “card” depth vs the main editor surface */
.content-container[id^="board-pane-content-"] {
  border: 1px solid color-mix(in srgb, var(--border-color) 52%, transparent);
  transition:
    transform 0.3s ease-in-out,
    box-shadow 0.25s ease,
    border-color 0.2s ease,
    background 0.2s ease;
}

.content-container[id^="board-pane-content-"]:not(.selected) {
  background: rgba(var(--bg-primary-rgb), 0.56);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.07) inset,
    0 0 0 1px rgba(0, 0, 0, 0.05),
    0 8px 28px rgba(0, 0, 0, 0.14),
    0 2px 8px rgba(0, 0, 0, 0.07);
}

/* When sidebar has no banner (e.g. shared project viewer), content starts at top */
#sidebar.no-banner #content-wrapper .content-container {
  margin-top: 0;
  height: calc(100vh - 75px);
}

.content-container.scrolled {
  transform: translateY(-115px);
  height: calc(100vh - 110px); /* More height when scrolled */
}

/* Split editor: shrink + fade out before DOM removal */
.content-container.board-pane-closing {
  transform: scale(0.82);
  opacity: 0;
  pointer-events: none;
  transform-origin: center center;
  transition:
    transform 0.28s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.26s ease-out;
}
.content-container.scrolled.board-pane-closing {
  transform: translateY(-115px) scale(0.82);
}

/* Split editor: grow + fade in when pane is created */
.content-container.board-pane-enter {
  opacity: 0;
  transform: scale(0.88);
  transform-origin: center center;
  transition: none !important;
}
.content-container.board-pane-enter.board-pane-enter-active {
  opacity: 1;
  transform: scale(1);
  transition:
    transform 0.32s cubic-bezier(0.34, 1.15, 0.55, 1),
    opacity 0.28s ease-out !important;
}
.content-container.scrolled.board-pane-enter {
  transform: translateY(-115px) scale(0.88);
}
.content-container.scrolled.board-pane-enter.board-pane-enter-active {
  transform: translateY(-115px) scale(1);
}

.board-details-section {
  display: flex;
  flex-direction: column;
  /* gap: 12px; */
  width: 100%;
  position: relative;
  z-index: 2;
  min-height: 0;
  flex: 1;
}

.board-pane-details-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.board-pane-details-row .board-pane-row-end-cluster {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 2px;
  margin-left: auto;
  flex-shrink: 0;
}

/* Close was margin-left:auto for standalone row; inside end cluster it must sit next to other buttons */
.board-pane-details-row .board-pane-row-end-cluster .board-pane-close {
  margin-left: 0;
}

.board-title-input {
  font-size: 1.0rem;
  font-weight: 500;
  color: var(--text-primary);
  border: none;
  background: transparent;
  border-bottom: 1px solid transparent;
  outline: none;
  padding: 4px 8px;
  min-width: 220px;
  max-width: 220px;
  width: 100%;
  transition: border 0.15s, background 0.15s;
}
.board-title-input:hover {
  border-bottom-color: rgba(var(--border-color-rgb), 0.4);
}
.board-title-input:focus {
  border-bottom: 1px solid var(--primary-color);
}
.board-title-color {
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(44,62,80,0.08);
}
.board-tags-list {
  display: flex;
  align-items: center;
  min-height: 30px;
  gap: 8px;
  padding: 10px;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: visible;
  white-space: nowrap;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
}

/* Hide empty tag lists */
.board-tags-list:empty {
  display: none;
}

.board-tags-list::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

.board-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  padding-right: 2px;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 45px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  box-shadow: 0 0 0 transparent;
  transition: border-color 0.15s ease,
              background 0.15s ease;
  user-select: none;
  position: relative;
  overflow: visible;
  white-space: nowrap;
}

.board-tag > span {
  pointer-events: none;
}

[data-theme="dark"] .board-tag {
  background: rgba(var(--bg-secondary-rgb), 0.4);
  border-color: var(--border-color);
  color: var(--text-primary);
}

[data-theme="dark"] .board-tag:hover {
  background: rgba(var(--hover-bg-rgb), 0.5);
}

/* Inline tag row: pencil uses shared .bm-tag-edit-btn; keep visible (tag cloud hides until hover). */
.board-tag .bm-tag-edit-btn.board-bm-tag-edit-btn {
  opacity: 1;
  font-size: 0.85rem;
  padding: 0 3px;
  margin-left: 4px;
  flex-shrink: 0;
}

.board-tag .board-tag-remove {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.1rem;
  margin-left: 5px;
  cursor: pointer;
  border-radius: 45px;
  transition: background 0.15s, color 0.15s;
}
/* Unselected: same as boards list – icon stays text-secondary until button hovered */
/* Unselected: same primary-tint background as tag cloud edit button */
.board-tag:not(.selected) .board-tag-remove:hover {
  background: rgba(var(--primary-color-rgb), 0.12);
  color: var(--primary-color);
}

.board-tag:hover {
  background: rgba(var(--hover-bg-rgb), 0.5);
  border-color: var(--primary-color);
}

.board-tag:active {
  transform: scale(0.96);
  transition-duration: 0.08s;
  transition-timing-function: cubic-bezier(0.34, 2.2, 0.64, 1);
}

.board-tag.selected {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  color: white;
  border-color: transparent;
}

.board-tag.selected:hover {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
}

.board-tag.selected:active {
  transform: scale(0.96);
}

[data-theme="dark"] .board-tag .board-tag-remove {
  color: var(--text-primary);
}
[data-theme="dark"] .board-tag:not(.selected) .board-tag-remove:hover {
  background: rgba(var(--primary-color-rgb), 0.12);
  color: var(--primary-color);
}

.board-tag.selected .board-tag-remove {
  color: rgba(255, 255, 255, 0.9);
}

.board-tag.selected .board-tag-remove:hover {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

.board-tag.selected .bm-tag-edit-btn.board-bm-tag-edit-btn {
  color: rgba(255, 255, 255, 0.9);
}

.board-tag.selected .bm-tag-edit-btn.board-bm-tag-edit-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

/* Board wrapper*/
.board-pane-wrapper {
  flex: 1;
  overflow: visible;
  min-height: 0;
  /* margin-top: 18px; */
  width: calc(100% - 10px);
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 0;
}

/* Board pane container - no scroll, just layout */
.board-pane-container {
  width: 100%;
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
  min-height: 200px;
  flex: 1;
  overflow: visible;
}

.board-details-section input[type="text"]:not(.board-title-input),
.board-details-section input[type="color"] {
  font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
  font-size: 1.08rem;
  font-weight: 400;
  letter-spacing: 0.01em;
  color: var(--text-primary);
  background: var(--bg-secondary);
  border-radius: 8px;
  border: 1px solid #E2E8F0;
  padding: 8px 14px;
  transition: border 0.15s, box-shadow 0.15s;
}
.board-details-section input[type="text"]:focus:not(.board-title-input),
.board-details-section input[type="color"]:focus {
  border: 1.5px solid var(--primary-color);
  outline: none;
  box-shadow: 0 2px 8px rgba(255,139,167,0.08);
}

.board-details-section input[type="color"] {
  width: 30px;
  height: 30px;
  min-width: 30px;
  min-height: 30px;
  padding: 0;
  border: none;
  background: none;
  border-radius: 8px;
  cursor: pointer;
  vertical-align: middle;
  box-shadow: 0 1px 4px rgba(44,62,80,0.08);
}

/* Close control on the split editor pane (board details row) — same visual style as .boards-menu-btn */
.board-pane-close {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  opacity: 1;
  transition: opacity 0.15s, background-color 0.15s, color 0.15s, transform 0.1s;
  font-size: 0;
  line-height: 1;
}

.board-pane-close:hover {
  opacity: 1;
  background: rgba(var(--color-danger-rgb), 0.14);
  color: var(--color-danger);
}

.board-pane-close:active {
  transform: scale(0.92);
}

/* Close button inside the boards menu overlay — same look as .board-pane-close */
.boards-menu-close-btn {
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  flex-shrink: 0;
  padding: 0;
  font-size: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  opacity: 1;
  transition: opacity 0.15s, background-color 0.15s, color 0.15s;
}

.board-pane-close.boards-menu-close-btn:hover {
  opacity: 1;
  background: rgba(var(--color-danger-rgb), 0.14);
  color: var(--color-danger);
}

.board-pane-close.boards-menu-close-btn:active {
  transform: scale(0.92);
}

/* Browse boards button in the split pane board row */
.boards-menu-btn {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  opacity: 1;
  transition: opacity 0.15s, background-color 0.15s, color 0.15s, transform 0.1s;
}

.boards-menu-btn:hover {
  opacity: 1;
  background: rgba(var(--hover-bg-rgb), 0.6);
  color: var(--primary-color);
}

.boards-menu-btn:active {
  transform: scale(0.92);
}

.boards-menu-btn[aria-expanded="true"] {
  opacity: 1;
  background: rgba(var(--primary-color-rgb), 0.18);
  color: var(--primary-color);
}


.content-container[id^="board-pane-content-"] .board-details-section {
    opacity: 0.9;
}

/* Editor focus highlighting */
.content-container.selected {
  background-color: rgba(var(--bg-primary-rgb), 0.9);
  border: 1px solid var(--border-color);
  border-left: 3px solid var(--primary-color);
}

/* Active split pane: stronger lift + primary rim (overrides .content-container.selected for splits) */
.content-container[id^="board-pane-content-"].selected {
  background: rgba(var(--bg-primary-rgb), 0.93);
  border: 1px solid color-mix(in srgb, var(--primary-color) 30%, var(--border-color));
  border-left: 3px solid var(--primary-color);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.07) inset,
    0 0 0 1px rgba(0, 0, 0, 0.05),
    0 8px 28px rgba(0, 0, 0, 0.14),
    0 2px 8px rgba(0, 0, 0, 0.07);
}

@media (prefers-reduced-motion: reduce) {
  .content-container[id^="board-pane-content-"] {
    transition: transform 0.3s ease-in-out;
  }
}

/* Make split editors match the main editor's width */
.content-container[id^="board-pane-content-"] .board-container {
  width: calc(100% - 10px) !important;
}

/* Editor Loading Indicator */
.board-loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(var(--bg-secondary-rgb), 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.board-loading-overlay.show {
  opacity: 1;
  visibility: visible;
}

.board-loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-color);
  border-top: 3px solid var(--primary-color);
  border-radius: 50%;
  animation: board-spin 1s linear infinite;
  margin-right: 12px;
}

.board-loading-text {
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 500;
}

@keyframes board-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Disable editor interaction while loading */
.board-container.loading {
  pointer-events: none;
}

.board-container.loading .ql-editor {
  opacity: 0.6;
}

/* Board loading state indicator */
body:has(.board-container.loading) .board-item:not(.selected) {
  opacity: 0.6;
  pointer-events: none;
  cursor: not-allowed;
  transition: opacity 0.3s ease, pointer-events 0.3s ease;
}

body:has(.board-container.loading) .favorite-item {
  opacity: 0.6;
  pointer-events: none;
  cursor: not-allowed;
  transition: opacity 0.3s ease, pointer-events 0.3s ease;
}

/* Keep selected boards fully visible and interactive */
body:has(.board-container.loading) .board-item.selected {
  opacity: 1;
  pointer-events: auto;
  cursor: default;
  transition: opacity 0.3s ease, pointer-events 0.3s ease;
}

