/* ==========================================================================
   Icon Strip — Discord-style vertical server/project bar
   ========================================================================== */

#icon-strip {
  position: relative;
  width: 72px;
  flex-shrink: 0;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 0 80px;
  overflow: hidden;
  z-index: 2;
}

/* --- Home / App icon (top) --- */
.icon-strip-home {
  position: relative;
  width: 48px;
  height: 48px;
  border-radius: 0;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
  flex-shrink: 0;
}

.icon-strip-home::before {
  content: "";
  position: absolute;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--bg-alt);
  transition: background 0.2s ease;
  z-index: -1;
}

.icon-strip-home:hover::before {
  background: var(--accent);
}

.icon-strip-home .icon-strip-logo {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  object-fit: cover;
}

.icon-strip-home:hover .icon-strip-logo {
  opacity: 0.8;
}

.icon-strip-home.active::before {
  background: var(--accent);
}

/* First separator aligns with title bar border (48px line) */
.icon-strip-home + .icon-strip-separator {
  margin-top: 0;
}

/* --- Pill indicator (left side, Discord-style white bar) --- */
.icon-strip-pill {
  position: absolute;
  left: -12px;
  width: 4px;
  background: var(--text);
  border-radius: 0 4px 4px 0;
  transition: height 0.2s ease, opacity 0.2s ease;
  opacity: 0;
  height: 0;
  top: 50%;
  transform: translateY(-50%);
}

/* Hover: short pill */
.icon-strip-item:hover .icon-strip-pill {
  opacity: 1;
  height: 20px;
}

/* Active: tall pill */
.icon-strip-item.active .icon-strip-pill {
  opacity: 1;
  height: 32px;
}

.icon-strip-home:hover .icon-strip-pill {
  opacity: 1;
  height: 20px;
}

.icon-strip-home.active .icon-strip-pill {
  opacity: 1;
  height: 32px;
}

/* --- Separator --- */
.icon-strip-separator {
  width: 32px;
  height: 2px;
  border-radius: 1px;
  background: var(--border);
  margin: 4px 0;
  flex-shrink: 0;
}

/* Keyboard-shortcut hint above each switchable strip section. Tiny
   pill with the platform-specific chord; clicking opens the switcher
   in that mode, same as the keyboard shortcut itself. */
.icon-strip-hint {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  padding: 2px 4px;
  margin: 2px 0;
  border: 1px solid var(--border-subtle);
  background: var(--bg-alt);
  color: var(--text-dimmer);
  font-size: 10px;
  font-weight: 600;
  font-family: inherit;
  border-radius: 6px;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.15s, color 0.15s, background 0.15s;
}
.icon-strip-hint:hover {
  opacity: 1;
  color: var(--text-muted);
  background: var(--bg);
}
.icon-strip-hint.hidden {
  display: none;
}

/* --- Scrollable project list area --- */
.icon-strip-projects {
  width: 100%;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  padding: 0;
  scrollbar-width: none;
}

.icon-strip-projects::-webkit-scrollbar {
  display: none;
}

/* --- Project icon item (48px hit-box, 38px visible bg) --- */
.icon-strip-item {
  position: relative;
  width: 48px;
  height: 48px;
  border-radius: 0;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  color: var(--text-secondary);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  user-select: none;
}

.icon-strip-item::before {
  content: "";
  position: absolute;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--bg-alt);
  transition: background 0.2s ease;
  z-index: -1;
}

.icon-strip-item:hover::before {
  background: var(--accent);
}

.icon-strip-item:hover {
  color: #fff;
}

.icon-strip-item.active::before {
  background: var(--accent);
}

.icon-strip-item.active {
  color: #fff;
}

/* --- Socket status indicator on icon (top-left dot) --- */
.icon-strip-status {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-dimmer);
  border: 2px solid var(--sidebar-bg);
  opacity: 0;
  transition: opacity 0.2s, background 0.3s;
}

/* Show dot only on active item or when processing */
.icon-strip-item.active .icon-strip-status,
.icon-strip-wt-item.active .icon-strip-status,
.icon-strip-status.processing {
  opacity: 1;
}

