/* Demo Section - Matches Tandio App Admin UI exactly */
.demo-section {
  padding: 4rem 0 6rem;
  background-color: var(--background);
  position: relative;
  z-index: 20;
}

.demo-feature-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.75rem;
  padding: 0 1rem;
}

.demo-feature-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1.125rem;
  border-radius: 9999px;
  background: #ff6b35;
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  border: none;
  box-sizing: border-box;
  cursor: default;
  user-select: none;
}

.demo-feature-badge-icon {
  flex-shrink: 0;
  width: 0.9375rem;
  height: 0.9375rem;
  stroke: currentColor;
}

/* Same pump as home service/benefit cards (style.css); viewport only — not on phones */
@media (min-width: 768px) {
  body.home-page .demo-feature-badge {
    transition: transform 0.2s;
  }

  body.home-page .demo-feature-badge:hover {
    transform: scale(1.05);
  }
}

/* App-style container: warm background like the real app; border stays outside blur */
.demo-app-wrap {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  background: #FAFAF9; /* App --background */
  border-radius: var(--radius-xl);
  border: 4px solid #FF6B35; /* Orange border to highlight demo */
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  height: 640px;
}

.demo-app-inner {
  display: flex;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  position: relative;
}

/* Sidebar - matches app Layout.tsx */
.demo-sidebar {
  width: 280px;
  flex-shrink: 0;
  background: #FFFFFF; /* App --card */
  border-right: 1px solid #E5E5E4;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.demo-sidebar-header {
  padding: 1.5rem;
  border-bottom: 1px solid #E5E5E4;
  display: flex;
  align-items: center;
  justify-content: center;
}

.demo-sidebar-header img {
  height: 32px;
  width: auto;
  object-fit: contain;
}

/* User card - matches Layout user card */
.demo-user-card {
  margin: 1.5rem 1.5rem 0.5rem 1.5rem;
  padding: 1rem 1rem;
  background: linear-gradient(to bottom right, rgba(255, 180, 153, 0.2), rgba(255, 107, 53, 0.2));
  border: 1px solid rgba(255, 107, 53, 0.2);
  border-radius: var(--radius);
}

