/* --- LOGGED-IN LANDING PAGE STYLES --- */

/* Hero adjustments for logged-in users */
body.logged-in .hero-section {
  min-height: auto;
  overflow: visible;
  padding-top: clamp(88px, 12vh, 132px);
  padding-bottom: clamp(76px, 9.5vh, 104px);
}

body.logged-in .hero-section::before {
  content: "";
  position: absolute;
  top: clamp(-132px, -12vh, -88px);
  right: 0;
  bottom: -48px;
  left: 0;
  z-index: -2;
  background-image:
    linear-gradient(rgba(99, 102, 241, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99, 102, 241, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 90% 80% at 50% 38%, black 15%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 90% 80% at 50% 38%, black 15%, transparent 100%);
}

body.logged-in .hero-content {
  position: relative;
  z-index: 1;
}

body.logged-in .hero-glow {
  opacity: 0.28;
  top: 32%;
  width: 920px;
  height: 920px;
}

.hero-kicker {
  margin-bottom: 10px;
}

.hero-kicker.hidden {
  display: none !important;
}

body.logged-in .hero-kicker {
  display: block;
}

body.logged-in .hero-title {
  font-size: clamp(2rem, 3vw, 2.75rem);
  max-width: none;
  line-height: 1.08;
}

body.logged-in .hero-title .hero-title-accent {
  color: var(--primary-text);
  font-weight: 800;
  white-space: nowrap;
}

body.logged-in .hero-title .hero-title-accent.hero-title-accent--stacked {
  display: block;
  margin-top: 0.12em;
}

body.logged-in .hero-left {
  display: flex;
  flex-direction: column;
  gap: 0;
}

body.logged-in .hero-subtitle {
  font-size: var(--text-lg);
  line-height: 1.6;
  margin-bottom: 1.5rem;
  margin-top: 0.25rem;
}

html.es-route-workspace body.logged-in .hero-subtitle {
  max-width: none;
  margin-bottom: 0;
  font-size: var(--text-lg);
  line-height: 1.6;
}

html.es-route-workspace body.logged-in #hero-title {
  min-height: var(--ws-hero-title-block);
}

body.logged-in .hero-upload {
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.08), 0 1px 4px rgba(15, 23, 42, 0.04);
  border: 1.5px solid rgba(99, 102, 241, 0.14);
}

body.logged-in .hero-upload:hover {
  box-shadow: 0 8px 28px rgba(99, 102, 241, 0.14), 0 2px 8px rgba(15, 23, 42, 0.04);
  border-color: rgba(99, 102, 241, 0.28);
}

body.logged-in .hero-upload.upload-area {
  padding: 3.5rem 2.25rem;
}

html.es-route-workspace body.logged-in .hero-upload.hero-upload-staged,
html.es-route-workspace body.logged-in .hero-upload {
  min-height: var(--ws-hero-upload-min-height);
  box-sizing: border-box;
}

body.logged-in .hero-upload .upload-icon {
  width: 110px;
  height: 110px;
  background: rgba(99, 102, 241, 0.04);
  border-color: rgba(99, 102, 241, 0.1);
}

body.logged-in .hero-upload .upload-icon svg {
  width: 52px;
  height: 52px;
  color: var(--primary);
}

/* Team overview on workspace landing (owners/admins) */
.team-overview-section {
  padding: 0 0 clamp(20px, 2.5vh, 28px);
}

body.logged-in .team-overview-section {
  padding-bottom: clamp(16px, 2vh, 24px);
}

.team-overview-card {
  background: var(--surface-white);
  border: 1px solid rgba(99, 102, 241, 0.08);
  border-radius: 20px;
  box-shadow:
    0 4px 24px rgba(15, 23, 42, 0.05),
    0 1px 4px rgba(15, 23, 42, 0.03),
    0 0 0 1px rgba(255, 252, 250, 0.85) inset;
  padding: clamp(20px, 3vw, 32px);
  position: relative;
  overflow: hidden;
}

.team-overview-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 55%, rgba(99, 102, 241, 0.15) 100%);
  border-radius: 20px 20px 0 0;
  z-index: 2;
}

.team-overview-card > * {
  position: relative;
  z-index: 1;
}

.team-overview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.team-overview-heading {
  min-width: 0;
  flex: 1 1 200px;
}

