/* ==========================================================================
   FIJLY Studio — Dashboard layout and screens
   Converted from the app view of the Studio design reference.

   Breakpoints
   - Desktop: 1024px and up   sidebar visible beside content
   - Tablet:  768px – 1023px  sidebar hidden, opens as overlay
   - Mobile:  up to 767px     sidebar overlay, single-column grids
   ========================================================================== */

.studio-body {
  background: var(--surface-gray);
}

.studio-body.sidebar-is-open { overflow: hidden; }

/* Contrast fixes for small labels on light and dark surfaces. */
.studio-body :is(.preview__meta, .panel__sub, .panel__label,
  .scene__dur, .project-card__sub, .progress-row__label, .project-card__updated, .file-row__sub, .file-row__ext, .doc__meta,
  .script-scene__label, .workspace-row__sub, .setting-row__sub) {
  color: var(--text-muted);
}
.studio-body :is(.sidebar-logo__sub, .sidebar-label, .sidebar-user__email) {
  color: var(--text-lighter);
}

/* Scrollbar (from prototype) */
.studio-body ::-webkit-scrollbar { width: 10px; height: 10px; }
.studio-body ::-webkit-scrollbar-thumb {
  background: rgba(14, 17, 22, .16);
  border-radius: 99px;
  border: 3px solid transparent;
  background-clip: content-box;
}

/* Gradient fills used by thumbnails, avatars and swatches */
.bg-grad-violet { background: var(--grad-violet); }
.bg-grad-blue   { background: var(--grad-blue); }
.bg-grad-green  { background: var(--grad-green); }
.bg-grad-amber  { background: var(--grad-amber); }
.bg-grad-ink    { background: var(--grad-ink); }
.bg-grad-red    { background: var(--grad-red); }

/* Per-project accent, thumbnail and progress */
.proj--aiflow    { --accent: var(--primary);   --progress: 72%; }
.proj--clouddesk { --accent: var(--info-dark); --progress: 90%; }
.proj--taskpilot { --accent: var(--success);   --progress: 35%; }
.proj--finly     { --accent: var(--warning);   --progress: 100%; }

.proj .progress-bar__fill { background: var(--accent); }

/* ==========================================================================
   Layout
   ========================================================================== */
.studio-layout {
  display: flex;
  min-height: 100vh;
  max-width: var(--studio-max-width);
  margin: 0 auto;
  background: var(--surface-gray);
}

.studio-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.studio-content {
  flex: 1;
  padding: 28px 30px 44px;
}

/* ==========================================================================
   Sidebar
   ========================================================================== */
.sidebar {
  position: sticky;
  top: 0;
  flex: none;
  display: flex;
  flex-direction: column;
  width: var(--sidebar-width);
  height: 100vh;
  padding: 22px var(--space-md);
  overflow-y: auto;
  background: var(--surface-dark);
  color: var(--text-lighter);
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 4px 8px 22px;
  color: var(--surface-white);
}

.sidebar-header:hover {
  color: var(--surface-white);
}

.sidebar-logo__mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  background: var(--primary);
  box-shadow: 0 4px 14px rgba(91, 75, 245, .45);
}

.sidebar-logo__text {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.sidebar-logo__word {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: .14em;
  color: var(--surface-white);
}

.sidebar-logo__sub {
  margin-top: 3px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .22em;
  color: var(--text-muted);
}

.sidebar-label {
  padding: 6px 12px 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .14em;
  color: var(--sidebar-label);
}

.sidebar-nav ul {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-lighter);
  transition: all .15s;
}

.sidebar-link svg {
  flex: none;
}

.sidebar-link:hover {
  color: var(--surface-white);
  background: rgba(255, 255, 255, .04);
}

.sidebar-link[aria-current="page"] {
  color: var(--surface-white);
  background: rgba(255, 255, 255, .08);
  font-weight: 600;
}

/* Plan card */




/* User */
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: var(--space-md);
  padding: var(--space-md) 8px 2px;
  border-top: 1px solid rgba(255, 255, 255, .06);
}

.sidebar-user__meta {
  flex: 1;
  min-width: 0;
  line-height: 1.2;
}

.sidebar-user__name {
  overflow: hidden;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--sidebar-text-strong);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.sidebar-user__email {
  font-size: 11px;
  color: var(--text-muted);
}


.sidebar-close {
  display: none;
}

.sidebar-backdrop {
  display: none;
}

/* ==========================================================================
   Top bar
   ========================================================================== */
.studio-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  flex: none;
  display: flex;
  align-items: center;
  gap: var(--space-md);
  height: var(--topbar-height);
  padding: 0 26px;
  background: rgba(244, 245, 247, .85);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-default);
}