.demo-user-card-inner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.demo-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(to bottom right, #FFB499, #FF6B35);
  color: white;
  font-weight: 600;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.demo-user-info {
  flex: 1;
  min-width: 0;
}

.demo-user-name {
  font-weight: 500;
  color: #2D2D2D;
  font-size: 0.9375rem;
}

.demo-user-role {
  font-size: 0.875rem;
  color: #6B7280;
  text-transform: capitalize;
}

.demo-user-org {
  font-size: 0.75rem;
  color: #6B7280;
  margin-top: 0.25rem;
}

.demo-timezone {
  display: flex;
  flex-direction: column;
  font-size: 0.75rem;
  color: #6B7280;
  margin-top: 0.375rem;
}

/* Nav items - matches .nav-item */
.demo-nav {
  padding: 0.5rem 1rem 1rem;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.demo-nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  margin: 0 0.5rem 0.25rem;
  border-radius: 0.75rem;
  color: #6B7280;
  cursor: pointer;
  /* Omit color so active/hover text matches background immediately (same as app .nav-item) */
  transition-property: background-color, background-image, box-shadow, transform, filter;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 200ms;
}

.demo-nav-item:hover {
  background: #F5F5F4;
  color: #2D2D2D;
}

.demo-nav-item.active {
  background: linear-gradient(to right, #FF6B35, #FF4F00);
  color: white;
}

.demo-nav-item svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.demo-nav-item .demo-badge {
  margin-left: auto;
  padding: 0.125rem 0.5rem;
  font-size: 10px;
  font-weight: 600;
  background: #FF6B35;
  color: white;
  border-radius: 9999px;
}

.demo-sidebar-footer {
  padding: 0.5rem;
  border-top: 1px solid #E5E5E4;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.demo-sidebar-footer button {
  padding: 0.5rem;
  border-radius: 0.375rem;
  border: none;
  background: transparent;
  color: #6B7280;
  cursor: pointer;
  transition: background 0.2s;
}

.demo-sidebar-footer button:hover {
  background: #F5F5F4;
}

.demo-sidebar-footer button svg {
  width: 20px;
  height: 20px;
}

/* Main content - matches app pages (scrollbar hidden; content can still scroll) */
.demo-main {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  padding: 1rem 1.5rem;
  background: #FAFAF9;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.demo-main::-webkit-scrollbar {
  display: none;
}

.demo-page {
  display: none;
  animation: demo-fade 0.3s ease;
}

.demo-page.active {
  display: block;
}

@keyframes demo-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Page header - matches Tasks/Projects/Calendar */
.demo-page-header {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.demo-page-header > div:first-child {
  padding-left: 1rem;
}

@media (min-width: 640px) {
  .demo-page-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.demo-page-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #2D2D2D;
  margin: 0;
}

@media (min-width: 640px) {
  .demo-page-title {
    font-size: 1.875rem;
  }
}

.demo-page-subtitle {
  font-size: 0.875rem;
  color: #6B7280;
  margin: 0.25rem 0 0;
}

.demo-page-actions {
  display: flex;
  gap: 0.75rem;
  width: 100%;
}

@media (min-width: 768px) {
  .demo-page-actions {
    width: auto;
  }
}

.demo-search {
  flex: 1;
  min-width: 0;
  padding: 0.75rem 1rem 0.75rem 1rem;
  border: 1px solid #E5E5E4;
  border-radius: 0.75rem;
  background: #ffffff;
  font-size: 0.875rem;
  color: #2D2D2D;
  pointer-events: none;
  cursor: default;
}

@media (min-width: 768px) {
  .demo-search {
    width: 320px;
    flex: none;
  }
}

.demo-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  background: linear-gradient(to right, #FF6B35, #FF4F00);
  color: white;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.demo-btn-primary:hover {
  box-shadow: 0 10px 15px -3px rgba(255, 107, 53, 0.3);
  transform: translateY(-1px);
}

/* Card - matches app Card */
.demo-card {
  background: #FFFFFF;
  border: 1px solid #E5E5E4;
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.demo-card-header {
  padding: 1rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1rem;
}

@media (min-width: 640px) {
  .demo-card-header {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }
}

.demo-card-content {
  padding: 0 1.5rem 1.5rem;
}

#demo-team .demo-card-content {
  padding: 1rem 1.5rem 1.25rem;
}

/* Team page: six-up grid clipped (no inner scroll); second row visibly cut off */
#demo-team .demo-page-header {
  margin-bottom: 1rem;
}

/* No scroll / no overscroll (rubber-band) — main panel fixed for these pages */
.demo-main:has(#demo-team.active),
.demo-main:has(#demo-tasks.active),
.demo-main:has(#demo-projects.active) {
  overflow: hidden;
  overscroll-behavior: none;
}

#demo-team .demo-team-grid-wrap {
  overflow: hidden;
  /* Room for hover lift + shadow on clipped bottom row (same pump as top cards) */
  box-sizing: border-box;
  padding: 0.35rem 0 1rem;
  /* Two full rows + more of the third row; extra height absorbs vertical padding */
  max-height: 37.35rem;
}

/* Tabs — matches shadcn TabsList / TabsTrigger (Tasks.tsx) */
.demo-tabs {
  flex: 1 1 100%;
  min-width: 0;
  width: 100%;
}

@media (min-width: 640px) {
  .demo-tabs {
    flex: 1 1 0;
    min-width: min(100%, 22rem);
  }
}

.demo-tabs-list {
  display: grid;
  width: 100%;
  min-height: 2.75rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.35rem;
  padding: 0.3rem;
  border-radius: 1rem;
  background: #f5f5f4; /* app muted */
  box-sizing: border-box;
}

@media (min-width: 640px) {
  .demo-tabs-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.2rem;
    min-height: 2.5rem;
  }
}

.demo-tabs-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.25rem;
  padding: 0.45rem 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.2;
  color: #6b7280;
  background: transparent;
  border: none;
  border-radius: 0.7rem;
  cursor: default;
  font-family: inherit;
  box-shadow: none;
  transition: color 0.2s, background 0.2s, box-shadow 0.2s;
  white-space: nowrap;
}

@media (min-width: 640px) {
  .demo-tabs-trigger {
    padding: 0.375rem 0.5rem;
    min-height: 2rem;
  }
}

.demo-tabs-trigger:hover {
  color: #2d2d2d;
}

.demo-tabs-trigger.active {
  background: #ffffff;
  color: #2d2d2d;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.demo-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  flex: 0 1 auto;
  align-items: center;
}

.demo-select {
  padding: 0.5rem 2rem 0.5rem 0.75rem;
  font-size: 0.875rem;
  border: 1px solid #E5E5E4;
  border-radius: var(--radius);
  background: #FAFAF9;
  color: #2D2D2D;
  min-width: 120px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
}

/* Interactive filter buttons — same outer height as .demo-tabs-list (status) */
.demo-filter-btn {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  box-sizing: border-box;
  min-height: 2.75rem;
  padding: 0 1.75rem 0 0.75rem;
  font-size: 0.875rem;
  line-height: 1.25;
  border: 1px solid #E5E5E4;
  border-radius: var(--radius);
  background-color: #FAFAF9;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  color: #2D2D2D;
  min-width: 120px;
  cursor: pointer;
  font-family: inherit;
}

@media (min-width: 640px) {
  .demo-filter-btn {
    min-height: 2.5rem;
  }
}

.demo-filter-btn:hover {
  background-color: #F5F5F4;
  border-color: #E5E5E4;
}

/* TaskItem - matches app TaskItem */
.demo-task-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid #E5E5E4;
  border-radius: 0.75rem;
  margin-bottom: 0.25rem;
  transition: background 0.2s;
  cursor: pointer;
}

.demo-task-item:hover {
  background: rgba(245, 245, 244, 0.5);
}

.demo-task-content {
  flex: 1;
  min-width: 0;
}

.demo-task-title {
  font-weight: 500;
  color: #2D2D2D;
  margin-bottom: 0.5rem;
  cursor: pointer;
  font-size: 0.9375rem;
}

.demo-task-title.completed {
  text-decoration: line-through;
  color: #6B7280;
}

.demo-task-item--signup-hint .demo-task-title {
  color: #ff6b35;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.demo-task-item--signup-hint .demo-task-title.completed {
  color: #ff6b35;
  text-decoration: line-through underline;
}

.demo-task-signup-badge {
  background: #ff6b35 !important;
  color: #ffffff !important;
  border: 1px solid #ea580c !important;
  font-weight: 600;
}

.demo-task-item--signup-hint .demo-task-meta > .demo-task-due,
.demo-task-item--signup-hint .demo-task-meta > .demo-task-badge:not(.demo-task-signup-badge),
.demo-task-item--signup-hint .demo-task-meta > .demo-task-duration,
.demo-task-item--signup-hint .demo-task-meta > .demo-task-deps {
  display: none !important;
}

.demo-task-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
  color: #6B7280;
}