.team-overview-title {
  margin: 0;
  font-size: clamp(1.125rem, 2vw, 1.35rem);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

.team-overview-meta {
  margin: 6px 0 0;
  font-size: var(--text-base);
  color: var(--text-secondary);
}

.team-overview-cta {
  flex-shrink: 0;
  white-space: nowrap;
  border-radius: var(--radius-md, 10px);
  font-weight: 600;
  text-decoration: none;
}

.team-overview-period {
  margin: 24px 0 10px;
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
}

.team-overview-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--spacing-sm, 12px);
}

@media (max-width: 900px) {
  .team-overview-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 520px) {
  .team-overview-stats {
    grid-template-columns: 1fr;
  }
}

.team-overview-stat {
  background: color-mix(in srgb, var(--cream) 32%, white);
  border-radius: var(--radius-md, 12px);
  padding: var(--spacing-md, 16px);
  border: 1px solid rgba(15, 23, 42, 0.07);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.team-overview-stat-label {
  display: block;
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  font-weight: 600;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.team-overview-stat-value {
  display: block;
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.team-overview-stat-value.is-loading {
  color: var(--text-tertiary);
  font-size: var(--text-base);
  font-weight: 500;
}

.team-overview-usage {
  margin-top: 0;
}

/* Team export usage bar + top-member breakdown (shared with team dashboard) */
.team-usage-block {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.team-usage-bar {
  margin: 0;
}

.team-usage-leaders-title {
  margin: 0 0 12px;
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
}

.team-usage-leaders-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.team-usage-leaders-empty {
  margin: 0;
  font-size: var(--text-base);
  color: var(--text-tertiary);
}

.team-usage-leader-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.team-usage-leader-avatar {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--primary) 12%, white);
  color: var(--primary-dark);
  font-size: var(--text-base);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.team-usage-leader-body {
  flex: 1;
  min-width: 0;
}

.team-usage-leader-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.team-usage-leader-name {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-usage-leader-count {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.team-usage-leader-track {
  height: 8px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.team-usage-leader-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
  transition: width 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  min-width: 4px;
}

@media (max-width: 640px) {
  .team-overview-header {
    flex-direction: column;
    align-items: stretch;
  }

  .team-overview-cta {
    width: 100%;
    text-align: center;
  }
}

/* Workspace Section: tabbed container for Recent Projects + Brand Profiles */
.workspace-section {
  padding: clamp(24px, 3.5vh, 40px) 0 clamp(28px, 3.5vh, 44px);
}

.workspace-container {
  background: var(--surface-white);
  border: 1px solid rgba(99, 102, 241, 0.08);
  border-radius: 20px;
  box-shadow:
    0 4px 24px rgba(15, 23, 42, 0.05),
    0 1px 4px rgba(15, 23, 42, 0.03),
    0 0 0 1px rgba(255, 252, 250, 0.85) inset;
  padding: clamp(24px, 3.5vw, 40px);
  position: relative;
  overflow: hidden;
}

.workspace-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 55%, rgba(99, 102, 241, 0.15) 100%);
  border-radius: 20px 20px 0 0;
  z-index: 2;
}

.workspace-container::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(99, 102, 241, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99, 102, 241, 0.025) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse 85% 70% at 50% 0%, black 0%, transparent 72%);
  -webkit-mask-image: radial-gradient(ellipse 85% 70% at 50% 0%, black 0%, transparent 72%);
}

.workspace-container > * {
  position: relative;
  z-index: 1;
}

.workspace-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 16px;
  flex-wrap: wrap;
}

/* Landing workspace tabs */
.workspace-tabs {
  gap: clamp(24px, 3vw, 40px);
}

.workspace-tabs .tab-btn {
  padding: 4px 0 14px;
}

.workspace-tab-text {
  line-height: 1.25;
}

.workspace-tab-badge {
  font-size: var(--text-xs);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  color: var(--text-tertiary);
  transition: color 0.2s ease;
}

.workspace-tab-badge::before {
  content: '·';
  margin-right: 6px;
  color: rgba(15, 23, 42, 0.2);
  font-weight: 400;
}

.workspace-tab-badge:empty {
  display: none;
}

.workspace-tab-badge:empty::before {
  display: none;
}

.workspace-tabs .tab-btn.active .workspace-tab-badge {
  color: var(--primary);
}

.workspace-tabs .tab-btn.active .workspace-tab-badge::before {
  color: rgba(99, 102, 241, 0.35);
}

.workspace-panels {
  position: relative;
  min-height: 120px;
}