/* Connected = green */
.icon-strip-status.connected {
  background: var(--success);
}

/* Processing = solid green (LED off state) */
.icon-strip-status.processing {
  background: var(--success);
}

/* IO blink = HDD LED flash */
.icon-strip-status.io {
  opacity: 1;
  background: #fff !important;
  box-shadow: 0 0 6px var(--success);
  transition: none;
}

/* Pending permission shake */
.icon-strip-item.has-pending-perm,
.icon-strip-wt-item.has-pending-perm,
.icon-strip-mate.has-pending-perm {
  animation: permShake 2s ease-in-out infinite;
}

/* Mate status dot (top-left) */
.icon-strip-mate .icon-strip-status {
  top: 3px;
  left: 3px;
  bottom: auto;
  right: auto;
  border-color: var(--sidebar-bg);
  z-index: 3;
}

/* Mate vendor badge (bottom-right) */
.icon-strip-mate .icon-strip-vendor-badge {
  position: absolute;
  bottom: 3px;
  right: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid var(--sidebar-bg);
  background: #fff;
  object-fit: cover;
  object-position: center;
  z-index: 3;
  pointer-events: none;
}

.icon-strip-mate.active .icon-strip-status {
  opacity: 1;
  background: var(--success);
}
@keyframes permShake {
  0%, 8% { transform: translateX(0); }
  1% { transform: translateX(-2px); }
  2% { transform: translateX(2px); }
  3% { transform: translateX(-2px); }
  4% { transform: translateX(2px); }
  5% { transform: translateX(-1px); }
  6% { transform: translateX(1px); }
  7% { transform: translateX(0); }
}

/* --- Add project button --- */
.icon-strip-add {
  position: relative;
  width: 48px;
  height: 48px;
  border-radius: 0;
  background: transparent;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  color: var(--success);
  margin-top: 0;
}

.icon-strip-add::before {
  content: "";
  position: absolute;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--bg-alt);
  transition: background 0.2s ease;
  z-index: -1;
}

.icon-strip-add:hover::before {
  background: var(--success);
}

.icon-strip-add:hover {
  color: #fff;
}

.icon-strip-add .lucide {
  width: 18px;
  height: 18px;
}

/* --- Tooltip on hover --- */
.icon-strip-tooltip {
  position: fixed;
  left: 76px;
  background: var(--code-bg);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.1s, transform 0.1s;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(var(--shadow-rgb), 0.5);
}

.icon-strip-tooltip.visible {
  opacity: 1;
  transform: translateX(0);
}

.icon-strip-tooltip::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 50%;
  transform: translateY(-50%);
  border: 6px solid transparent;
  border-right-color: var(--code-bg);
  border-left: none;
}

/* --- Drag-and-drop reordering --- */
.icon-strip-item.dragging {
  opacity: 0.3;
  transform: scale(0.9);
}

.icon-strip-item.drag-over-above::after {
  content: "";
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 32px;
  height: 2px;
  border-radius: 1px;
  background: var(--accent);
  z-index: 10;
}

.icon-strip-item.drag-over-below::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 32px;
  height: 2px;
  border-radius: 1px;
  background: var(--accent);
  z-index: 10;
}

/* --- Trash zone (replaces add button during drag) --- */
.icon-strip-trash {
  position: relative;
  width: 48px;
  height: 48px;
  border-radius: 0;
  background: transparent;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #e57373;
  animation: trashAppear 0.25s ease-out;
}

.icon-strip-trash::before {
  content: "";
  position: absolute;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--bg-alt);
  transition: background 0.2s ease, transform 0.2s ease;
  z-index: -1;
}

.icon-strip-trash .lucide {
  width: 18px;
  height: 18px;
  transition: transform 0.2s ease;
}

.icon-strip-trash.drag-hover {
  color: #fff;
}

.icon-strip-trash.drag-hover::before {
  background: #e53935;
  transform: scale(1.1);
}

.icon-strip-trash.drag-hover .lucide {
  transform: scale(1.15) rotate(-8deg);
}

@keyframes trashAppear {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.8);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* --- Dust particles --- */
.dust-particle {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 10000;
  animation: dustFly var(--dust-duration, 800ms) ease-out forwards;
}