.demo-task-badge {
  font-size: 0.75rem;
  padding: 0.125rem 0.5rem;
  border-radius: 0.25rem;
  font-weight: 500;
}

.demo-task-badge.high {
  background: #b91c1c;
  color: #ffffff;
  border: 1px solid #b91c1c;
}

.demo-task-badge.medium {
  background: #ff6b35;
  color: #ffffff;
  border: 1px solid #ff6b35;
}

.demo-task-badge.low {
  background: #eab308;
  color: #ffffff;
  border: 1px solid #eab308;
}

.demo-task-badge.pending {
  background: #FEFCE8;
  color: #A16207;
  border: 1px solid #FDE68A;
}

.demo-task-badge.in-progress {
  background: #DBEAFE;
  color: #1D4ED8;
  border: 1px solid #BFDBFE;
}

.demo-task-badge.completed {
  background: #D1FAE5;
  color: #047857;
  border: 1px solid #A7F3D0;
}

/* Custom (user) tag — pink, matches custom labels in app */
.demo-task-badge.demo-task-tag-pink {
  background: #fce7f3;
  color: #9d174d;
  border: 1px solid #f9a8d4;
}

/* Custom (user) tag — purple */
.demo-task-badge.demo-task-tag-purple {
  background: #f3e8ff;
  color: #6b21a8;
  border: 1px solid #d8b4fe;
}

/* Matches TaskProgressDurationBadge — same surface and numeric typography for duration and dependents */
.demo-task-duration,
.demo-task-deps {
  display: inline-flex;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  padding: 0.125rem 0.5rem;
  border-radius: 0.25rem;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #334155;
  white-space: nowrap;
}

.demo-task-duration svg,
.demo-task-deps svg {
  flex-shrink: 0;
  width: 12px;
  height: 12px;
  margin-right: 0.25rem;
}

.demo-task-assignees {
  display: flex;
  align-items: center;
  margin: 0 -4px;
}

.demo-task-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(to bottom right, #FFB499, #FF6B35);
  color: white;
  font-size: 0.625rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #ffffff;
  margin-left: -8px;
}

.demo-task-avatar:first-child {
  margin-left: 0;
}

/* TaskImportantButton — important: fill primary; not important: outline only (muted) */
.demo-task-star {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #6b7280;
}

.demo-task-star svg {
  display: block;
}

.demo-task-star--marked {
  color: #ff6b35;
}

.demo-task-star--marked svg {
  fill: currentColor;
  stroke: none;
}

.demo-task-star:not(.demo-task-star--marked) svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Project cards - matches app Projects */
.demo-project-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  align-items: start; /* Cards keep content height; only the 3-asset row grows when pills wrap */
}