.workspace-panel:not(.hidden) {
  animation: workspacePanelIn 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes workspacePanelIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .workspace-panel:not(.hidden) {
    animation: none;
  }
  .underline-tabs__indicator {
    transition: none;
  }
}

.workspace-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.workspace-brand-filter__dropdown {
  position: relative;
}

.workspace-brand-filter__trigger {
  justify-content: space-between;
  gap: 8px;
  min-width: 120px;
  max-width: min(220px, 42vw);
  padding-left: 0.875rem;
  padding-right: 0.625rem;
}

.workspace-brand-filter__label {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.workspace-brand-filter__chevron {
  flex-shrink: 0;
  color: var(--text-tertiary);
  transition: transform 0.15s ease;
}

.workspace-brand-filter__trigger[aria-expanded="true"] .workspace-brand-filter__chevron {
  transform: rotate(180deg);
}

.workspace-brand-filter__menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 100%;
  width: max-content;
  max-width: min(260px, 80vw);
  max-height: 240px;
  overflow-y: auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  padding: 6px;
  z-index: 60;
}

.workspace-brand-filter__option {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-radius: var(--radius-base);
  background: transparent;
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background 0.15s ease, color 0.15s ease;
}

.workspace-brand-filter__option:hover {
  background: rgba(99, 102, 241, 0.06);
  color: var(--text-primary);
}

.workspace-brand-filter__option:focus-visible {
  outline: none;
  background: rgba(99, 102, 241, 0.08);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.18);
}

.workspace-brand-filter__option.is-selected {
  background: rgba(99, 102, 241, 0.1);
  color: var(--primary-dark);
  font-weight: var(--weight-semibold);
}

.brand-profiles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

.brand-profile-card {
  background: var(--surface-white);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 14px;
  padding: 18px 18px 16px;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.04);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.brand-profile-card:hover {
  border-color: rgba(99, 102, 241, 0.25);
  box-shadow: 0 8px 24px -4px rgba(99, 102, 241, 0.15), 0 4px 12px rgba(15, 23, 42, 0.04);
  transform: translateY(-2px);
}

.brand-profile-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.brand-profile-card__name {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.3;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-profile-card__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex-shrink: 0;
}

.brand-profile-api-tag {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 2px 6px;
  border-radius: 4px;
}

.brand-profile-api-tag--connected {
  color: var(--success, var(--success-dark));
  background: rgba(5, 150, 105, 0.1);
}

.brand-profile-api-tag--missing {
  color: var(--text-tertiary);
  background: rgba(15, 23, 42, 0.06);
}

.brand-profile-card__link {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-profile-card__footer-meta {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  margin: 0;
  line-height: 1.4;
}

.brand-profile-card__actions {
  margin-top: auto;
  padding-top: 4px;
}

.brand-profile-card__edit-btn {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--primary);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.brand-profile-card__edit-btn:hover {
  text-decoration: underline;
}

.brand-profiles-empty-card {
  grid-column: 1 / -1;
  text-align: center;
  padding: 56px 24px;
  border: 2px dashed rgba(99, 102, 241, 0.15);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.03) 0%, rgba(248, 250, 252, 0.5) 100%);
}

.brand-profiles-empty-card svg {
  color: var(--primary);
  opacity: 0.35;
  margin-bottom: 14px;
}

.brand-profiles-empty-card h3 {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--text-secondary);
  margin: 0 0 6px;
}

.brand-profiles-empty-card p {
  font-size: var(--text-md);
  color: var(--text-tertiary);
  margin: 0 0 18px;
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
}

.brand-profiles-grid--loading {
  grid-column: 1 / -1;
  text-align: center;
  padding: 32px 24px;
  color: var(--text-tertiary);
  font-size: var(--text-md);
}

/* Skeleton loaders (workspace landing) */
@keyframes es-skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.es-skeleton {
  display: block;
  border-radius: var(--radius-base);
  background: linear-gradient(
    90deg,
    rgba(15, 23, 42, 0.06) 0%,
    rgba(15, 23, 42, 0.1) 45%,
    rgba(15, 23, 42, 0.06) 90%
  );
  background-size: 200% 100%;
  animation: es-skeleton-shimmer 1.4s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .es-skeleton {
    animation: none;
    background: rgba(15, 23, 42, 0.08);
  }
}

.es-skeleton--text {
  height: 12px;
  border-radius: var(--radius-sm);
}

.es-skeleton--stat {
  width: 3.5rem;
  height: 1.35rem;
  border-radius: var(--radius-base);
}