@keyframes dustFly {
  0% {
    opacity: 0;
    transform: translate(0, 0) scale(0.5);
  }
  15% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(var(--dust-x, 30px), var(--dust-y, -40px)) scale(0);
  }
}

/* --- Project emoji icon --- */
.icon-strip-item .project-emoji {
  width: 22px;
  height: 22px;
  pointer-events: none;
}

.icon-strip-item .project-emoji img {
  width: 22px;
  height: 22px;
  filter:
    drop-shadow(1px 0 0 rgba(0,0,0,0.25))
    drop-shadow(-1px 0 0 rgba(0,0,0,0.25))
    drop-shadow(0 1px 0 rgba(0,0,0,0.25))
    drop-shadow(0 -1px 0 rgba(0,0,0,0.25))
    drop-shadow(0 0 4px rgba(255,255,255,0.35));
}

/* --- Project context menu --- */
.project-ctx-menu {
  position: fixed;
  background: var(--sidebar-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px 0;
  min-width: 180px;
  box-shadow: 0 4px 16px rgba(var(--shadow-rgb), 0.4);
  z-index: 9999;
  animation: ctxMenuAppear 0.12s ease-out;
}

@keyframes ctxMenuAppear {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.project-ctx-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 14px;
  font-size: 13px;
  color: var(--text-secondary);
  background: none;
  border: none;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s;
}

.project-ctx-item .lucide { width: 15px; height: 15px; flex-shrink: 0; }
.project-ctx-item:hover { background: rgba(var(--overlay-rgb), 0.06); color: var(--text); }
.project-ctx-item:first-child { border-radius: 6px 6px 0 0; }
.project-ctx-item:last-child { border-radius: 0 0 6px 6px; }

.project-ctx-separator {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

.project-ctx-item.project-ctx-delete { color: var(--error); }
.project-ctx-item.project-ctx-delete:hover { background: var(--error-8); }

/* --- Project Access Popover --- */
.project-access-popover {
  position: fixed;
  background: var(--sidebar-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0;
  width: 260px;
  box-shadow: 0 8px 30px rgba(var(--shadow-rgb), 0.35);
  z-index: 9999;
  animation: ctxMenuAppear 0.12s ease-out;
  overflow: hidden;
}
.project-access-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px 8px;
  border-bottom: 1px solid var(--border);
}
.project-access-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.project-access-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 18px;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
}
.project-access-close:hover { color: var(--text); }
.project-access-section {
  padding: 10px 14px;
}
.project-access-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}
.project-access-vis-row {
  display: flex;
  gap: 6px;
}
.project-access-vis-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 0;
  font-size: 12px;
  font-family: inherit;
  color: var(--text-secondary);
  background: rgba(var(--overlay-rgb), 0.04);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
}
.project-access-vis-btn .lucide { width: 14px; height: 14px; }
.project-access-vis-btn:hover { background: rgba(var(--overlay-rgb), 0.08); }
.project-access-vis-btn.active {
  background: var(--accent-8, rgba(99, 102, 241, 0.08));
  border-color: var(--accent, #6366f1);
  color: var(--accent, #6366f1);
  font-weight: 500;
}
.project-access-user-list {
  max-height: 200px;
  overflow-y: auto;
}
.project-access-user-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
}
.project-access-user-item input[type="checkbox"] {
  accent-color: var(--accent, #6366f1);
  width: 15px;
  height: 15px;
  cursor: pointer;
}
.project-access-user-item:hover { color: var(--text); }
.project-access-empty {
  font-size: 12px;
  color: var(--text-tertiary);
  padding: 8px 0;
}
.project-access-loading {
  padding: 20px 14px;
  text-align: center;
  font-size: 12px;
  color: var(--text-secondary);
}

/* --- Emoji picker popover --- */
.emoji-picker {
  position: fixed;
  background: var(--sidebar-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 10px 6px;
  width: 292px;
  box-shadow: 0 8px 24px rgba(var(--shadow-rgb), 0.5);
  z-index: 10001;
  animation: ctxMenuAppear 0.15s ease-out;
  display: flex;
  flex-direction: column;
}

.emoji-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

.emoji-picker-remove {
  font-size: 11px;
  font-weight: 600;
  color: var(--error);
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 8px;
  border-radius: 4px;
  font-family: inherit;
  text-transform: none;
  letter-spacing: 0;
}

.emoji-picker-remove:hover {
  background: var(--error-8);
}

/* Category tab bar */
.emoji-picker-tabs {
  display: flex;
  gap: 1px;
  padding: 0 0 6px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
  flex-shrink: 0;
}

.emoji-picker-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  border: none;
  background: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
  padding: 0;
  opacity: 0.5;
  transition: opacity 0.15s, background 0.15s;
}

.emoji-picker-tab:hover {
  opacity: 0.8;
  background: rgba(var(--overlay-rgb), 0.06);
}

.emoji-picker-tab.active {
  opacity: 1;
  background: rgba(var(--overlay-rgb), 0.1);
}

.emoji-picker-tab img.emoji {
  width: 18px;
  height: 18px;
}

/* Scrollable emoji grid */
.emoji-picker-scroll {
  max-height: 280px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.emoji-picker-scroll::-webkit-scrollbar {
  width: 4px;
}

.emoji-picker-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.emoji-picker-scroll::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}

.emoji-picker-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
}

.emoji-picker-item {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 20px;
  transition: background 0.1s, transform 0.1s;
  padding: 0;
}

.emoji-picker-item:hover {
  background: rgba(var(--overlay-rgb), 0.08);
  transform: scale(1.15);
}

.emoji-picker-item img.emoji {
  width: 22px;
  height: 22px;
}

/* Mate section wrapper — pinned just above the user-island at the
   bottom of the strip. Groups the \u2318M hint pill with the users
   list so the hint sits directly above the mate avatars rather than
   floating up in the project section's flex flow. */
.icon-strip-mate-section {
  position: absolute;
  bottom: 74px; /* above user-island (58px + 8px bottom + 8px gap) */
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

/* --- User avatars (circle, inside the mate section) --- */
.icon-strip-users {
  width: 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  padding: 6px 0;
  background: var(--bg-alt);
  border-radius: 8px;
}

.icon-strip-users.hidden {
  display: none;
}

/* "Invite" mini button at bottom of user strip */
.icon-strip-invite {
  position: relative;
  width: 40px;
  height: 32px;
  border-radius: 10px;
  background: transparent;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  color: var(--text-dimmer);
  transition: color 0.2s, background 0.2s;
}

.icon-strip-invite:hover {
  color: var(--accent);
  background: rgba(var(--overlay-rgb), 0.08);
}

.icon-strip-invite .lucide {
  width: 16px;
  height: 16px;
}

.icon-strip-user {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 0;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.icon-strip-user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  transition: opacity 0.2s ease, transform 0.2s ease;
  opacity: 0.7;
}

.icon-strip-user:hover .icon-strip-user-avatar {
  opacity: 1;
  transform: scale(1.08);
}

.icon-strip-user.active .icon-strip-user-avatar {
  opacity: 1;
  box-shadow: 0 0 0 2px var(--accent);
}

/* Primary mate: full color (no desaturate), no ring */
.icon-strip-primary-mate {
  opacity: 1;
  border-radius: 8px;
  filter: saturate(1) !important;
}

/* Online status dot (bottom-right on avatar, like project blink dot) */
.icon-strip-user-online {
  position: absolute;
  bottom: 5px;
  right: 5px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-dimmer);
  border: 2px solid var(--sidebar-bg);
  opacity: 1;
  transition: opacity 0.2s, background 0.3s;
}

.icon-strip-user.online .icon-strip-user-online {
  background: var(--success);
}

/* DM unread badge */
.icon-strip-user-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  background: #e74c3c;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  line-height: 18px;
  text-align: center;
  box-shadow: 0 0 0 2px var(--bg);
  z-index: 2;
}

