/* Lot 3: the actual projects landing section only. Nothing is inherited by
   main, other sections, detached windows or project renderers. */
/* Transparent layout parents expose the historical html/body gradients.
   Paint those actual backing layers only while the projects root is visible.
   Including its ID also beats body:has(#auth:not(.hidden)), which still matches
   after login because #auth is hidden with display:none rather than .hidden. */
html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]:has(#appContainer > main > #section-projects:not(.hidden)),
:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) body:has(#appContainer > main > #section-projects:not(.hidden)) {
  background: var(--ps-bg);
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #section-projects {
  min-width: 0;
  max-width: 100%;
  container-type: inline-size;
  overflow: hidden;
  overflow-wrap: anywhere;
  overflow-anchor: none;
  padding: 20px;
  border-radius: 9px;
  border-color: var(--ps-line);
  background: var(--ps-bg);
  box-shadow: var(--ps-shell-reflection), 0 8px 24px #0003;
  color: var(--ps-text);
  font: 400 14px/1.45 var(--ps-font-ui);
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #section-projects > h2 {
  color: var(--ps-ink);
  font: 600 21px/1.25 var(--ps-font-ui);
  margin-bottom: 10px;
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #section-projects .muted {
  color: var(--ps-muted);
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #section-projects .projects-panel {
  min-width: 0;
  max-width: 100%;
  border-radius: 9px;
  border-color: var(--ps-line);
  background: var(--ps-surface-soft);
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #section-projects .projects-panel-header {
  min-width: 0;
  padding: 12px 16px;
  border-color: var(--ps-line);
  background: var(--ps-surface-solid);
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #section-projects .projects-panel-header > div {
  min-width: 0;
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #section-projects .projects-panel-title {
  color: var(--ps-ink);
  font: 600 15px/1.3 var(--ps-font-ui);
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #section-projects .projects-panel-icon {
  background: var(--ps-bg-soft);
  color: var(--ps-gold);
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #section-projects .projects-folder-icon {
  background: var(--ps-surface-solid);
  border: 1px solid var(--ps-line-strong);
  box-shadow: var(--ps-shell-reflection);
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #section-projects .projects-folder-tab {
  background: var(--ps-gold);
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #section-projects .projects-overview-panel {
  margin-bottom: 20px;
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #section-projects .projects-overview-hero-body {
  min-width: 0;
  background: var(--ps-surface-soft);
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #section-projects .projects-hero-card {
  --hero-ui-scale: 1;
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 280px);
  gap: 20px;
  padding: 20px;
  border-radius: 9px;
  border-color: var(--ps-line);
  background: var(--ps-surface);
  box-shadow: var(--ps-shell-reflection);
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #section-projects .projects-hero-card::after,
:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #section-projects .projects-hero-illustration {
  display: none;
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #section-projects .projects-hero-left {
  position: static;
  width: auto;
  min-width: 0;
  grid-column: 1;
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #section-projects .projects-welcome-eyebrow {
  margin-bottom: 10px;
  color: var(--ps-muted);
  font-size: 10px;
  font-weight: 600;
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #section-projects .projects-welcome-eyebrow::before {
  content: "";
  display: inline-block;
  width: 16px;
  height: 1px;
  margin: 0 8px 3px 0;
  background: var(--ps-copper);
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #section-projects .projects-welcome-title {
  color: var(--ps-ink);
  font: 600 23px/1.2 var(--ps-font-ui);
  letter-spacing: -.01em;
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #section-projects .projects-welcome-subtitle {
  margin: 10px 0 18px;
  color: var(--ps-muted);
  font-size: 13px;
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #section-projects .projects-hero-actions {
  min-width: 0;
  flex-wrap: wrap;
  gap: 10px;
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #section-projects #newProjectNavBtn {
  min-width: 0;
  max-width: 100%;
  min-height: 40px;
  height: auto;
  padding: 9px 16px;
  gap: 8px;
  border: 1px solid var(--ps-button-border);
  border-radius: 4px;
  background: var(--ps-button-bg);
  color: var(--ps-button-text);
  box-shadow: var(--ps-button-shadow);
  font: 600 14px/20px var(--ps-font-ui);
  transition: background-color .2s ease, box-shadow .2s ease;
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #section-projects #newProjectNavBtn:hover:not(:disabled) {
  background: var(--ps-button-hover);
  color: var(--ps-button-text);
  box-shadow: var(--ps-button-shadow);
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #section-projects #newProjectNavBtn span {
  color: inherit;
  font-size: 18px;
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #section-projects #adminProjectsStudioSelectorHolder {
  min-width: 0;
  max-width: 100%;
  flex: 0 1 230px;
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #section-projects #adminProjectsStudioSelect {
  /* The historical selector explicitly forces a 275px minimum with !important. */
  min-width: 0 !important;
  width: 100%;
  max-width: 100%;
  height: 40px;
  padding: 8px 10px;
  border-radius: 4px;
  border-color: var(--ps-line-strong);
  background: var(--ps-surface-soft);
  color: var(--ps-text);
  color-scheme: dark;
  box-shadow: none;
  font: 400 13px/20px var(--ps-font-ui);
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #section-projects .projects-hero-stats {
  position: static;
  min-width: 0;
  grid-column: 1;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #section-projects .projects-hero-stat-card {
  min-width: 0;
  height: auto;
  padding: 12px;
  grid-template-columns: 28px minmax(0, 1fr);
  column-gap: 10px;
  border-radius: 6px;
  border-color: var(--ps-line);
  background: var(--ps-surface-soft);
  box-shadow: none;
  backdrop-filter: none;
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #section-projects .projects-hero-stat-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #section-projects .projects-hero-stat-icon svg {
  width: 22px;
  height: 22px;
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #section-projects .projects-hero-stat-value {
  min-width: 0;
  color: var(--ps-ink);
  font-size: 24px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #section-projects .projects-hero-stat-label {
  color: var(--ps-muted);
  font-size: 11px;
  font-weight: 400;
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #section-projects #projectsQuotaCard {
  position: static;
  min-width: 0;
  width: auto;
  height: auto;
  grid-column: 2;
  grid-row: 1 / span 2;
  padding: 16px;
  border-radius: 6px;
  border-color: var(--ps-line);
  background: var(--ps-surface-soft);
  box-shadow: none;
  backdrop-filter: none;
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #section-projects .projects-quota-title {
  margin-bottom: 14px;
  color: var(--ps-ink);
  font-size: 14px;
  font-weight: 600;
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #section-projects .projects-quota-content {
  min-width: 0;
  flex-wrap: wrap;
  gap: 14px;
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #section-projects .projects-quota-ring {
  width: 100px;
  height: 100px;
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #section-projects .projects-quota-ring-bg {
  stroke: var(--ps-line);
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #section-projects .projects-quota-percent {
  width: 72px;
  height: 72px;
  color: var(--ps-ink);
  border-color: var(--ps-line-strong);
  background: var(--ps-surface-solid);
  box-shadow: none;
  font-size: 21px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #section-projects .projects-quota-percent::after {
  margin-top: 4px;
  color: var(--ps-muted);
  font-size: 10px;
  font-weight: 400;
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #section-projects .projects-quota-legend {
  min-width: 0;
  color: var(--ps-muted);
  font-size: 12px;
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #section-projects .projects-quota-legend strong {
  min-width: 0;
  white-space: normal;
  color: var(--ps-text);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