.es-skeleton--bar {
  height: 8px;
  width: 100%;
  border-radius: 999px;
}

.history-item--skeleton {
  pointer-events: none;
  cursor: default;
}

.history-item--skeleton:hover {
  transform: none;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
  border-color: rgba(15, 23, 42, 0.08);
}

.history-item__skeleton-thumb {
  height: 140px;
  border-radius: 14px 14px 0 0;
}

.history-item__skeleton-line--title {
  width: 78%;
  height: 14px;
  margin-bottom: 10px;
}

.history-item__skeleton-line--date {
  width: 52%;
  margin-bottom: 8px;
}

.history-item__skeleton-line--slices {
  width: 38%;
}

.brand-profile-card--skeleton {
  pointer-events: none;
  min-height: 148px;
}

.brand-profile-card--skeleton:hover {
  transform: none;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.04);
  border-color: rgba(15, 23, 42, 0.08);
}

.brand-profile-card__skeleton-title {
  width: 62%;
  height: 16px;
  margin-bottom: 12px;
}

.brand-profile-card__skeleton-tag {
  width: 72px;
  height: 18px;
  border-radius: 4px;
  margin-bottom: 10px;
}

.brand-profile-card__skeleton-line {
  width: 88%;
  margin-bottom: 8px;
}

.brand-profile-card__skeleton-line--short {
  width: 55%;
}

.workspace-tab-badge--skeleton {
  display: inline-block !important;
  min-width: 1.25rem;
  height: 0.75rem;
  border-radius: 4px;
  vertical-align: middle;
  color: transparent !important;
  animation: es-skeleton-shimmer 1.4s ease-in-out infinite;
  background: linear-gradient(
    90deg,
    rgba(15, 23, 42, 0.06) 0%,
    rgba(15, 23, 42, 0.1) 45%,
    rgba(15, 23, 42, 0.06) 90%
  );
  background-size: 200% 100%;
}

.workspace-tab-badge--skeleton::before {
  display: none !important;
}

.team-overview-usage--loading [data-team-usage-fill] {
  width: 42% !important;
  background-color: transparent !important;
  animation: es-skeleton-shimmer 1.4s ease-in-out infinite;
  background-image: linear-gradient(
    90deg,
    rgba(15, 23, 42, 0.06) 0%,
    rgba(15, 23, 42, 0.1) 45%,
    rgba(15, 23, 42, 0.06) 90%
  );
  background-size: 200% 100%;
}

.team-overview-usage--loading [data-team-usage-used],
.team-overview-usage--loading [data-team-usage-limit] {
  visibility: hidden;
}

.team-usage-leader-row--skeleton {
  pointer-events: none;
}

.team-usage-leader-avatar--skeleton {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
}

.team-usage-leader-row--skeleton .team-usage-leader-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.team-usage-leader-row--skeleton .team-usage-leader-head-line {
  width: 72%;
  height: 14px;
}

.team-usage-leader-row--skeleton .team-usage-leader-track-line {
  width: 100%;
  height: 8px;
  border-radius: 999px;
}

.team-overview-stat-value.is-skeleton-loading {
  color: transparent;
  user-select: none;
}

.team-overview-stat-value.is-skeleton-loading .es-skeleton--stat {
  margin-top: 2px;
}

/* Recent Projects Grid (inside workspace panel) */
.recent-projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 18px;
}

.workspace-section .history-item {
  background: var(--surface-white);
  position: relative;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.workspace-section .history-item:hover {
  border-color: rgba(99, 102, 241, 0.25);
  box-shadow: 0 8px 24px -4px rgba(99, 102, 241, 0.15), 0 4px 12px rgba(15, 23, 42, 0.04);
  transform: translateY(-2px);
}

.workspace-section .history-thumb {
  height: 140px;
  background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-tertiary) 100%);
}

.history-slices {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--primary);
  margin-top: 4px;
}

/* Empty workspace state */
.recent-projects-empty-card {
  grid-column: 1 / -1;
  text-align: center;
  padding: 72px 24px;
  border: 2px dashed rgba(99, 102, 241, 0.15);
  border-radius: var(--radius-lg);
  background: var(--surface-white);
}

.recent-projects-empty-card svg {
  color: var(--primary);
  opacity: 0.35;
  margin-bottom: 16px;
}

.recent-projects-empty-card h3 {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--text-secondary);
  margin: 0 0 6px;
}