.icon-strip-user-badge.has-unread {
  display: flex;
}

/* Project unread badge */
.icon-strip-project-badge {
  position: absolute;
  top: 1px;
  right: 1px;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  background: #e74c3c;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  line-height: 18px;
  text-align: center;
  box-shadow: 0 0 0 2px var(--bg);
  z-index: 2;
}

.icon-strip-project-badge.has-unread {
  display: flex;
}

/* Pill for user icons */
.icon-strip-user:hover .icon-strip-pill {
  opacity: 1;
  height: 20px;
}

.icon-strip-user.active .icon-strip-pill {
  opacity: 1;
  height: 32px;
}

/* DM mode: keep same position (user-island gone but layout stays) */

/* --- My avatar at bottom of icon strip (always present, behind user-island) --- */
/* Positioned to align with icon-strip center (72px / 2 = 36px) */
/* Matches user-island avatar center: left:8px + padding:10px + 18px = 36px */
.icon-strip-me {
  position: absolute;
  bottom: 19px; /* vertically center with user-island (bottom:8px + height:58px/2 - 16px) */
  left: 36px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  z-index: 1; /* below user-island z-index: 15 */
}

.icon-strip-me-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

/* --- DM user picker popup --- */
.dm-user-picker {
  position: fixed;
  background: var(--sidebar-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px;
  width: 300px;
  max-height: 70vh;
  overflow-y: auto;
  box-shadow: 0 8px 24px rgba(var(--shadow-rgb), 0.5);
  z-index: 10001;
  animation: ctxMenuAppear 0.15s ease-out;
  display: flex;
  flex-direction: column;
  gap: 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.dm-user-picker-search {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-alt);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  box-sizing: border-box;
}

.dm-user-picker-search:focus {
  border-color: var(--accent);
}

.dm-user-picker-search::placeholder {
  color: var(--text-dimmer);
}

.dm-user-picker-list {
  overflow: visible;
}

.dm-user-picker-list.dm-mates-list {
  max-height: 336px;  /* ~7 items at ~48px each */
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  mask-image: linear-gradient(to bottom, black 80%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, black 80%, transparent 100%);
}

.dm-user-picker-list.dm-mates-list.scrolled-bottom {
  mask-image: linear-gradient(to bottom, transparent 0%, black 35%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 35%);
}

.dm-user-picker-list.dm-mates-list.no-overflow {
  mask-image: none;
  -webkit-mask-image: none;
}

.dm-user-picker-list::-webkit-scrollbar {
  width: 4px;
}

.dm-user-picker-list::-webkit-scrollbar-track {
  background: transparent;
}

.dm-user-picker-list::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}