.studio-topbar__menu,
.studio-topbar__title {
  display: none;
}

.studio-topbar__title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  font-size: 16px;
  font-weight: 800;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.search {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: 380px;
  height: 38px;
  padding: 0 14px;
  background: var(--surface-white);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  color: var(--text-light);
}

.search input {
  flex: 1;
  min-width: 0;
  padding: 0;
  border: none;
  background: none;
  font-size: 13px;
  color: var(--text-primary);
}

.search input::placeholder {
  color: var(--text-placeholder);
}

.search input:focus {
  outline: none;
}

.search:focus-within {
  border-color: var(--primary);
}


.studio-topbar .btn-outline {
  color: var(--text-primary);
}

/* ==========================================================================
   Shared screen pieces
   ========================================================================== */
.screen[hidden] {
  display: none;
}

.page-head {
  margin-bottom: 22px;
}

.page-head--row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-md);
}

.page-head--overview {
  gap: 20px;
  margin-bottom: var(--space-lg);
}

.page-head--analytics {
  margin-bottom: var(--space-lg);
}

.page-head h1 {
  font-size: 26px;
  line-height: normal;
  letter-spacing: -.02em;
}

.page-head--overview h1 {
  font-size: 27px;
}

.page-head p {
  margin-top: 7px;
  font-size: 15px;
  color: var(--text-muted);
}

.page-head__date {
  margin-bottom: 7px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--primary);
}

.page-head .btn-outline {
  height: 40px;
  padding: 0 var(--space-md);
  gap: var(--space-sm);
}

/* White panel */
.panel {
  padding: 20px;
  background: var(--surface-white);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
}

.panel--flush {
  padding: 0;
  overflow: hidden;
}

:where(.panel) h2,
:where(.panel) h3,
.list-title {
  font-size: 15px;
  line-height: normal;
  letter-spacing: normal;
}

.panel__sub {
  margin-top: 2px;
  font-size: 12px;
  color: var(--text-light);
}

.panel__label {
  margin-bottom: 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-lightest);
}


/* ==========================================================================
   1. Overview
   ========================================================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-md);
  margin-bottom: 26px;
}

.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.62fr) minmax(0, 1fr);
  gap: 20px;
  margin-bottom: 26px;
}

/* Preview panel */
.preview {
  overflow: hidden;
  background: var(--surface-white);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
}

.preview__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--border-light);
}

.preview__id {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.preview__icon {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: var(--surface-dark);
}

.preview__title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: normal;
  line-height: normal;
}

.preview__meta {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-light);
}

/* Storyboard */
.storyboard {
  display: flex;
  flex-direction: column;
  padding: 19px 20px;
  border-radius: var(--radius-card);
}

.storyboard__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 15px;
}

.storyboard__head h2 {
  font-size: 16px;
}

.version-pill {
  padding: 5px 10px;
  border-radius: var(--radius-full);
  background: var(--primary-tint);
  color: var(--primary);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
}

.scene-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.scene {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 9px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
}

.scene:hover {
  border-color: var(--border-hover-soft);
  background: var(--surface-hover);
}

.scene__thumb {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 40px;
  overflow: hidden;
  border-radius: var(--radius-sm);
  color: rgba(255, 255, 255, .85);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
}

.scene__body {
  flex: 1;
  min-width: 0;
}

.scene__title {
  font-size: 13px;
  font-weight: 700;
}

.scene__dur {
  margin-top: 2px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-light);
}



/* Active projects cards */
.section-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 15px;
}

.section-bar h2 {
  font-size: 17px;
  line-height: normal;
  letter-spacing: normal;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-md);
}

.project-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--surface-white);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xs);
  transition: box-shadow .18s, transform .18s;
}

.project-card:hover {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-2px);
}

.project-card__media {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  height: auto;
  padding: 0;
  gap: 0;
}

.media-tag {
  padding: 4px 9px;
  border-radius: var(--radius-full);
  background: rgba(0, 0, 0, .22);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  color: rgba(255, 255, 255, .92);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
}










.project-card__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 14px 15px var(--space-md);
}

.project-card__name {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: normal;
}

.project-card__sub {
  margin-top: 3px;
  font-size: 12px;
  color: var(--text-light);
}

.project-card__badges {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin: 14px 0 9px;
}

.progress-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 11px;
}

.progress-row__label {
  font-weight: 600;
  color: var(--text-light);
}

.progress-row__value {
  font-family: var(--font-mono);
  font-weight: 700;
}