.recent-projects-empty-card p {
  font-size: var(--text-md);
  color: var(--text-tertiary);
  margin: 0;
}

.recent-projects-empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-tertiary);
  font-size: var(--text-md);
}

.recent-projects-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 0;
  margin-top: 20px;
  padding-top: 4px;
  font-size: var(--text-base);
}

html.es-route-workspace.workspace-preparing .recent-projects-pagination--preparing {
  visibility: hidden;
  min-height: 32px;
}

html.es-route-workspace.workspace-preparing .workspace-header-actions {
  min-height: 38px;
}

.recent-projects-pagination-sep {
  margin: 0 12px;
  color: var(--text-tertiary);
  opacity: 0.45;
  user-select: none;
}

.recent-projects-page-link {
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  font-weight: 500;
  color: var(--text-tertiary);
  cursor: pointer;
  text-decoration: none;
  transition: color 0.15s ease;
}

button.recent-projects-page-link:hover {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.recent-projects-page-link.is-current {
  color: var(--text-secondary);
  font-weight: 600;
  cursor: default;
}

.recent-projects-page-link--nav {
  font-weight: 500;
}

/* Marketing sections wrapper - no special styles needed, 
   visibility controlled via JS */
#marketing-sections {
  display: block;
}

/* First-paint route shells (also set in index.html; kept here for pages served without class injection) */
html.es-route-public #workspace-section,
html.es-route-public #usage-bar-section,
html.es-route-public #team-overview-section {
  display: none !important;
}

html.es-route-workspace #marketing-sections,
html.es-route-project #marketing-sections {
  display: none !important;
}

/* Workspace shell: skeleton + loaded hero share exact dimensions */
html.es-route-workspace {
  --ws-hero-title-size: clamp(2rem, 3vw, 2.75rem);
  --ws-hero-title-line: calc(var(--ws-hero-title-size) * 1.08);
  --ws-hero-title-stack-gap: calc(0.12em * var(--ws-hero-title-size));
  --ws-hero-kicker-line: calc(0.68rem * 1.3);
  --ws-hero-title-block: calc(var(--ws-hero-title-line) * 2 + var(--ws-hero-title-stack-gap));
  --ws-hero-subtitle-block: calc(0.25rem + var(--text-lg) * 1.6);
  --ws-hero-skeleton-fill: linear-gradient(
    90deg,
    rgba(15, 23, 42, 0.06) 0%,
    rgba(15, 23, 42, 0.1) 45%,
    rgba(15, 23, 42, 0.06) 90%
  );
  --ws-hero-left-min-height: calc(
    10px + var(--ws-hero-kicker-line) + var(--ws-hero-title-block) + var(--ws-hero-subtitle-block)
  );
  --ws-hero-upload-pad-block: 3.5rem;
  --ws-hero-upload-icon: 110px;
  --ws-hero-upload-icon-gap: 24px;
  --ws-hero-upload-title-line: calc(1.5rem * 1.35);
  --ws-hero-upload-text-block: calc(
    var(--ws-hero-upload-title-line) + var(--spacing-xs) + calc(0.9375rem * 1.45) + 2px
  );
  --ws-hero-upload-border: 3px;
  --ws-hero-upload-min-height: calc(
    var(--ws-hero-upload-pad-block) * 2 + var(--ws-hero-upload-icon) + var(--ws-hero-upload-icon-gap) +
      var(--ws-hero-upload-text-block) + var(--ws-hero-upload-border)
  );
}

html.es-route-workspace.workspace-preparing .hero-section,
html.es-route-workspace body.logged-in .hero-section {
  min-height: auto;
  padding-top: clamp(88px, 12vh, 132px);
  padding-bottom: clamp(76px, 9.5vh, 104px);
}

html.es-route-workspace.workspace-preparing .hero-layout,
html.es-route-workspace body.logged-in .hero-layout {
  display: grid;
  grid-template-columns: 1fr 1.06fr;
  gap: 52px;
  align-items: center;
}

html.es-route-workspace.workspace-preparing .hero-left,
html.es-route-workspace.workspace-hero-ready .hero-left,
html.es-route-workspace body.logged-in .hero-left {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: var(--ws-hero-left-min-height);
}

html.es-route-workspace.workspace-preparing .hero-right,
html.es-route-workspace.workspace-hero-ready .hero-right,
html.es-route-workspace body.logged-in .hero-right {
  display: flex;
  flex-direction: column;
  min-height: var(--ws-hero-upload-min-height);
}