@media (min-width: 768px) {
  .demo-project-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .demo-project-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.demo-project-card {
  background: #FFFFFF;
  border: 1px solid #E5E5E4;
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  transition: box-shadow 0.2s;
  cursor: pointer;
}

.demo-project-card:hover {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.demo-project-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.demo-project-card-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.125rem;
  font-weight: 600;
  color: #2D2D2D;
}

.demo-project-card-title svg {
  width: 20px;
  height: 20px;
  color: #FF6B35;
  flex-shrink: 0;
}

.demo-project-card--signup-hint .demo-project-card-title {
  color: #ff6b35;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.demo-project-card-signup-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.demo-project-card--signup-hint .demo-project-assigned,
.demo-project-card--signup-hint .demo-project-buttons-section {
  display: none !important;
}

.demo-project-assigned {
  margin-top: 1rem;
}

.demo-project-assigned-label {
  font-size: 0.875rem;
  color: #6B7280;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Count pills next to labels — match app badges: fixed appearance, no pointer hover */
.demo-project-assigned-label span {
  pointer-events: none;
  user-select: none;
}

.demo-project-avatars {
  display: flex;
  margin: 0 -4px;
  overflow: hidden;
}

.demo-project-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid #FFFFFF;
  background: linear-gradient(to bottom right, #FFB499, #FF6B35);
  color: white;
  font-size: 0.625rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: -8px;
}

.demo-project-avatar:first-child {
  margin-left: 0;
}

.demo-project-buttons-section {
  margin-top: 1rem;
}

.demo-project-button-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.demo-project-button-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 500;
  font-family: inherit;
  border-radius: 9999px;
  background: #F5F5F4;
  color: #2D2D2D;
  border: 1px solid #E5E5E4;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

/* Button reset when used as <button> */
button.demo-project-button-pill {
  appearance: none;
  -webkit-appearance: none;
}

.demo-project-button-pill:hover {
  background: #E5E5E4;
  color: #2D2D2D;
}

/* Calendar layout - matches app Calendar page */
.demo-calendar-layout {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

@media (min-width: 1280px) {
  .demo-calendar-layout {
    flex-direction: row;
  }
}

.demo-calendar-card {
  width: 100%;
  flex-shrink: 0;
}

@media (min-width: 1280px) {
  .demo-calendar-card {
    width: 340px;
  }
}

.demo-calendar-card-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.125rem;
  font-weight: 600;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #E5E5E4;
}

.demo-calendar-card-title svg {
  width: 20px;
  height: 20px;
  color: #FF6B35;
}

.demo-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  padding: 1rem;
  gap: 2px;
}

.demo-calendar-weekday {
  text-align: center;
  font-size: 0.8rem;
  color: #6B7280;
  padding: 0.25rem 0;
}

.demo-calendar-day {
  box-sizing: border-box;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  border-radius: 0.375rem;
  color: #2D2D2D;
}

/* Matches app Calendar day_today: border-primary + bg-background (unfilled square) */
.demo-calendar-day.today {
  background: #fff;
  font-weight: 600;
  outline: 1px solid #ff6b35;
  outline-offset: -1px;
}

/* Selected date: filled primary (today selection drops the outline ring, like aria-selected in the app) */
.demo-calendar-day.selected {
  background: #ff6b35;
  color: #fff;
  font-weight: 600;
  outline: none;
}

.demo-calendar-day.today.selected {
  background: #ff6b35;
  color: #fff;
  outline: none;
}

/* Days with tasks: small dot indicator (distinct from selection) */
.demo-calendar-day.has-task {
  position: relative;
  color: #2D2D2D;
}
.demo-calendar-day.has-task::after {
  content: '';
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #FF6B35;
}
.demo-calendar-day.has-task.selected {
  color: white;
}
.demo-calendar-day.has-task.selected::after {
  background: white;
}

.demo-calendar-day.other-month {
  color: #9CA3AF;
}

.demo-tasks-sidebar {
  flex: 1;
  min-width: 0;
}

.demo-tasks-card-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.125rem;
  font-weight: 600;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #E5E5E4;
}

.demo-tasks-card-title svg {
  width: 20px;
  height: 20px;
  color: #FF6B35;
}

/* Important page — matches Important.tsx tabs + ImportantThings grid */
/* Same band as “Unread notifications”: direct flex children + body line-height (1.5) on buttons */
#demo-important .demo-important-card-tabs {
  border-bottom: none;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  align-items: center;
  /* Same total vertical band as icon + label row: pad-y 1rem + line box (1.125rem × 1.5) + pad-y 1rem */
  min-height: calc(2rem + 1.125rem * 1.5);
  box-sizing: border-box;
}