.project-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 15px;
  padding-top: 13px;
  border-top: 1px solid var(--surface-chip);
}

.project-card__updated {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-lightest);
}

.project-card__foot .btn-link {
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
}

/* ==========================================================================
   2. Projects (table)
   ========================================================================== */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.projects-table {
  min-width: 800px;
}

.projects-table th {
  padding: 14px 7px;
  background: var(--surface-hover);
}

.projects-table td {
  padding: 15px 7px;
}

.projects-table th:first-child,
.projects-table td:first-child { padding-left: 18px; }

.projects-table th:last-child,
.projects-table td:last-child { padding-right: 18px; text-align: right; }

.projects-table col:nth-child(1) { width: 33.3%; }
.projects-table col:nth-child(2) { width: 16.7%; }
.projects-table col:nth-child(3) { width: 13.9%; }
.projects-table col:nth-child(4) { width: 22.2%; }
.projects-table col:nth-child(5) { width: 13.9%; }

.cell-project {
  display: flex;
  align-items: center;
  gap: 12px;
}










/* ==========================================================================
   3. Video requests
   ========================================================================== */
.requests-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}



.form-group {
  margin-bottom: 18px;
  padding: 0;
  border: none;
}

.form-group legend {
  margin-bottom: 9px;
  padding: 0;
}


.form-row {
  display: flex;
  gap: 14px;
  margin-bottom: 22px;
}

.form-row > div {
  flex: 1;
  min-width: 0;
}




.stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.list-card {
  padding: 15px var(--space-md);
  background: var(--surface-white);
  border: 1px solid var(--border-default);
  border-radius: 13px;
  box-shadow: var(--shadow-xs);
}


.list-card__title {
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: normal;
  line-height: normal;
}


/* ==========================================================================
   4. Brand assets
   ========================================================================== */























.shot {
  position: relative;
  aspect-ratio: auto;
  overflow: hidden;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-default);
  height: auto;
  background: var(--surface-light);
}

.shot::before,
.shot::after {
  content: none;
  position: absolute;
  left: 8px;
}

.shot::before {
  top: 8px;
  right: 8px;
  height: 5px;
  border-radius: 9px;
  background: rgba(255, 255, 255, .6);
}

.shot::after {
  bottom: 8px;
  width: 40%;
  height: 16px;
  border-radius: 5px;
  background: rgba(255, 255, 255, .75);
}

.file-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px;
  border: 1px solid var(--border-light);
  border-radius: 11px;
}

.file-row__icon {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: var(--primary-tint);
  color: var(--primary);
}

.file-row__icon--success {
  background: var(--success-tint);
  color: var(--success-dark);
}

.file-row__body {
  flex: 1;
  min-width: 0;
}

.file-row__title {
  display: block;
  font-size: 13px;
  font-weight: 700;
}

.file-row__sub {
  font-size: 11px;
  color: var(--text-light);
}

.file-row__ext {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-lightest);
}

.file-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ==========================================================================
   5. Scripts
   ========================================================================== */
.scripts-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.doc__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: var(--space-md) 20px;
  border-bottom: 1px solid var(--border-light);
}

.doc__title {
  font-size: 14.5px;
  font-weight: 700;
}

.doc__meta {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-light);
}

.doc__head .badge {
  padding: 5px 11px;
  font-size: 11px;
}

.doc__body {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px;
}

.script-scene {
  display: flex;
  gap: 14px;
}

.script-scene__no {
  padding-top: 2px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 800;
  color: var(--primary);
}

.script-scene__label {
  margin-bottom: 5px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-lightest);
}

.script-scene__text {
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--surface-dark-hover);
}



.comment {
  padding: 15px;
  background: var(--surface-white);
  border: 1px solid var(--border-default);
  border-radius: 13px;
  box-shadow: var(--shadow-xs);
}


.comment__name {
  font-size: 12.5px;
  font-weight: 700;
}


.comment__text {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-muted);
}

/* ==========================================================================
   6. Analytics
   ========================================================================== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.charts-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
  gap: 18px;
  margin-bottom: 18px;
}

.chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 0;
}

.legend {
  display: flex;
  gap: 14px;
  font-size: 11.5px;
  font-weight: 600;
}

.legend span {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
}


.funnel {
  display: flex;
  flex-direction: column;
}

.funnel h2 {
  margin-bottom: 4px;
}

.funnel .panel__sub {
  margin-top: 0;
}


.funnel__list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  font-size: 12.5px;
}

.funnel__list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.funnel__label {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-weight: 600;
  color: var(--text-muted);
}

.funnel__value {
  font-family: var(--font-mono);
  font-weight: 700;
}

.top-videos h2 {
  margin-bottom: 4px;
}

.top-videos .panel__sub {
  margin: 0 0 14px;
}







/* ==========================================================================
   7. Team
   ========================================================================== */