html.es-route-workspace.workspace-preparing #hero-social-proof,
html.es-route-workspace.workspace-preparing #hero-compat,
html.es-route-workspace.workspace-preparing #scroll-hint,
html.es-route-workspace.workspace-preparing #hero-upload-meta,
html.es-route-workspace.workspace-preparing .hero-title-line,
html.es-route-workspace.workspace-preparing .hero-typewriter-wrap {
  display: none !important;
}

html.es-route-workspace.workspace-preparing .hero-left {
  position: relative;
}

html.es-route-workspace.workspace-preparing .hero-right {
  position: relative;
}

html.es-route-workspace.workspace-preparing #hero-title:not(.hero-text-staged),
html.es-route-workspace.workspace-preparing #hero-subtitle:not(.hero-text-staged) {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Boot-only overlay; hidden once real hero copy is staged in document flow */
html.es-route-workspace.workspace-preparing #hero-preparing-skeleton {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0;
  pointer-events: none;
}

html.es-route-workspace.workspace-preparing .hero-left:has(#hero-title.hero-text-staged) #hero-preparing-skeleton,
html.es-route-workspace.workspace-preparing #hero-preparing-skeleton.is-dismissed,
html.es-route-workspace:not(.workspace-preparing) #hero-preparing-skeleton {
  display: none !important;
}

html.es-route-workspace.workspace-preparing .hero-preparing-skeleton__line--kicker {
  width: 108px;
  height: var(--ws-hero-kicker-line);
  border-radius: var(--radius-sm);
  margin: 0 0 10px;
}

html.es-route-workspace.workspace-preparing .hero-preparing-skeleton__title-block {
  width: min(420px, 92%);
  height: var(--ws-hero-title-block);
  margin: 0;
  border-radius: var(--radius-md);
}

html.es-route-workspace.workspace-preparing .hero-preparing-skeleton__line--subtitle {
  width: min(380px, 85%);
  height: calc(var(--text-lg) * 1.6);
  margin: 0.25rem 0 0;
}

html.es-route-workspace.workspace-preparing #hero-kicker.hero-text-staged {
  display: block !important;
  margin: 0 0 10px;
}

html.es-route-workspace.workspace-preparing #hero-title.hero-text-staged {
  position: static;
  width: auto;
  height: auto;
  margin: 0;
  padding: 0;
  overflow: visible;
  clip: auto;
  white-space: normal;
  border: 0;
  font-size: var(--ws-hero-title-size);
  line-height: 1.08;
  max-width: none;
}

html.es-route-workspace.workspace-preparing #hero-subtitle.hero-text-staged {
  position: static;
  width: auto;
  height: auto;
  margin: 0.25rem 0 0;
  padding: 0;
  overflow: visible;
  clip: auto;
  white-space: normal;
  border: 0;
  font-size: var(--text-lg);
  line-height: 1.6;
  max-width: none;
}

/* In-flow skeleton uses the same boxes as final copy (transparent text + shimmer fill) */
html.es-route-workspace.workspace-preparing:not(.workspace-hero-ready) #hero-kicker.hero-text-staged,
html.es-route-workspace.workspace-preparing:not(.workspace-hero-ready) #hero-title.hero-text-staged .hero-title-greeting,
html.es-route-workspace.workspace-preparing:not(.workspace-hero-ready) #hero-title.hero-text-staged .hero-title-accent,
html.es-route-workspace.workspace-preparing:not(.workspace-hero-ready) #hero-subtitle.hero-text-staged {
  color: transparent !important;
  -webkit-text-fill-color: transparent;
  background: var(--ws-hero-skeleton-fill);
  background-size: 200% 100%;
  animation: es-skeleton-shimmer 1.4s ease-in-out infinite;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

html.es-route-workspace.workspace-preparing:not(.workspace-hero-ready) #hero-kicker.hero-text-staged {
  border-radius: var(--radius-sm);
  width: fit-content;
}

html.es-route-workspace.workspace-preparing:not(.workspace-hero-ready) #hero-title.hero-text-staged .hero-title-greeting,
html.es-route-workspace.workspace-preparing:not(.workspace-hero-ready) #hero-title.hero-text-staged .hero-title-accent {
  border-radius: var(--radius-md);
}

html.es-route-workspace.workspace-preparing:not(.workspace-hero-ready)
  #hero-title.hero-text-staged
  .hero-title-accent.hero-title-accent--stacked {
  min-height: var(--ws-hero-title-line);
}