/* Same text size/weight as .demo-tasks-card-title (“Unread notifications”) */
.demo-important-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.5;
  color: #6B7280;
  border-radius: 0.125rem;
  transition: color 0.15s ease;
  -webkit-appearance: none;
  appearance: none;
}

.demo-important-tab:hover {
  color: #2D2D2D;
}

.demo-important-tab.active {
  color: #FF6B35;
}

.demo-important-tab:focus-visible {
  outline: 2px solid #FF6B35;
  outline-offset: 2px;
}

.demo-important-tab svg {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  color: currentColor;
  transition: color 0.15s ease;
}

.demo-important-panel {
  display: none;
}

.demo-important-panel.active {
  display: block;
}

/* Fixed 3-up grid everywhere (same spacious layout as scaled mobile demo) */
.demo-important-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem 0.25rem;
  align-items: start;
  justify-items: stretch;
}

.demo-important-tile {
  display: flex;
  justify-content: flex-start;
  min-width: 0;
}

.demo-important-tile-inner {
  width: 100%;
  max-width: 20rem;
  min-width: 0;
}

/* Note uses full grid cell width; copy is left-aligned and spans the card */
.demo-important-tile--note {
  justify-content: stretch;
}

.demo-important-tile--note .demo-important-tile-inner {
  max-width: none;
}

.demo-important-adder {
  border: 1px dashed #E5E5E4;
  border-radius: 0.5rem;
  padding: 1rem;
  background: #fff;
}

.demo-important-adder-modes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-bottom: 0.5rem;
}

.demo-important-mode-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius);
  border: 1px solid #E5E5E4;
  background: #fff;
  color: #2D2D2D;
  cursor: default;
}

.demo-important-mode-btn--active {
  background: linear-gradient(to right, #FF6B35, #FF4F00);
  color: #fff;
  border-color: transparent;
}

.demo-important-input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  border: 1px solid #E5E5E4;
  border-radius: var(--radius);
  background: #fff;
  color: #2D2D2D;
}

.demo-important-input--sm {
  margin-bottom: 0;
}

.demo-important-textarea {
  width: 100%;
  box-sizing: border-box;
  min-height: 4rem;
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  font-family: inherit;
  border: 1px solid #E5E5E4;
  border-radius: var(--radius);
  background: #fff;
  color: #2D2D2D;
  resize: none;
}

/* Decorative fields — not interactive in the landing demo */
#demo-important-panel-things .demo-important-input,
#demo-important-panel-things .demo-important-textarea {
  pointer-events: none;
  cursor: default;
  user-select: none;
}

.demo-important-adder-actions {
  display: flex;
  justify-content: flex-end;
}

.demo-btn-primary--sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  gap: 0.375rem;
}

.demo-btn-outline-sm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid #E5E5E4;
  border-radius: var(--radius);
  background: #fff;
  color: #2D2D2D;
  cursor: default;
  white-space: nowrap;
}

.demo-important-note-card,
.demo-important-checklist-card {
  border: 1px solid #E5E5E4;
  border-radius: 0.5rem;
  padding: 1rem;
  background: #fff;
}

.demo-important-note-card {
  display: block;
  text-align: left;
}

.demo-important-note-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.25rem;
}

.demo-important-note-title {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: #2D2D2D;
  word-break: break-word;
  flex: 1;
  min-width: 0;
  text-align: left;
}

.demo-important-note-text {
  margin: 0;
  font-size: 0.875rem;
  color: #6B7280;
  white-space: pre-wrap;
  word-break: break-word;
  text-align: left;
  width: 100%;
}

.demo-important-note-actions {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 0.25rem;
}

.demo-important-checklist-head {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.demo-important-checklist-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
}

.demo-important-checklist-title {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: #2D2D2D;
  word-break: break-word;
}

.demo-important-checklist-actions {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 0.25rem;
}

.demo-important-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  border: none;
  border-radius: 0.375rem;
  background: transparent;
  color: #6B7280;
  cursor: default;
}

.demo-important-icon-btn:hover {
  background: #F5F5F4;
  color: #2D2D2D;
}

.demo-important-icon-btn--danger:hover {
  color: #DC2626;
}

.demo-important-checklist-items {
  list-style: none;
  margin: 0 0 0.5rem;
  padding: 0;
}

.demo-important-checklist-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.25rem 0;
  border-radius: 0.375rem;
}

.demo-important-checkbox {
  flex-shrink: 0;
  width: 1rem;
  height: 1rem;
  margin-top: 0;
  border: 1px solid #D4D4D4;
  border-radius: 0.25rem;
  background: #fff;
  box-sizing: border-box;
}