/* ==========================================================================
   8. Settings
   ========================================================================== */
.settings {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  max-width: 720px;
}

.settings .panel {
  padding: 22px;
}

.settings h2 {
  margin-bottom: var(--space-md);
}

.workspace-row {
  display: flex;
  align-items: center;
  gap: 15px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border-light);
}

.workspace-logo {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 13px;
  background: var(--surface-dark);
  color: var(--surface-white);
  font-size: 19px;
  font-weight: 800;
}

.workspace-row__name {
  font-size: 14.5px;
  font-weight: 700;
}

.workspace-row__sub {
  font-size: 12.5px;
  color: var(--text-light);
}

.workspace-row .btn {
  height: 36px;
  margin-left: auto;
  padding: 0 14px;
  border-radius: 9px;
  font-size: 12.5px;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
}

.setting-row:last-child {
  border-bottom: none;
}

.setting-row__title {
  display: block;
  font-size: 13.5px;
  font-weight: 700;
}

.setting-row__sub {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: var(--text-light);
}

.defaults-row {
  display: flex;
  gap: var(--space-md);
}

.defaults-row > div {
  flex: 1;
  min-width: 0;
}




/* ==========================================================================
   Responsive
   ========================================================================== */

/* Narrow desktop: 1024px – 1279px */
@media (max-width: 1279px) {
  .overview-grid,
  .charts-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .kpi-grid{
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Tablet and below: sidebar becomes an overlay */
@media (max-width: 1023px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 50;
    height: auto;
    transform: translateX(-100%);
    visibility: hidden;
    transition: transform .25s ease, visibility 0s linear .25s;
  }

  .studio-layout.sidebar-open .sidebar {
    transform: none;
    visibility: visible;
    transition: transform .25s ease, visibility 0s;
  }

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 45;
    display: block;
    background: rgba(12, 14, 19, .5);
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease;
  }

  .studio-layout.sidebar-open .sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .sidebar-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin-left: auto;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: var(--radius-sm);
    background: none;
    color: var(--text-lighter);
  }

  .studio-topbar__menu {
    display: flex;
  }

  .studio-topbar__title {
    display: block;
  }

  .search {
    max-width: 260px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .requests-grid,
  .scripts-grid{
    grid-template-columns: minmax(0, 1fr);
  }

  
  }

/* Mobile: up to 767px */
@media (max-width: 767px) {
  .studio-topbar {
    gap: 10px;
    padding: 0 var(--space-md);
  }

  .search{
    display: none;
  }

  .studio-content {
    padding: 20px var(--space-md) 32px;
  }

  .page-head h1,
  .page-head--overview h1 {
    font-size: 23px;
  }

  .page-head p {
    font-size: 14px;
  }

  .stats-grid,
  .project-grid,
  .kpi-grid{
    grid-template-columns: minmax(0, 1fr);
  }

  .preview__head {
    flex-wrap: wrap;
  }

  .form-row,
  .defaults-row {
    flex-direction: column;
  }

  .chart-head {
    flex-wrap: wrap;
  }

  .workspace-row {
    flex-wrap: wrap;
  }
}

@media (max-width: 479px) {
  .studio-topbar .btn-primary .btn__label {
    display: none;
  }

  .studio-topbar .btn-primary {
    width: 38px;
    padding: 0;
  }
}

/* Sample workspace context and purpose-designed production stills. */
.studio-demo-note { padding: 12px 30px; background: var(--primary-tint); border-bottom: 1px solid var(--border-default); color: var(--text-muted); font-size: 12px; line-height: 1.6; }
.studio-demo-note a { display: inline-block; font-weight: 700; margin-left: 8px; }

.project-card__media .media-tag { margin: 10px 12px 0; font-size: 9px; }
.project-concept { width: 100%; height: auto; }


.table-hint { display: none; color: var(--text-muted); font-size: 12px; line-height: 1.6; padding: 12px 16px; border-bottom: 1px solid var(--border-light); }
@media (max-width: 1120px) { .table-hint { display: block; } }
@media (max-width: 900px) { .search { display: none; } }

.shot img { width: 100%; height: auto; }
.shot figcaption { padding: 10px; font-size: 11px; font-weight: 600; }