html.es-route-workspace.workspace-preparing:not(.workspace-hero-ready) #hero-subtitle.hero-text-staged {
  border-radius: var(--radius-base);
}

html.es-route-workspace.workspace-preparing.workspace-hero-ready #hero-kicker.hero-text-staged {
  color: var(--text-tertiary);
  background: none;
  animation: none;
  transition: color 0.22s ease, background 0.22s ease;
}

html.es-route-workspace.workspace-preparing.workspace-hero-ready #hero-title.hero-text-staged .hero-title-greeting {
  color: inherit;
  background: none;
  animation: none;
  transition: color 0.22s ease, background 0.22s ease;
}

html.es-route-workspace.workspace-preparing.workspace-hero-ready #hero-title.hero-text-staged .hero-title-accent {
  color: var(--primary-text);
  background: none;
  animation: none;
  transition: color 0.22s ease, background 0.22s ease;
}

html.es-route-workspace.workspace-preparing.workspace-hero-ready #hero-subtitle.hero-text-staged {
  color: var(--text-secondary);
  background: none;
  animation: none;
  transition: color 0.22s ease, background 0.22s ease;
}

html.es-route-workspace.workspace-preparing .hero-upload:not(.hero-upload-staged) {
  display: none !important;
}

html.es-route-workspace.workspace-preparing .hero-upload.hero-upload-staged {
  display: flex !important;
  flex: 1 1 auto;
  min-height: var(--ws-hero-upload-min-height);
  box-sizing: border-box;
  opacity: 0;
}

html.es-route-workspace.workspace-preparing.workspace-hero-ready .hero-upload.hero-upload-staged {
  opacity: 1;
  transition: opacity 0.22s ease;
}

html.es-route-workspace.workspace-preparing .hero-upload-skeleton {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: block;
  width: 100%;
  min-height: var(--ws-hero-upload-min-height);
  border-radius: var(--radius-xl);
  border: 1.5px solid rgba(99, 102, 241, 0.14);
  box-sizing: border-box;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.08), 0 1px 4px rgba(15, 23, 42, 0.04);
  pointer-events: none;
}

html.es-route-workspace.workspace-preparing .hero-upload-skeleton.is-fading {
  opacity: 0;
  transition: opacity 0.22s ease;
}

@media (prefers-reduced-motion: reduce) {
  html.es-route-workspace.workspace-preparing:not(.workspace-hero-ready) #hero-kicker.hero-text-staged,
  html.es-route-workspace.workspace-preparing:not(.workspace-hero-ready) #hero-title.hero-text-staged .hero-title-greeting,
  html.es-route-workspace.workspace-preparing:not(.workspace-hero-ready) #hero-title.hero-text-staged .hero-title-accent,
  html.es-route-workspace.workspace-preparing:not(.workspace-hero-ready) #hero-subtitle.hero-text-staged {
    animation: none;
    background: rgba(15, 23, 42, 0.08);
  }

  html.es-route-workspace.workspace-preparing .hero-upload-skeleton.is-fading,
  html.es-route-workspace.workspace-preparing.workspace-hero-ready #hero-kicker.hero-text-staged,
  html.es-route-workspace.workspace-preparing.workspace-hero-ready #hero-title.hero-text-staged .hero-title-greeting,
  html.es-route-workspace.workspace-preparing.workspace-hero-ready #hero-title.hero-text-staged .hero-title-accent,
  html.es-route-workspace.workspace-preparing.workspace-hero-ready #hero-subtitle.hero-text-staged,
  html.es-route-workspace.workspace-preparing.workspace-hero-ready .hero-upload.hero-upload-staged {
    transition: none;
  }
}

html.es-route-workspace.workspace-preparing .hero-upload-skeleton.is-dismissed,
html.es-route-workspace:not(.workspace-preparing) .hero-upload-skeleton {
  display: none !important;
}

html.es-route-workspace.workspace-preparing #workspace-section.hidden,
html.es-route-workspace.workspace-preparing #usage-bar-section.hidden {
  display: block !important;
}

html.es-route-workspace.workspace-preparing #usage-bar-section,
html.es-route-workspace body.logged-in .usage-bar-section {
  padding-bottom: 48px;
}

html.es-route-workspace.workspace-preparing #usage-bar-mount {
  display: none !important;
}