.dm-user-picker-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
}

.dm-user-picker-item:hover {
  background: rgba(var(--overlay-rgb), 0.08);
}

.dm-user-picker-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.dm-user-picker-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dm-user-picker-empty {
  padding: 12px 8px;
  font-size: 13px;
  color: var(--text-dimmer);
  text-align: center;
}

.dm-picker-fav-btn,
.dm-picker-del-btn {
  flex-shrink: 0;
  border: none;
  background: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  opacity: 0.5;
  transition: opacity 0.15s, color 0.15s;
}

.dm-picker-fav-btn:hover,
.dm-picker-del-btn:hover {
  opacity: 1;
}

.dm-picker-del-btn:hover {
  color: var(--danger, #e74c3c) !important;
}

.dm-picker-fav-btn svg,
.dm-picker-del-btn svg {
  width: 16px;
  height: 16px;
}

.dm-picker-fav .dm-picker-fav-btn {
  opacity: 1;
}

/* --- Worktree folder groups --- */
.icon-strip-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.icon-strip-group .folder-header {
  position: relative;
}

.icon-strip-group-chevron {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dimmer);
  pointer-events: auto;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s, border-color 0.15s;
  z-index: 2;
  line-height: 1;
}

.icon-strip-group-chevron i,
.icon-strip-group-chevron svg {
  width: 10px;
  height: 10px;
}

.icon-strip-group-chevron:hover {
  background: var(--bg-hover, var(--bg-alt));
  border-color: var(--text-dimmer);
  color: var(--text-secondary);
}

.icon-strip-group.collapsed .icon-strip-group-chevron {
  background: var(--border);
}