@media (max-width: 767px) {
  .studio-demo-note { padding: 10px 16px; font-size: 11px; }
  .studio-demo-note a { margin-left: 0; }
  .stats-grid, .kpi-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
  .stat-card { padding: 16px 12px; }
  .stat-card__head { gap: 6px; align-items: flex-start; }
  .stat-card__label { font-size: 11px; }
  .stat-card__icon { width: 24px; height: 24px; flex: none; }
  .stat-card__value { font-size: 27px; }
  .stat-card__delta { font-size: 10px; line-height: 1.5; }
  .kpi-grid .stat-card:last-child { grid-column: 1 / -1; }
    }

/* ==========================================================================
   Typography and hierarchy — both portals
   One scale from variables.css (--text-*, --weight-*, --leading-*).
   Content rules are scoped to `.studio-body .studio-layout` so they outrank the
   shell rules in studio-polish.css (loaded last) and never reach the marketing
   page, which shares components.css. Form controls use `.studio-body` alone so
   the existing 16px mobile input rules in later files keep winning.
   Dialogs sit outside the layout; their scale lives in admin.css.
   ========================================================================== */

/* Page title, description and eyebrow ------------------------------------- */
.studio-body .studio-layout .page-head h1 {
  font-size: var(--text-page-title);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  letter-spacing: -.025em;
  color: var(--text-primary);
}

.studio-body .studio-layout .page-head p {
  margin-top: var(--space-sm);
  font-size: var(--text-body);
  font-weight: var(--weight-normal);
  line-height: var(--leading-normal);
  color: var(--text-muted);
}

.studio-body .studio-layout .page-head__date {
  margin-bottom: var(--space-sm);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: .06em;
}

/* Section headings -------------------------------------------------------- */
.studio-body .studio-layout :is(.panel > h2:not(.panel__label), .admin-panel-head h2,
  .chart-head h2, .section-bar > h2, .storyboard__head h2, h2.panel__title, h2.list-title) {
  font-size: var(--text-section-heading);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  letter-spacing: -.015em;
  color: var(--text-primary);
}

.studio-body .studio-layout .panel__sub {
  margin-top: var(--space-xs);
}

.studio-body .studio-layout .panel__label {
  margin-bottom: var(--space-md);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: .06em;
  color: var(--text-muted);
}

/* Card titles and row titles ---------------------------------------------- */
.studio-body .studio-layout :is(.project-card__name, .preview__title, .doc__title,
  .list-card__title, .workspace-row__name) {
  font-size: var(--text-card-title);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-tight);
  letter-spacing: normal;
  color: var(--text-primary);
}

.studio-body .studio-layout :is(.scene__title, .setting-row__title, .file-row__title,
  .comment__name) {
  font-size: var(--text-body);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-tight);
  color: var(--text-primary);
}

/* Body copy --------------------------------------------------------------- */
.studio-body .studio-layout :is(.script-scene__text, .comment__text) {
  font-size: var(--text-body);
  font-weight: var(--weight-normal);
  line-height: var(--leading-relaxed);
  color: var(--text-muted);
}

/* Metadata: dates, sub-lines, secondary facts. Sans with tabular figures reads
   cleaner than mono at this size; numbers and eyebrows stay mono. */
.studio-body .studio-layout :is(.panel__sub, .project-card__sub, .project-card__updated,
  .preview__meta, .doc__meta, .scene__dur, .file-row__sub, .file-row__ext, .setting-row__sub, .workspace-row__sub, .progress-row, .legend, .funnel__list,
  .table-hint, .shot figcaption) {
  font-family: var(--font-body);
  font-size: var(--text-meta);
  font-weight: var(--weight-normal);
  font-variant-numeric: tabular-nums;
  line-height: var(--leading-normal);
  color: var(--text-light);
}

.studio-body .studio-layout :is(.progress-row__label, .funnel__label, .legend span) {
  font-weight: var(--weight-medium);
  color: var(--text-muted);
}

.studio-body .studio-layout :is(.progress-row__value, .funnel__value) {
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
}

.studio-body .studio-layout .progress-row__value {
  font-family: var(--font-body);
}

.studio-body .studio-layout .project-card__foot {
  flex-wrap: wrap;
  gap: var(--space-xs) var(--space-sm);
}

.studio-body .studio-layout .project-card__foot .btn-link {
  white-space: nowrap;
}

/* A section heading with no subtitle still needs air before its content. */
.studio-body .studio-layout .panel > h2:not(.panel__label) + :is(ul, ol) {
  margin-top: var(--space-md);
}

/* KPI cards --------------------------------------------------------------- */
.studio-body .studio-layout .stat-card {
  padding: var(--space-lg);
  border-radius: var(--radius-xl);
}