html.es-route-workspace.workspace-preparing #usage-bar-mount.usage-bar-mount--measure {
  display: block !important;
  visibility: hidden !important;
  position: absolute !important;
  left: 0;
  right: 0;
  top: 0;
  pointer-events: none;
}

html.es-route-workspace.workspace-preparing #usage-bar-mount.usage-bar-ready {
  display: block !important;
}

html.es-route-workspace.workspace-preparing #usage-bar-section-inner {
  min-height: var(--ws-usage-inner-min-height, auto);
}

html.es-route-workspace.workspace-preparing #usage-bar-preparing-skeleton.is-dismissed {
  display: none !important;
}

html.es-route-workspace.workspace-preparing #usage-bar-preparing-skeleton {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 16px 24px;
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(99, 102, 241, 0.1);
  border-left: 3px solid rgba(99, 102, 241, 0.35);
  box-sizing: border-box;
}

html.es-route-workspace.workspace-preparing .usage-bar__skeleton-label {
  width: 128px;
  height: 14px;
  flex-shrink: 0;
}

html.es-route-workspace.workspace-preparing .usage-bar__skeleton-track {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  min-width: 0;
}

html.es-route-workspace.workspace-preparing .usage-bar__skeleton-upgrade {
  width: 132px;
  height: 14px;
  flex-shrink: 0;
  margin-left: 16px;
  padding-left: 16px;
  border-left: 1px solid transparent;
  box-sizing: content-box;
}

html.es-route-workspace.workspace-preparing .usage-bar__skeleton-count {
  width: 72px;
  height: 14px;
  flex-shrink: 0;
}

html.es-route-workspace:not(.workspace-preparing) #usage-bar-preparing-skeleton {
  display: none !important;
}

@media (max-width: 960px) {
  html.es-route-workspace.workspace-preparing .hero-layout,
  html.es-route-workspace body.logged-in .hero-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

html.es-route-workspace:not(.workspace-preparing) .workspace-boot-skeleton {
  display: none !important;
}

html.es-route-workspace.workspace-preparing .workspace-tab-badge--skeleton-boot {
  display: inline-block !important;
  min-width: 1.25rem;
  height: 0.75rem;
  border-radius: 4px;
  vertical-align: middle;
  color: transparent !important;
  background: linear-gradient(
    90deg,
    rgba(15, 23, 42, 0.06) 0%,
    rgba(15, 23, 42, 0.1) 45%,
    rgba(15, 23, 42, 0.06) 90%
  );
  background-size: 200% 100%;
  animation: es-skeleton-shimmer 1.4s ease-in-out infinite;
}

html.es-route-workspace.workspace-preparing .workspace-tab-badge--skeleton-boot::before {
  display: none !important;
}

html.es-route-workspace:not(.workspace-preparing) .workspace-tab-badge--skeleton-boot:not(.workspace-tab-badge--skeleton) {
  background: none;
  animation: none;
  min-width: 0;
  height: auto;
}

html.es-route-workspace.es-session-logged-in #login-btn,
html.es-route-workspace.logged-in-early #login-btn {
  display: none !important;
}

html.es-route-workspace.es-session-logged-in #user-profile-menu.hidden,
html.es-route-workspace.logged-in-early #user-profile-menu {
  display: block !important;
}

html.es-route-workspace.es-session-logged-in #new-image-btn.hidden,
html.es-route-workspace.logged-in-early #new-image-btn {
  display: inline-flex !important;
}

/* Marketing home + workspace dashboard: hide editor stepper until a project is open */
html.es-route-public body:not(.editor-mode) .header-progress,
html.es-route-workspace body:not(.editor-mode) .header-progress {
  display: none !important;
}

@media (max-width: 900px) {
  .marketing-header-nav {
    display: none !important;
  }
}

html.es-route-public body:not(.editor-mode) .header-actions {
  margin-left: 0;
  flex-shrink: 0;
}

html.es-route-workspace body:not(.editor-mode) .header-actions,
body.workspace-dashboard .header-actions {
  margin-left: auto;
}

body.logged-in #hero-social-proof,
html.es-route-workspace #hero-social-proof {
  display: none !important;
}

html.es-route-project #hero-social-proof,
html.es-route-project #hero-compat,
html.es-route-project #hero-signup-text,
html.es-route-project #scroll-hint,
html.es-route-project #hero-upload-meta {
  display: none !important;
}

html.es-route-project .hero-typewriter-cursor {
  display: none !important;
}