.icon-strip-group-items {
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
  transition: max-height 0.2s ease;
  max-height: 500px;
  border-left: 2px solid var(--border);
  margin-left: 0;
  padding-left: 0;
}

.icon-strip-group.collapsed .icon-strip-group-items {
  max-height: 0;
}

/* Worktree items (smaller than regular project icons) */
.icon-strip-wt-item {
  width: 48px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  text-decoration: none;
  color: var(--text-secondary);
  transition: background 0.15s;
}

.icon-strip-wt-item::before {
  content: "";
  position: absolute;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--bg-alt);
  opacity: 0.7;
  transition: opacity 0.15s, background 0.15s;
}

.icon-strip-wt-item:hover::before {
  opacity: 1;
}

.icon-strip-wt-item.active::before {
  background: var(--accent);
  opacity: 1;
}

.icon-strip-wt-item.active {
  color: #fff;
}

.icon-strip-wt-item .wt-branch-abbrev {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: -0.5px;
  pointer-events: none;
  position: relative;
  z-index: 1;
}

/* Disabled/inaccessible worktree */
.icon-strip-wt-item.wt-disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.icon-strip-wt-item.wt-disabled::after {
  content: "\1F6AB";
  position: absolute;
  font-size: 14px;
  z-index: 3;
  filter: grayscale(0.3);
}

/* Group add button */
.icon-strip-group-add {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1.5px dashed var(--border);
  background: transparent;
  color: var(--text-dimmer);
  font-size: 16px;
  font-weight: 400;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 2px 0 4px 0;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.icon-strip-group-add:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(var(--accent-rgb, 124, 58, 237), 0.08);
}

/* --- Worktree creation modal --- */
.wt-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9998;
}

.wt-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 9999;
  min-width: 340px;
  max-width: 420px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.wt-modal-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.wt-modal-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin: 10px 0 4px 0;
}

.wt-modal-label:first-of-type {
  margin-top: 0;
}

.wt-modal-input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-alt);
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  box-sizing: border-box;
}

.wt-modal-input:focus {
  border-color: var(--accent);
}

select.wt-modal-input {
  appearance: auto;
  cursor: pointer;
}

.wt-modal-error {
  color: var(--error, #ef4444);
  font-size: 12px;
  margin-top: 8px;
  display: none;
}

.wt-modal-error.visible {
  display: block;
}

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

.wt-modal-btn {
  padding: 7px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg-alt);
  color: var(--text-primary);
  font-family: inherit;
  transition: background 0.15s, border-color 0.15s;
}

.wt-modal-btn:hover {
  background: var(--bg-hover, var(--bg-alt));
}

.wt-modal-btn.primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.wt-modal-btn.primary:hover {
  opacity: 0.9;
}

.wt-modal-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* --- Mobile worktree folder --- */
.mobile-project-folder {
  display: flex;
  flex-direction: column;
}

.mobile-project-item.wt-item {
  padding-left: 28px;
  opacity: 0.85;
}

.mobile-project-item.wt-disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.mobile-folder-chevron {
  font-size: 8px;
  color: var(--text-dimmer);
  margin-left: auto;
  cursor: pointer;
  transition: transform 0.15s ease;
  padding: 4px;
}

.mobile-project-folder.collapsed .mobile-folder-chevron {
  transform: rotate(-90deg);
}

.mobile-folder-items {
  overflow: hidden;
  transition: max-height 0.2s ease;
  max-height: 500px;
}

.mobile-project-folder.collapsed .mobile-folder-items {
  max-height: 0;
}

/* --- Per-project presence avatars --- */
/* --- Mobile: hide icon strip --- */
/* --- Skeleton loading placeholders --- */
@keyframes skeleton-shimmer {
  0% { opacity: 0.15; }
  50% { opacity: 0.25; }
  100% { opacity: 0.15; }
}
.skeleton-icon-strip-item {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--text-muted, #888);
  margin: 5px auto;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
}
.skeleton-icon-strip-user {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--text-muted, #888);
  margin: 4px auto;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
}

@media (max-width: 768px) {
  #icon-strip {
    display: none;
  }
}
