.proj-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 1.3rem;
}

.proj-top-bar .sec-title {
  margin-bottom: 0;
}

.proj-switcher {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: center;
  width: 340px;
  max-width: 100%;
  height: 40px;
  padding: 4px;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  box-shadow: var(--card-shadow);
  user-select: none;
  touch-action: none;
  cursor: grab;
}

.proj-switcher:active {
  cursor: grabbing;
}

.proj-switcher::before,
.proj-switcher::after {
  content: "";
  position: absolute;
  top: 25%;
  height: 50%;
  width: 1px;
  background: var(--glass-border);
  pointer-events: none;
}

.proj-switcher::before { left: 33.333%; }
.proj-switcher::after  { left: 66.666%; }

.proj-thumb {
  position: absolute;
  top: 4px;
  left: 4px;
  width: calc((100% - 8px) / 3);
  height: calc(100% - 8px);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(167, 139, 250, 0.36) 0%, rgba(109, 40, 217, 0.5) 100%);
  border: 1px solid rgba(212, 191, 255, 0.5);
  transition: transform 0.36s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
  pointer-events: none;
}

body.light-theme .proj-thumb,
body.theme-morning .proj-thumb {
  background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
  border-color: #6d28d9;
}

.proj-switcher.dragging .proj-thumb {
  transition: none !important;
}

.proj-tab-btn {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  line-height: 1;
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  pointer-events: none;
  transition: color 0.25s ease;
}

.proj-tab-btn.active {
  color: #ffffff;
}

/* Непрерывная лента 3 вкладок проектов (едет ровно за ползунком) */
.proj-viewport {
  width: 100%;
  overflow: hidden;
  padding: 4px 0 14px;
}

.proj-pages-track {
  display: flex;
  width: 300%;
  will-change: transform;
  transition: transform 0.38s cubic-bezier(0.16, 1, 0.3, 1);
}

.proj-pages-track.dragging {
  transition: none !important;
}

.proj-page-pane {
  width: 33.3333%;
  flex-shrink: 0;
  padding: 0 2px;
}

.proj-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  align-items: stretch;
}
.proj-widget {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 245px;
  padding: 20px 22px;
  border-radius: 18px;
  background: var(--card-surface);
  border: 1px solid var(--glass-border);
  box-shadow: var(--card-shadow);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  will-change: transform, opacity;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.3s ease, opacity 0.4s ease;
}

.proj-widget:hover {
  transform: translate3d(0, -4px, 0);
  border-color: rgba(109, 40, 217, 0.42);
}

.proj-card-bg-deco {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 175px;
  height: 155px;
  pointer-events: none;
  opacity: 0.2;
  z-index: 0;
  transition: opacity 0.35s ease, transform 0.35s ease;
}

body.light-theme .proj-card-bg-deco,
body.theme-morning .proj-card-bg-deco {
  opacity: 0.35;
}

.proj-widget:hover .proj-card-bg-deco {
  opacity: 0.34;
  transform: scale(1.04);
}

.proj-card-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
}

.proj-widget.is-pinned-card {
  background: linear-gradient(145deg, rgba(139, 92, 246, 0.18) 0%, rgba(30, 18, 52, 0.92) 55%, rgba(15, 10, 26, 0.96) 100%);
  border: 1px solid rgba(212, 191, 255, 0.45);
}

body.light-theme .proj-widget.is-pinned-card,
body.theme-morning .proj-widget.is-pinned-card {
  background: linear-gradient(145deg, rgba(235, 225, 255, 0.96) 0%, rgba(255, 255, 255, 0.98) 100%);
  border-color: rgba(109, 40, 217, 0.35);
}

.proj-media-slot {
  width: 100%;
  height: 96px;
  border-radius: 12px;
  margin-bottom: 12px;
  overflow: hidden;
  border: 1px solid var(--glass-border);
  background: rgba(139, 92, 246, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.proj-media-slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.proj-meta-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.proj-pin-tag {
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--violet-bright);
  background: rgba(139, 92, 246, 0.14);
  border: 1px solid rgba(139, 92, 246, 0.3);
  padding: 3px 9px;
  border-radius: 999px;
}

.proj-status {
  display: inline-block;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 0.71rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.st-dev      { color: #7c3aed; background: rgba(168, 85, 247, 0.14); border: 1px solid rgba(168, 85, 247, 0.38); }
.st-active   { color: #059669; background: rgba(16, 185, 129, 0.12); border: 1px solid rgba(16, 185, 129, 0.38); }
.st-inactive { color: #71717a; background: rgba(161, 161, 170, 0.14); border: 1px solid rgba(161, 161, 170, 0.32); }
.st-delayed  { color: #d97706; background: rgba(245, 158, 11, 0.14); border: 1px solid rgba(245, 158, 11, 0.38); }
.st-closed   { color: #e11d48; background: rgba(244, 63, 94, 0.14); border: 1px solid rgba(244, 63, 94, 0.4); }

body:not(.theme-morning):not(.light-theme) .st-dev      { color: #d8b4fe; }
body:not(.theme-morning):not(.light-theme) .st-active   { color: #6bffa8; }
body:not(.theme-morning):not(.light-theme) .st-inactive { color: #a1a1aa; }
body:not(.theme-morning):not(.light-theme) .st-delayed  { color: #fbbf24; }
body:not(.theme-morning):not(.light-theme) .st-closed   { color: #ff6b7a; }

.proj-title {
  font-size: 1.12rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
  margin-bottom: 6px;
}

.proj-short {
  font-size: 0.84rem;
  color: var(--text-dim);
  line-height: 1.48;
}

.proj-teams {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.team-pill {
  padding: 3px 11px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.team-pri { color: #e11d48; background: rgba(244, 63, 94, 0.12); border: 1px solid rgba(244, 63, 94, 0.42); }
.team-sf  { color: #059669; background: rgba(16, 185, 129, 0.12); border: 1px solid rgba(16, 185, 129, 0.4); }

body:not(.theme-morning):not(.light-theme) .team-pri { color: #ff6b7a; }
body:not(.theme-morning):not(.light-theme) .team-sf  { color: #6bffa8; }

.proj-overlay-layer {
  position: absolute;
  inset: 0;
  z-index: 40;
  background: var(--overlay-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.proj-overlay-layer.active {
  opacity: 1;
  pointer-events: auto;
}

.proj-modal-card {
  width: 100%;
  max-width: 780px;
  border-radius: 22px;
  background: var(--modal-bg);
  border: 1px solid rgba(139, 92, 246, 0.38);
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.35);
  padding: 28px 34px;
  position: relative;
  overflow: hidden;
  will-change: transform, opacity;
}

body.proj-focus #banner,
body.proj-focus .proj-top-bar,
body.proj-focus .proj-viewport {
  opacity: 0.22;
  pointer-events: none;
}

@media (max-width: 1024px) {
  .proj-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .proj-grid { grid-template-columns: 1fr; }
}