.studio-body .studio-layout .stat-card__label {
  font-size: var(--text-meta);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-tight);
  letter-spacing: normal;
  color: var(--text-primary);
}

.studio-body .studio-layout .stat-card__value {
  margin-top: var(--space-md);
  font-family: var(--font-mono);
  font-size: var(--text-kpi);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  letter-spacing: -.02em;
  color: var(--text-primary);
}

.studio-body .studio-layout .stat-card__unit {
  font-size: var(--text-body);
  font-weight: var(--weight-semibold);
  color: var(--text-muted);
}

/* Every delta is a description; the green on "--muted" deltas was a cascade slip. */
.studio-body .studio-layout .stat-card__delta {
  margin-top: var(--space-sm);
  font-size: var(--text-meta);
  font-weight: var(--weight-normal);
  line-height: var(--leading-normal);
  color: var(--text-muted);
}

/* Tables ------------------------------------------------------------------ */
.studio-body .studio-layout .table th {
  font-family: var(--font-body);
  font-size: var(--text-small);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-normal);
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--text-light);
}

.studio-body .studio-layout .table td,
.studio-body .studio-layout .table .num {
  font-size: var(--text-meta);
  font-weight: var(--weight-normal);
  line-height: var(--leading-normal);
  color: var(--text-muted);
}

/* Row primary text: the first cell, its title link and row headers. */
.studio-body .studio-layout .table td:first-child,
.studio-body .studio-layout .table tbody th {
  font-family: var(--font-body);
  font-size: var(--text-body);
  font-weight: var(--weight-semibold);
  letter-spacing: normal;
  text-transform: none;
  color: var(--text-primary);
}

.studio-body .studio-layout .table td:first-child .btn-link:first-of-type {
  font-size: var(--text-body);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
}

.studio-body .studio-layout .table td:first-child .btn-link:first-of-type:hover {
  color: var(--primary);
}

.studio-body .studio-layout .projects-table td:first-child > .btn {
  max-width: 100%;
  justify-content: flex-start;
  font-size: var(--text-body);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-tight);
  white-space: normal;
  text-align: left;
}

.studio-body .studio-layout .table .badge {
  white-space: nowrap;
}

/* Wider status column for the larger badges. */
.studio-body .studio-layout .projects-table col:nth-child(1) { width: 32%; }
.studio-body .studio-layout .projects-table col:nth-child(2) { width: 15%; }
.studio-body .studio-layout .projects-table col:nth-child(3) { width: 18%; }
.studio-body .studio-layout .projects-table col:nth-child(4) { width: 19%; }
.studio-body .studio-layout .projects-table col:nth-child(5) { width: 16%; }

/* Buttons ----------------------------------------------------------------- */
.studio-body .studio-layout .btn {
  font-size: var(--text-body);
  font-weight: var(--weight-medium);
}

.studio-body .studio-layout :is(.btn-primary, .btn-success, .btn-danger) {
  font-weight: var(--weight-semibold);
}

.studio-body .studio-layout .page-head .btn {
  font-size: var(--text-body);
}

/* Small buttons: topbar, cards, tables and compact rows. */
.studio-body .studio-layout :is(.btn--xs, .btn--sm, .studio-topbar .btn, .table .btn,
  .project-card .btn, .list-card .btn, .file-row .btn, .workspace-row .btn,
  .profile-reference .btn, .table-empty-state .btn) {
  font-size: var(--text-meta);
  font-weight: var(--weight-semibold);
}

.studio-body .studio-layout :is(.btn-link) {
  font-size: var(--text-meta);
  font-weight: var(--weight-semibold);
}

.studio-body .studio-layout :is(.filter-chip) {
  font-size: var(--text-meta);
  font-weight: var(--weight-semibold);
}


/* Badges and pills: status text is content, never below --text-xs. */
.studio-body .studio-layout :is(.badge, .version-pill, .media-tag) {
  font-size: var(--text-xs);
}

/* Form controls ------------------------------------------------------------ */
.studio-body .field-label {
  font-size: var(--text-meta);
  font-weight: var(--weight-semibold);
  color: var(--text-muted);
}

.studio-body .input {
  font-size: var(--text-body);
}

.studio-body .search input {
  font-size: var(--text-meta);
}

.studio-body .script-scene__label {
  font-size: var(--text-small);
  letter-spacing: .04em;
}

/* Phones: 16px is the platform threshold below which iOS zooms focused fields. */
@media (max-width: 767px) {
  .studio-body .input {
    font-size: 16px;
  }
}