.demo-important-checkbox--checked {
  background: #FF6B35;
  border-color: #FF6B35;
  display: flex;
  align-items: center;
  justify-content: center;
}

.demo-important-item-text {
  flex: 1;
  min-width: 0;
  font-size: 0.875rem;
  color: #2D2D2D;
  word-break: break-word;
  cursor: default;
}

.demo-important-item-text--done {
  text-decoration: line-through;
  color: #6B7280;
}

.demo-important-row-tools {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 0.125rem;
}

.demo-important-grip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  color: #6B7280;
  cursor: grab;
}

.demo-important-add-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.demo-important-add-row .demo-important-input {
  flex: 1;
}

.demo-important-add-row .demo-important-input--sm,
.demo-important-add-row .demo-btn-outline-sm {
  height: 2.25rem;
  min-height: 2.25rem;
  box-sizing: border-box;
  padding: 0 0.75rem;
}

.demo-important-add-row .demo-important-input--sm {
  line-height: 1.25;
}

#demo-notifications .demo-tasks-card-title {
  border-bottom: none;
}

.demo-empty-state {
  text-align: center;
  padding: 2rem 1rem;
  color: #6B7280;
}

.demo-empty-state svg {
  width: 48px;
  height: 48px;
  margin: 0 auto 1rem;
  opacity: 0.5;
}

/* Team - matches UserManagement UserCard */
.demo-team-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .demo-team-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .demo-team-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Matches app .team-user-card (index.css): lift + shadow on fine pointer */
.demo-team-card {
  padding: 1.5rem;
  border: 1px solid #E5E5E4;
  border-radius: var(--radius-xl);
  background: #ffffff;
  text-align: center;
  -webkit-tap-highlight-color: transparent;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

@media (hover: hover) and (pointer: fine) {
  #demo-team .demo-team-card:hover {
    box-shadow:
      0 10px 15px -3px rgba(0, 0, 0, 0.1),
      0 4px 6px -4px rgba(0, 0, 0, 0.1);
    transform: translateY(-0.25rem);
  }
}

@media (hover: none), (pointer: coarse) {
  #demo-team .demo-team-card {
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  }

  #demo-team .demo-team-card:hover,
  #demo-team .demo-team-card:active {
    background: rgba(245, 245, 244, 0.5);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transform: none;
  }
}

.demo-team-avatar {
  width: 64px;
  height: 64px;
  margin: 0 auto 0.75rem;
  border-radius: 50%;
  background: linear-gradient(to bottom right, #FFB499, #FF6B35);
  color: white;
  font-size: 1.125rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* User avatars in demo — match app Avatar: decorative, no hover/click on the circle */
.demo-avatar,
.demo-task-avatar,
.demo-project-avatar,
.demo-team-avatar {
  pointer-events: none;
  user-select: none;
}

.demo-team-name {
  font-size: 1.125rem;
  font-weight: 600;
  color: #2D2D2D;
  margin: 0 0 0.5rem;
}

#demo-team .demo-team-name {
  margin-bottom: 0.25rem;
}

.demo-team-job {
  font-size: 0.8125rem;
  color: #6B7280;
  margin: 0 0 0.625rem;
  line-height: 1.35;
}

.demo-team-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem;
  margin-bottom: 1rem;
}

.demo-team-badge {
  font-size: 0.75rem;
  padding: 0.125rem 0.5rem;
  border-radius: 0.25rem;
  font-weight: 500;
  pointer-events: none;
  user-select: none;
}

.demo-team-badge-admin {
  background: linear-gradient(to right, #FF6B35, #FF4F00);
  color: white;
}

.demo-team-badge-owner {
  background: transparent;
  border: 1px solid #E5E5E4;
  color: #6B7280;
}

.demo-team-badge-collab {
  background: #F5F5F4;
  color: #4B5563;
  border: 1px solid #E5E5E4;
}

.demo-team-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  padding: 0.75rem;
  margin-bottom: 1rem;
  background: rgba(245, 245, 244, 0.5);
  border-radius: 0.5rem;
}

.demo-team-stat {
  text-align: center;
}

.demo-team-stat-value {
  display: block;
  font-size: 1.125rem;
  font-weight: 700;
}