@container (max-width: 760px) {
  :where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #section-projects .projects-hero-card {
    grid-template-columns: minmax(0, 1fr);
  }
  :where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #section-projects #projectsQuotaCard {
    grid-column: 1;
    grid-row: auto;
  }
}

@container (max-width: 520px) {
  :where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #section-projects .projects-hero-card {
    padding: 14px;
    gap: 14px;
  }
  :where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #section-projects .projects-hero-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@container (max-width: 260px) {
  :where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #section-projects :is(.projects-panel-header, .projects-panel-body, .projects-overview-hero-body, .projects-hero-card, .projects-hero-stat-card, #projectsQuotaCard) {
    padding: 6px;
    gap: 6px;
  }
  :where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #section-projects :is(.projects-panel-icon, .projects-hero-stat-icon, .projects-quota-ring) {
    display: none;
  }
  :where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #section-projects :is(.projects-hero-stats, .projects-hero-stat-card, .projects-quota-legend > div) {
    grid-template-columns: minmax(0, 1fr);
  }
  :where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #section-projects .projects-hero-stat-value {
    grid-column: 1;
  }
}

@media (max-width: 760px) {
  :where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #section-projects {
    padding: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  :where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #section-projects :is(#newProjectNavBtn, #projectsQuotaRing) {
    transition: none;
  }
}