/* Sidebar ------------------------------------------------------------------ */
.studio-body .studio-layout .sidebar-link {
  font-size: var(--text-body);
  font-weight: var(--weight-medium);
}

.studio-body .studio-layout .sidebar-link[aria-current="page"] {
  font-weight: var(--weight-semibold);
}

.studio-body .studio-layout :is(.sidebar-label, .sidebar-profile-label) {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: .06em;
  text-transform: uppercase;
}

.studio-body .studio-layout .sidebar-user__name {
  font-size: var(--text-body);
  font-weight: var(--weight-semibold);
}

/* Role line: --text-light fails on the dark sidebar, so the dark-surface
   tertiary token is kept (7.42:1). */
.studio-body .studio-layout .sidebar-user__email {
  font-size: var(--text-small);
  color: var(--text-lighter);
}

.studio-body .studio-layout .sidebar-badge {
  min-width: 20px;
  height: 20px;
  font-size: var(--text-xs);
}

/* Top bar ------------------------------------------------------------------ */
.studio-body .studio-layout .studio-topbar__title {
  font-size: var(--text-small);
  font-weight: var(--weight-semibold);
  letter-spacing: .08em;
}

/* Card spacing ------------------------------------------------------------- */
.studio-body .studio-layout :is(.panel:not(.panel--flush), .list-card, .comment) {
  padding: var(--space-lg);
}

.studio-body .studio-layout :is(.preview__head, .doc__head) {
  padding: var(--space-md) var(--space-lg);
}

.studio-body .studio-layout :is(.doc__body, .project-card__body) {
  padding: var(--space-lg);
}

.studio-body .studio-layout .file-row {
  padding: var(--space-md);
}

.studio-body .studio-layout .scene {
  padding: var(--space-sm);
}

/* Large dashboard cards */
@media (min-width: 1024px) {
  .studio-body .studio-layout .storyboard {
    padding: var(--space-xl);
  }
}

@media (max-width: 767px) {
  .studio-body .studio-layout .page-head__date,
  .studio-body .studio-layout .studio-topbar__title {
    font-size: var(--text-xs);
    letter-spacing: .04em;
  }

  .studio-body .studio-layout :is(.panel:not(.panel--flush), .list-card, .comment,
    .stat-card, .doc__body, .project-card__body, .preview__head, .doc__head) {
    padding: var(--space-md);
  }

  .studio-body .studio-layout .stat-card__value {
    margin-top: var(--space-sm);
  }
}


/* ==========================================================================
   Workspace shell polish (was css/studio-polish.css, removed)
   Appended last and in its original order, so it still overrides everything
   above it in this file. Production components retain their layouts.
   ========================================================================== */