.demo-team-stat:nth-child(1) .demo-team-stat-value { color: #DC2626; }
.demo-team-stat:nth-child(2) .demo-team-stat-value { color: #FF6B35; }
.demo-team-stat:nth-child(3) .demo-team-stat-value { color: #2563EB; }

.demo-team-stat-label {
  font-size: 0.75rem;
  color: #6B7280;
}

.demo-team-actions {
  display: flex;
  gap: 0.5rem;
}

.demo-team-btn {
  flex: 1;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  border: 1px solid #E5E5E4;
  border-radius: 0.375rem;
  background: transparent;
  color: #6B7280;
  cursor: pointer;
  transition: background 0.2s;
}

.demo-team-btn:hover:not(:disabled) {
  background: #F5F5F4;
}

.demo-team-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.demo-team-btn-remove:hover:not(:disabled) {
  background: #FEE2E2;
  color: #B91C1C;
  border-color: #FECACA;
}

/* Notifications — matches Notifications.tsx list rows */
.demo-notifications-card-body {
  padding-top: 0;
}

.demo-notifications-empty {
  padding: 2.5rem 1rem;
}

.demo-notifications-empty svg {
  opacity: 0.5;
  margin-bottom: 0.75rem;
}

.demo-notifications-list {
  display: flex;
  flex-direction: column;
}

/* Same container rhythm as .demo-task-item */
.demo-notification-item {
  display: flex;
  flex-direction: column;
  padding: 1rem;
  border: 1px solid #E5E5E4;
  border-radius: 0.75rem;
  margin-bottom: 0.25rem;
  transition: background 0.2s;
  cursor: pointer;
}

.demo-notification-item:hover {
  background: rgba(245, 245, 244, 0.5);
}

.demo-notification-row-inner {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1rem;
}

@media (min-width: 640px) {
  .demo-notification-row-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
  }

  .demo-notification-mark-read {
    align-self: center;
  }
}

.demo-notification-main {
  flex: 1;
  min-width: 0;
}

/* Match .demo-task-title */
.demo-notification-message {
  font-size: 0.9375rem;
  font-weight: 500;
  color: #2D2D2D;
  word-break: break-word;
  margin-bottom: 0;
  cursor: pointer;
}

/* Meta row uses .demo-task-meta (shared with task items) */
.demo-notification-item .demo-notification-meta.demo-task-meta {
  margin-top: 0.5rem;
}

.demo-notification-mark-read {
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid #E5E5E4;
  border-radius: var(--radius);
  background: transparent;
  color: #6b7280;
  cursor: pointer;
  flex-shrink: 0;
  font-family: inherit;
  width: 100%;
  transition: background 0.2s;
}

@media (min-width: 640px) {
  .demo-notification-mark-read {
    width: auto;
  }
}

.demo-notification-mark-read:hover {
  background: #f5f5f4;
  color: #2d2d2d;
}

/* Landing page demo: keep desktop notification row + button shape on all viewports */
#demo-notifications .demo-notification-row-inner {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

#demo-notifications .demo-notification-mark-read {
  width: auto;
  align-self: center;
}

/* Sign up hint — same behavior as task rows */
.demo-notification-item--signup-hint .demo-notification-message {
  color: #ff6b35;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.demo-notification-item--signup-hint .demo-task-meta > .demo-task-due,
.demo-notification-item--signup-hint .demo-task-meta > .demo-task-badge:not(.demo-task-signup-badge) {
  display: none !important;
}

.demo-page-actions--hidden {
  display: none;
}

/* Mobile sidebar toggle - visible only on mobile */
.demo-sidebar-toggle {
  display: none;
  position: absolute;
  top: 1rem;
  left: 1rem;
  z-index: 50;
  width: 40px;
  height: 40px;
  padding: 0;
  touch-action: manipulation;
  border: 1px solid #E5E5E4;
  border-radius: 0.5rem;
  background: #FFFFFF;
  color: #6B7280;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: background 0.2s, color 0.2s;
}

.demo-sidebar-toggle:hover {
  background: #F5F5F4;
  color: #2D2D2D;
}

.demo-sidebar-toggle-icon {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 20px;
  height: 20px;
}

.demo-sidebar-toggle-menu {
  display: none;
}

.demo-sidebar-toggle.demo-sidebar-hidden .demo-sidebar-toggle-menu {
  display: block;
}

.demo-sidebar-toggle.demo-sidebar-hidden .demo-sidebar-toggle-close {
  display: none;
}

.demo-interactive-frame {
  position: relative;
}

.demo-mobile-scroll-hint {
  display: none;
}

/* Scale wrapper - transparent on desktop, preserves exact proportions on mobile */
.demo-scale-wrapper {
  display: contents;
}

/* One full appear → disappear cycle in 1s (repeats while hint is shown) */
@keyframes demo-mobile-arrow-pulse {
  0% {
    opacity: 0;
    transform: translateX(0);
  }
  35% {
    opacity: 1;
    transform: translateX(8px);
  }
  65% {
    opacity: 1;
    transform: translateX(8px);
  }
  100% {
    opacity: 0;
    transform: translateX(0);
  }
}

/* Mobile: same desktop layout, 20% smaller to see more, horizontal scroll to view full demo */
@media (max-width: 768px) {
  .demo-section .container {
    display: grid;
    grid-template-columns: 100%;
    grid-template-rows: auto auto;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    padding-left: 0;
    padding-right: 0;
    width: 100%;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* legacy Edge */
  }

  .demo-section .container::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Chromium Edge */
  }

  .demo-interactive-frame {
    grid-column: 1;
    grid-row: 1;
    width: 100%;
    min-width: 0;
  }

  .demo-mobile-scroll-hint {
    display: flex;
    grid-column: 1;
    grid-row: 1;
    justify-self: end;
    align-self: center;
    position: sticky;
    right: max(0.35rem, env(safe-area-inset-right));
    z-index: 45;
    pointer-events: none;
    width: min-content;
    padding: 0.25rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
  }

  .demo-mobile-scroll-hint--in-view:not(.demo-mobile-scroll-hint--at-end) {
    opacity: 1;
    visibility: visible;
  }

  .demo-mobile-scroll-hint-icon {
    color: #ff6b35;
    filter: drop-shadow(0 2px 10px rgba(255, 107, 53, 0.4));
    opacity: 0;
  }

  .demo-mobile-scroll-hint--in-view:not(.demo-mobile-scroll-hint--at-end):not(.demo-mobile-scroll-hint--user-h-scroll)
    .demo-mobile-scroll-hint-icon {
    animation: demo-mobile-arrow-pulse 1s ease-in-out infinite;
  }

  /* At least as wide as .demo-scale-wrapper (736px); pills may wrap, row stays centered */
  .demo-feature-badges {
    grid-column: 1;
    grid-row: 2;
    width: max(736px, 100%);
    min-width: 736px;
    max-width: none;
    box-sizing: border-box;
    margin-left: 0;
    margin-right: 0;
    padding: 0 1rem;
    flex-wrap: wrap;
  }

  .demo-scale-wrapper {
    display: block;
    width: 736px; /* 920 * 0.8 - exact scaled width (no empty sidebar gutter) */
    height: 512px; /* 640 * 0.8 - exact scaled height */
    overflow: hidden;
    position: relative;
  }

  .demo-app-wrap {
    width: 920px;
    min-width: 920px;
    height: 640px;
    overflow: hidden;
    transform: scale(0.8);
    transform-origin: top left;
    box-shadow: none;
    position: absolute;
    left: 0;
    top: 0;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }

  .demo-sidebar-toggle {
    display: flex;
  }

  .demo-sidebar {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 40;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 12px rgba(0, 0, 0, 0.08);
  }

  .demo-sidebar.demo-sidebar-hidden {
    transform: translateX(-100%);
  }

  .demo-main {
    flex: none;
    width: 920px;
    min-width: 0;
    padding-left: 3.5rem; /* Clear space for sidebar toggle button */
    -webkit-text-size-adjust: 100%; /* Prevent Safari from zooming text on wide elements */
    text-size-adjust: 100%;
    transform: translateZ(0); /* Prevent antialiasing shifts during sidebar transform */
  }

  /* Force desktop layout - override min-width breakpoints */
  .demo-page-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .demo-page-title {
    font-size: 1.875rem;
  }

  .demo-page-actions {
    width: auto;
  }

  .demo-search {
    width: 320px;
    flex: none;
  }

  /* Real viewport is narrow but the demo is fixed 920px wide + scaled: keep desktop tab strip */
  .demo-card-header {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }

  .demo-tabs {
    flex: 1 1 0;
    min-width: min(100%, 22rem);
  }

  .demo-tabs-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.2rem;
    min-height: 2.5rem;
  }

  .demo-tabs-trigger {
    padding: 0.375rem 0.5rem;
    min-height: 2rem;
  }

  .demo-filter-btn {
    min-height: 2.5rem;
  }

  .demo-project-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .demo-calendar-layout {
    flex-direction: row;
  }

  .demo-calendar-card {
    width: 340px;
  }

  .demo-team-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) and (prefers-reduced-motion: reduce) {
  .demo-mobile-scroll-hint--in-view:not(.demo-mobile-scroll-hint--at-end):not(.demo-mobile-scroll-hint--user-h-scroll)
    .demo-mobile-scroll-hint-icon {
    animation: none;
    opacity: 1;
    transform: none;
  }
}