.studio-body { --shell-space:28px; }
.studio-body .sidebar { height:100dvh; overflow:hidden; padding:20px 16px 16px; }
.sidebar-header { flex:none; padding:4px 8px 22px; }
.sidebar-home { display:flex; align-items:center; gap:11px; border-radius:10px; padding:4px; margin:-4px; cursor:pointer; transition:background-color .15s; }
.sidebar-home:hover { background:rgba(255,255,255,.08); }
.sidebar-home:focus-visible,.sidebar-user:focus-visible,.sidebar-signout:focus-visible { outline:2px solid #b8b0ff; outline-offset:4px; }
.sidebar > .sidebar-label{ flex:none; }
.sidebar-nav { flex:1 1 auto; min-height:0; overflow-y:auto; padding:2px 0 12px; }
.sidebar-footer { flex:none; margin-top:auto; padding-top:16px; border-top:1px solid rgba(255,255,255,.12); background:var(--surface-dark); }
.sidebar-profile-label { padding:0 12px 8px; color:var(--text-lighter); font:600 10px var(--font-mono); letter-spacing:.12em; }
.sidebar-user { width:100%; margin:0; padding:12px; border:0; border-radius:12px; background:none; color:var(--text-lighter); text-align:left; cursor:pointer; transition:background-color .15s; }
.sidebar-user:hover { background:rgba(255,255,255,.08); }
.sidebar-user:disabled { cursor:default; }
.sidebar-user__meta,.sidebar-user__name,.sidebar-user__email { display:block; }
.sidebar-user__name { font-size:13px; line-height:1.4; }
.sidebar-user__email { margin-top:3px; line-height:1.4; }
.sidebar-user .avatar,.profile-reference .avatar { flex:none; width:36px; height:36px; }
.sidebar-signout { display:flex; align-items:center; gap:var(--space-sm); width:100%; margin-top:var(--space-xs); padding:var(--space-sm) 12px; border:0; border-radius:var(--radius-md); background:none; color:var(--text-lighter); font:var(--weight-medium) var(--text-meta) var(--font-body); text-align:left; cursor:pointer; transition:background-color .15s,color .15s; }
.sidebar-signout svg { flex:none; }
.sidebar-signout:hover { background:rgba(255,255,255,.08); color:var(--surface-white); }
.sidebar-signout:disabled { cursor:progress; }
.sidebar-user .avatar img,.profile-avatar img,.profile-reference .avatar img { width:100%; height:100%; object-fit:cover; border-radius:inherit; }
.studio-body .studio-topbar { min-height:72px; height:auto; padding:14px var(--shell-space); gap:12px; }
.studio-body .studio-topbar__title { display:block; flex:1; color:var(--text-muted); font:600 12px var(--font-mono); letter-spacing:.1em; white-space:normal; overflow:visible; }
.studio-body .studio-topbar .btn { flex:none; height:40px; min-height:40px; border-radius:10px; font-size:13px; padding-inline:16px; }
.studio-body .studio-topbar__menu { flex:none; width:40px; height:40px; }
.studio-body .studio-demo-note.visually-hidden { padding:0; border:0; }
.studio-body .studio-content { padding:28px var(--shell-space) 40px; }
.studio-body .page-head { margin:0 0 28px; }
.studio-body .page-head h1 { margin:0; font-size:32px; font-weight:750; line-height:1.2; letter-spacing:-.025em; color:var(--text-primary); overflow-wrap:anywhere; }
.studio-body .page-head p { margin-top:10px; font-size:15.5px; line-height:1.55; color:var(--text-muted); }
.studio-body .page-head__date { margin-bottom:10px; font-size:11px; }
.studio-body .table th { font:600 10px var(--font-mono); letter-spacing:.07em; color:var(--text-muted); }
.studio-body .btn { border-radius:10px; font-family:var(--font-body); font-weight:600; }
.studio-body .page-head .btn { height:40px; font-size:13px; }
.studio-body .btn--md { min-height:44px; height:auto; padding-block:11px; font-size:14px; }
.profile-reference { display:flex; align-items:center; flex-wrap:wrap; gap:12px; padding:16px 0; margin-bottom:12px; border-bottom:1px solid var(--border-light); }
.profile-reference[hidden] { display:none; }
.profile-reference > div { flex:1; min-width:120px; overflow-wrap:anywhere; }
.profile-reference [data-profile-name] { font-size:14px; font-weight:600; }
.profile-reference .btn { font-size:12px; }
.profile-dialog { width:min(560px,calc(100% - 32px)); }
.profile-intro { display:flex; align-items:center; gap:16px; margin-bottom:24px; }
.profile-avatar { width:64px; height:64px; flex:none; font-size:24px; }
#profile-display-name { font-size:18px; font-weight:700; overflow-wrap:anywhere; }
.profile-fields .form-group + .form-group { margin-top:20px; }
.profile-fields .input { margin-top:8px; }
.profile-photo { margin-bottom:24px; }
.profile-photo h3 { margin:0 0 12px; font-size:14px; }
.profile-photo-actions { display:flex; flex-wrap:wrap; gap:8px; }
.profile-readonly { display:grid; grid-template-columns:minmax(0,1.5fr) minmax(0,1fr); gap:16px; margin-top:20px; }
.profile-readonly .form-group + .form-group { margin-top:0; }
.profile-readonly .input { background:var(--surface-gray); color:var(--text-muted); }
#profile-status { margin-top:20px; margin-bottom:0; }
.profile-fields .workflow-error:empty { display:none; }
@media(max-width:767px) {
  .studio-body { --shell-space:16px; }
  .studio-body .studio-topbar { gap:8px; }
  .studio-body .studio-topbar .btn { padding-inline:10px; font-size:12px; }
  .studio-body .studio-topbar__title { font-size:11px; letter-spacing:.04em; }
  .studio-body .page-head--row { gap:20px; }
  .profile-reference > .btn { margin-left:48px; }
  .profile-readonly { grid-template-columns:minmax(0,1fr); }
  .profile-dialog .admin-dialog-head,.profile-dialog .admin-dialog-fields { padding:20px; }
  .profile-dialog .admin-dialog-foot { padding:16px 20px; flex-wrap:wrap; }
  .profile-dialog .input { font-size:16px; }
}
@media(max-width:479px) {
  .studio-body .studio-topbar .btn-primary { width:40px; padding:0; }
  .profile-dialog .admin-dialog-foot .btn { flex:1; }
}
@media(prefers-reduced-motion:reduce) { .sidebar-home,.sidebar-user { transition:none; } }
