:root {
  --bg: #f4f3ef;
  --bg-deep: #ece9e0;
  --surface: rgba(255, 255, 255, 0.82);
  --surface-strong: rgba(255, 255, 255, 0.94);
  --surface-soft: rgba(255, 255, 255, 0.62);
  --surface-inverse: #121622;
  --line: rgba(18, 22, 34, 0.08);
  --line-strong: rgba(18, 22, 34, 0.14);
  --text: #10141f;
  --text-soft: #5f6574;
  --text-faint: #8a91a1;
  --primary: #2f3bff;
  --primary-strong: #1924c8;
  --primary-soft: rgba(47, 59, 255, 0.1);
  --amber: #c57b2b;
  --amber-soft: rgba(197, 123, 43, 0.12);
  --success: #1b8c57;
  --success-soft: rgba(27, 140, 87, 0.12);
  --danger: #cf415d;
  --danger-soft: rgba(207, 65, 93, 0.12);
  --shadow-lg: 0 30px 60px rgba(16, 20, 31, 0.08);
  --shadow-md: 0 18px 36px rgba(16, 20, 31, 0.06);
  --radius-2xl: 30px;
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --ease: 180ms ease;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

html {
  background:
    radial-gradient(circle at 0 0, rgba(47, 59, 255, 0.1), transparent 28%),
    radial-gradient(circle at 100% 0, rgba(197, 123, 43, 0.12), transparent 22%),
    linear-gradient(180deg, #f9f8f4, #f1efe8 52%, #ece8df);
  color: var(--text);
  font-family: "Inter", sans-serif;
  line-height: 1.45;
}

body {
  overflow-x: hidden;
  overflow-y: auto;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.58), transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), transparent 36%);
  pointer-events: none;
}

img {
  display: block;
  width: 100%;
}

video {
  display: block;
  width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  padding: 0;
  background: none;
  color: inherit;
  cursor: pointer;
}

input,
select,
textarea {
  color: inherit;
}

textarea {
  resize: vertical;
}

::selection {
  background: rgba(47, 59, 255, 0.14);
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: rgba(18, 22, 34, 0.16);
  background-clip: padding-box;
}

.material-symbols-outlined {
  font-family: "Material Symbols Outlined";
  font-style: normal;
  font-weight: 500;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  font-variation-settings: "FILL" 0, "wght" 450, "GRAD" 0, "opsz" 24;
}

.app-shell {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  min-height: 100svh;
  align-items: start;
  position: relative;
  z-index: 1;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 24px 20px;
  position: sticky;
  top: 0;
  max-height: 100svh;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.56));
  backdrop-filter: blur(18px);
  border-right: 1px solid rgba(18, 22, 34, 0.06);
  overflow-y: auto;
}

.brand-card,
.current-project-card,
.panel,
.topbar,
.selection-bar,
.metric-card,
.project-card,
.queue-card,
.helper-card,
.info-card,
.asset-card,
.asset-row,
.project-chip,
.style-card,
.template-card,
.layer-row,
.toast,
.dropzone {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(16px);
}

.brand-card,
.current-project-card,
.panel,
.selection-bar,
.metric-card,
.project-card,
.queue-card,
.helper-card,
.info-card,
.asset-card,
.style-card,
.template-card,
.toast {
  border-radius: var(--radius-xl);
}

.brand-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
  background:
    linear-gradient(180deg, rgba(17, 21, 32, 0.96), rgba(27, 32, 48, 0.9)),
    linear-gradient(135deg, rgba(47, 59, 255, 0.28), transparent 48%);
  color: rgba(255, 255, 255, 0.96);
  border-color: rgba(255, 255, 255, 0.06);
  box-shadow: 0 24px 50px rgba(18, 22, 34, 0.22);
}

.brand-mark,
.eyebrow,
.nav-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.brand-mark {
  width: fit-content;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.86);
}

.brand-card h1,
.hero-copy h2,
.panel-header h3,
.current-project-card h3,
.hero-project-card h3 {
  margin: 0;
  font-family: "Space Grotesk", "Inter", sans-serif;
  letter-spacing: -0.04em;
}

.brand-card h1 {
  font-size: clamp(28px, 3vw, 34px);
  line-height: 0.95;
}

.brand-card p,
.current-project-card p,
.hero-copy p,
.panel-header p,
.project-copy p,
.queue-card p,
.asset-copy p,
.detail-row span,
.info-card span,
.helper-card span,
.style-card span,
.template-card span,
.source-row span,
.field span,
.timeline-label span,
.overlay-meta span,
.script-line,
.prompt-line,
.stage-caption p {
  margin: 0;
  color: var(--text-soft);
}

.nav-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nav-label {
  color: var(--text-faint);
  padding: 0 6px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 52px;
  padding: 0 16px;
  border-radius: 16px;
  color: var(--text-soft);
  transition:
    transform var(--ease),
    background-color var(--ease),
    color var(--ease),
    border-color var(--ease),
    box-shadow var(--ease);
}

.nav-link:hover {
  transform: translateX(4px);
  background: rgba(255, 255, 255, 0.62);
  color: var(--text);
}

.nav-link.is-active {
  background: var(--surface-strong);
  color: var(--primary);
  border: 1px solid rgba(47, 59, 255, 0.12);
  box-shadow: inset 0 0 0 1px rgba(47, 59, 255, 0.06), var(--shadow-md);
}

.nav-link span:last-child {
  font-size: 14px;
  font-weight: 600;
}

.current-project-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: auto;
  padding: 18px;
}

.current-project-cover {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  aspect-ratio: 1.12;
}

.current-project-cover::after,
.project-cover::after,
.hero-mosaic-cell::after,
.inspector-media::after,
.device-frame::after,
.stage-block::after,
.asset-media::after,
.upload-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(16, 20, 31, 0.14));
  pointer-events: none;
}

.current-project-cover img,
.project-cover img,
.hero-mosaic-cell img,
.inspector-media img,
.device-frame video,
.device-frame img,
.stage-block img,
.asset-media img,
.upload-tile img {
  height: 100%;
  object-fit: cover;
}

.signal-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.signal-pill {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px;
  border-radius: 16px;
  background: rgba(18, 22, 34, 0.04);
}

.signal-pill strong {
  font-size: 20px;
  line-height: 1;
}

.signal-pill span {
  color: var(--text-faint);
  font-size: 12px;
}

.main-area {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 100svh;
  align-content: start;
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 18px 18px 0;
  padding: 14px 18px;
  border-radius: 24px;
}

.topbar-left,
.topbar-right,
.topbar-tabs,
.chip-row,
.project-chip-row,
.hero-actions,
.toolbar,
.top-chip,
.token-pill,
.queue-meta,
.asset-toolbar,
.asset-bottom,
.swatch-row,
.timeline-row,
.overlay-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-left,
.toolbar,
.project-chip-row,
.chip-row {
  flex-wrap: wrap;
}

.topbar-right {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.top-tab,
.filter-pill,
.project-chip,
.chip,
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  transition:
    background-color var(--ease),
    color var(--ease),
    transform var(--ease),
    box-shadow var(--ease);
}

.top-tab,
.filter-pill,
.project-chip,
.chip {
  background: rgba(18, 22, 34, 0.05);
  color: var(--text-soft);
}

.top-tab.is-active,
.filter-pill.is-active,
.project-chip.is-active,
.chip.is-highlight {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 14px 26px rgba(47, 59, 255, 0.22);
}

.project-chip {
  gap: 8px;
  min-height: 48px;
  padding: 0 16px;
}

.project-chip small {
  color: inherit;
  opacity: 0.72;
  font-size: 11px;
}

.badge {
  background: rgba(18, 22, 34, 0.07);
  color: var(--text);
}

.top-chip,
.token-pill {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--text-soft);
  border: 1px solid rgba(18, 22, 34, 0.06);
  cursor: pointer;
  appearance: none;
}

.token-pill {
  color: var(--primary);
  font-weight: 700;
  cursor: default;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary), #111318);
  color: #fff;
  font-weight: 700;
  border: 2px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 10px 20px rgba(16, 20, 31, 0.1);
}

.search-field {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: min(440px, 100%);
  padding: 0 14px;
  min-height: 46px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(18, 22, 34, 0.06);
}

.search-field input {
  width: 100%;
  border: 0;
  background: transparent;
  outline: none;
}

.content {
  min-height: 0;
  overflow: visible;
  padding: 18px;
}

.view {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.hero {
  display: grid;
  gap: 18px;
  padding: clamp(18px, 2.3vw, 28px);
  border-radius: 34px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.56)),
    linear-gradient(135deg, rgba(47, 59, 255, 0.08), transparent 40%);
  border: 1px solid rgba(18, 22, 34, 0.06);
  box-shadow: var(--shadow-lg);
}

.hero-dashboard {
  grid-template-columns: minmax(0, 1.04fr) minmax(360px, 0.96fr);
}

.hero-simple {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.eyebrow {
  color: var(--text-faint);
}

.hero-copy h2 {
  max-width: 13ch;
  font-size: clamp(28px, 3.6vw, 46px);
  line-height: 0.98;
}

.hero-simple .hero-copy h2 {
  max-width: 16ch;
  font-size: clamp(24px, 3vw, 36px);
}

.hero-copy p {
  max-width: 56ch;
  font-size: 14px;
}

.button-primary,
.button-secondary,
.button-subtle,
.button-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 14px;
  font-weight: 700;
  transition:
    transform var(--ease),
    background-color var(--ease),
    color var(--ease),
    border-color var(--ease),
    box-shadow var(--ease);
}

.button-primary:hover,
.button-secondary:hover,
.button-subtle:hover,
.button-icon:hover,
.filter-pill:hover,
.top-tab:hover,
.project-chip:hover,
.template-card:hover,
.style-card:hover,
.layer-row:hover,
.asset-row:hover,
.nav-link:hover {
  transform: translateY(-1px);
}

.button-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  color: #fff;
  box-shadow: 0 18px 32px rgba(47, 59, 255, 0.26);
}

.button-secondary,
.button-subtle {
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(18, 22, 34, 0.08);
}

.button-subtle {
  min-height: 38px;
  padding: 0 14px;
}

.button-icon {
  width: 40px;
  min-width: 40px;
  min-height: 40px;
  padding: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(18, 22, 34, 0.08);
}

.full-button {
  width: 100%;
}

.metric-grid,
.project-grid,
.helper-card-grid,
.helper-grid,
.field-grid,
.gallery-layout,
.collage-layout,
.video-layout,
.dashboard-grid,
.studio-grid {
  display: grid;
  gap: 18px;
}

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

.metric-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px;
}

.metric-card span {
  color: var(--text-faint);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.metric-card strong {
  font-family: "Space Grotesk", "Inter", sans-serif;
  font-size: clamp(28px, 4vw, 40px);
  line-height: 0.95;
}

.metric-card p {
  margin: 0;
  color: var(--text-soft);
  font-size: 14px;
}

.metric-card.is-primary {
  background:
    linear-gradient(180deg, rgba(47, 59, 255, 0.94), rgba(25, 36, 200, 0.9)),
    linear-gradient(135deg, rgba(255, 255, 255, 0.16), transparent);
  color: #fff;
  border-color: rgba(47, 59, 255, 0.2);
  box-shadow: 0 22px 36px rgba(47, 59, 255, 0.24);
}

.metric-card.is-primary span,
.metric-card.is-primary p {
  color: rgba(255, 255, 255, 0.78);
}

.dashboard-grid {
  grid-template-columns: minmax(0, 1.2fr) minmax(360px, 0.92fr);
}

.panel {
  padding: 22px;
}

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

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.panel-header h3 {
  font-size: clamp(22px, 3vw, 30px);
  line-height: 1.02;
}

.hero-stage {
  display: grid;
  gap: 14px;
}

.hero-mosaic {
  display: grid;
  grid-template-columns: 1.32fr 0.88fr;
  grid-template-rows: repeat(2, minmax(0, 180px));
  gap: 12px;
}

.hero-mosaic-cell,
.project-cover,
.inspector-media,
.asset-media,
.device-frame,
.upload-tile,
.stage-block {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
}

.hero-mosaic-cell {
  min-height: 180px;
}

.hero-mosaic-cell.is-large {
  grid-row: 1 / span 2;
  min-height: 372px;
}

.hero-project-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 22px;
  border-radius: 26px;
  background: rgba(18, 22, 34, 0.88);
  color: rgba(255, 255, 255, 0.96);
}

.hero-project-card .eyebrow,
.hero-project-card p,
.hero-project-card .signal-pill span {
  color: rgba(255, 255, 255, 0.68);
}

.hero-project-card .signal-pill {
  background: rgba(255, 255, 255, 0.08);
}

.workflow-board {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.workflow-step {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 142px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(18, 22, 34, 0.04);
  border: 1px solid rgba(18, 22, 34, 0.05);
}

.workflow-step span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(18, 22, 34, 0.08);
  color: var(--text);
  font-weight: 700;
}

.workflow-step strong {
  font-size: 15px;
}

.workflow-step p {
  margin: 0;
  color: var(--text-soft);
  font-size: 13px;
}

.workflow-step.is-active {
  background: linear-gradient(180deg, rgba(47, 59, 255, 0.08), rgba(255, 255, 255, 0.6));
  border-color: rgba(47, 59, 255, 0.14);
}

.workflow-step.is-active span {
  background: var(--primary);
  color: #fff;
}

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

.project-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 14px;
}

.project-card.is-active {
  border-color: rgba(47, 59, 255, 0.18);
  box-shadow: 0 22px 34px rgba(47, 59, 255, 0.12);
}

.project-cover {
  aspect-ratio: 1.32;
}

.project-copy {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.project-copy h4,
.asset-copy h4,
.queue-card h4,
.source-row strong,
.template-card strong,
.style-card strong,
.helper-card strong,
.info-card strong,
.stage-caption h4 {
  margin: 0;
  font-size: 16px;
  line-height: 1.25;
}

.project-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

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

.queue-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
}

.progress {
  width: 100%;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(18, 22, 34, 0.08);
}

.progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), #7b83ff);
  transition: width 360ms ease;
}

.queue-meta {
  justify-content: space-between;
  color: var(--text-soft);
  font-size: 13px;
}

.queue-meta strong {
  color: var(--text);
}

.studio-grid {
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.92fr);
}

.dropzone {
  padding: 20px;
  border-style: dashed;
  border-width: 1.5px;
  transition:
    transform var(--ease),
    border-color var(--ease),
    background-color var(--ease);
}

.dropzone:hover,
.dropzone.is-over {
  transform: translateY(-1px);
  border-color: rgba(47, 59, 255, 0.26);
  background: linear-gradient(180deg, rgba(47, 59, 255, 0.06), rgba(255, 255, 255, 0.72));
}

.dropzone-core {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  min-height: 200px;
  justify-content: center;
  text-align: center;
}

.dropzone-core h4 {
  margin: 0;
  font-size: 24px;
  font-family: "Space Grotesk", "Inter", sans-serif;
  letter-spacing: -0.03em;
}

.dropzone-core p {
  max-width: 44ch;
  margin: 0;
  color: var(--text-soft);
}

.drop-icon {
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(47, 59, 255, 0.1), rgba(197, 123, 43, 0.12));
  color: var(--primary);
  font-size: 28px;
}

.upload-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.upload-tile {
  min-height: 124px;
  background: rgba(255, 255, 255, 0.72);
}

.upload-tile.is-empty {
  display: grid;
  place-items: center;
  border: 1px dashed rgba(18, 22, 34, 0.14);
  color: var(--text-faint);
  background: rgba(255, 255, 255, 0.4);
}

.upload-remove {
  position: absolute;
  top: 10px;
  right: 10px;
}

.helper-card-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.helper-card,
.info-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
}

.form-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field > span {
  color: var(--text-faint);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.text-input,
.select-input,
.textarea-input {
  width: 100%;
  min-height: 50px;
  padding: 0 16px;
  border-radius: 16px;
  border: 1px solid rgba(18, 22, 34, 0.08);
  background: rgba(255, 255, 255, 0.76);
  outline: none;
  transition:
    border-color var(--ease),
    box-shadow var(--ease),
    background-color var(--ease);
}

.text-input:focus,
.select-input:focus,
.textarea-input:focus,
.search-field:focus-within {
  border-color: rgba(47, 59, 255, 0.22);
  box-shadow: 0 0 0 4px rgba(47, 59, 255, 0.08);
  background: rgba(255, 255, 255, 0.92);
}

.textarea-input {
  min-height: 132px;
  padding: 16px;
}

.textarea-input.is-compact {
  min-height: 100px;
}

.helper-grid {
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
}

.prompt-list,
.info-list,
.source-list,
.style-list,
.template-list,
.layer-list,
.detail-list,
.asset-rail,
.script-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.prompt-line,
.script-line {
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(18, 22, 34, 0.04);
  border: 1px solid rgba(18, 22, 34, 0.05);
}

.prompt-list.compact .prompt-line {
  padding: 12px 14px;
  font-size: 13px;
}

.gallery-layout {
  grid-template-columns: minmax(0, 1.15fr) 380px;
  align-items: start;
}

.toolbar {
  justify-content: space-between;
}

.asset-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.asset-card {
  overflow: hidden;
  transition:
    transform var(--ease),
    box-shadow var(--ease),
    border-color var(--ease);
}

.asset-card:hover {
  transform: translateY(-2px);
}

.asset-card.is-selected {
  border-color: rgba(47, 59, 255, 0.2);
  box-shadow: 0 22px 36px rgba(47, 59, 255, 0.14);
}

.asset-card.is-queued {
  opacity: 0.86;
}

.asset-media {
  aspect-ratio: 0.88;
  background: rgba(18, 22, 34, 0.06);
}

.asset-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 14px;
  background: linear-gradient(180deg, rgba(16, 20, 31, 0.12), rgba(16, 20, 31, 0.42));
  opacity: 0;
  transition: opacity var(--ease);
}

.asset-card:hover .asset-overlay,
.asset-card.is-selected .asset-overlay {
  opacity: 1;
}

.asset-bottom {
  justify-content: space-between;
}

.asset-state {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.asset-state.ready,
.status-badge.ready {
  background: rgba(255, 255, 255, 0.88);
  color: var(--text);
}

.asset-state.queued,
.status-badge.rendering {
  background: rgba(18, 22, 34, 0.8);
  color: rgba(255, 255, 255, 0.92);
}

.status-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  z-index: 1;
}

.asset-copy {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
}

.selection-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
}

.selection-bar p {
  margin: 0;
  color: var(--text-soft);
}

.asset-inspector {
  position: sticky;
  top: 88px;
}

.inspector-media {
  aspect-ratio: 0.95;
  background: rgba(18, 22, 34, 0.05);
}

.detail-row,
.source-row {
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(18, 22, 34, 0.04);
}

.detail-row strong,
.source-row strong {
  font-size: 14px;
}

.collage-layout {
  grid-template-columns: 320px minmax(0, 1fr) 320px;
  align-items: start;
}

.asset-rail {
  max-height: 720px;
  overflow-y: auto;
  padding-right: 2px;
}

.asset-row {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 12px;
  padding: 10px;
  border-radius: 20px;
  text-align: left;
  transition:
    transform var(--ease),
    border-color var(--ease),
    box-shadow var(--ease);
}

.asset-row img,
.source-row img {
  width: 100%;
  height: 84px;
  object-fit: cover;
  border-radius: 16px;
}

.asset-row.is-selected {
  border-color: rgba(47, 59, 255, 0.18);
  box-shadow: 0 18px 28px rgba(47, 59, 255, 0.12);
}

.asset-row div,
.source-row div {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  min-width: 0;
}

.asset-row strong,
.source-row strong {
  font-size: 14px;
}

.collage-stage {
  display: grid;
  gap: 12px;
  min-height: 680px;
  padding: 14px;
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.76), rgba(255, 255, 255, 0.44)),
    linear-gradient(135deg, rgba(47, 59, 255, 0.06), rgba(197, 123, 43, 0.06));
  border: 1px solid rgba(18, 22, 34, 0.06);
}

.collage-stage.template-focus {
  grid-template-columns: minmax(0, 1.48fr) minmax(0, 0.72fr);
  grid-template-rows: minmax(0, 1fr) auto;
}

.collage-stage.template-focus .stage-block.is-hero {
  grid-row: 1 / span 2;
}

.collage-stage.template-dual {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
}

.collage-stage.template-story {
  grid-template-columns: minmax(0, 1.28fr) minmax(0, 0.92fr);
  grid-template-rows: repeat(2, minmax(0, 1fr)) auto;
}

.collage-stage.template-story .stage-block.is-hero {
  grid-row: 1 / span 2;
}

.stage-side {
  display: grid;
  gap: 12px;
}

.stage-block {
  min-height: 196px;
  background: rgba(18, 22, 34, 0.06);
}

.stage-block.is-hero {
  min-height: 0;
}

.stage-label,
.stage-chip,
.overlay-chip,
.overlay-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.stage-label {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 1;
  background: rgba(255, 255, 255, 0.88);
}

.stage-caption {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 4px 2px;
}

.stage-caption h4 {
  font-size: clamp(28px, 3vw, 38px);
  font-family: "Space Grotesk", "Inter", sans-serif;
  letter-spacing: -0.04em;
}

.stage-chip {
  background: var(--surface-inverse);
  color: #fff;
}

.template-card,
.style-card,
.layer-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: center;
  padding: 16px;
  border-radius: 20px;
  text-align: left;
}

.template-card,
.layer-row {
  grid-template-columns: 1fr;
}

.template-card.is-active,
.style-card.is-active,
.layer-row.is-active,
.swatch.is-active {
  border-color: rgba(47, 59, 255, 0.18);
  box-shadow: 0 18px 28px rgba(47, 59, 255, 0.12);
}

.style-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  box-shadow: 0 0 0 6px rgba(18, 22, 34, 0.04);
}

.video-layout {
  grid-template-columns: 310px minmax(0, 1fr) 320px;
  align-items: start;
}

.preview-panel {
  min-width: 0;
}

.device-stage {
  display: grid;
  place-items: center;
  padding: 8px;
}

.device-frame {
  width: min(100%, 380px);
  aspect-ratio: 9 / 16;
  background: #0f1320;
  border-radius: 34px;
  box-shadow: 0 34px 54px rgba(16, 20, 31, 0.18);
}

.device-play {
  position: absolute;
  inset: auto auto 22px 22px;
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  z-index: 2;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 16px 30px rgba(16, 20, 31, 0.18);
}

.device-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 22px;
  z-index: 1;
}

.overlay-chip {
  background: rgba(255, 255, 255, 0.86);
  color: var(--text);
}

.overlay-banner {
  align-self: flex-start;
  max-width: min(82%, 260px);
  padding: 14px 18px;
  border-radius: 20px;
  font-size: 28px;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.04em;
  box-shadow: 0 16px 32px rgba(16, 20, 31, 0.18);
}

.overlay-meta {
  justify-content: space-between;
  color: rgba(255, 255, 255, 0.88);
}

.overlay-pill {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  backdrop-filter: blur(12px);
}

.timeline-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  border-radius: 24px;
  background: rgba(18, 22, 34, 0.04);
}

.time-ruler {
  display: flex;
  justify-content: space-between;
  color: var(--text-faint);
  font-size: 12px;
  font-weight: 700;
}

.timeline-row {
  align-items: stretch;
}

.timeline-label {
  width: 100px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.timeline-bar {
  position: relative;
  min-height: 52px;
  flex: 1;
  overflow: hidden;
  border-radius: 18px;
  background: rgba(18, 22, 34, 0.06);
}

.timeline-segment {
  position: absolute;
  top: 10px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border-radius: 999px;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.timeline-segment.is-scene {
  background: linear-gradient(135deg, var(--primary), #5866ff);
}

.timeline-segment.is-caption {
  background: linear-gradient(135deg, var(--amber), #d39b58);
}

.timeline-cursor {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgba(18, 22, 34, 0.8);
  box-shadow: 0 0 0 4px rgba(18, 22, 34, 0.08);
}

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

.swatch {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.86);
  box-shadow: 0 10px 18px rgba(16, 20, 31, 0.08);
}

.layer-row {
  grid-template-columns: 1fr auto;
}

.layer-row strong {
  font-size: 14px;
}

.source-row {
  border-radius: 18px;
}

.empty-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 280px;
  padding: 28px;
  border-radius: 26px;
  background: rgba(18, 22, 34, 0.04);
  color: var(--text-soft);
  text-align: center;
}

.empty-card strong {
  color: var(--text);
  font-size: 18px;
}

.toast-stack {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  min-width: min(360px, calc(100vw - 32px));
  padding: 16px 18px;
  border-radius: 20px;
  background: rgba(18, 22, 34, 0.9);
  color: rgba(255, 255, 255, 0.92);
  border-color: rgba(255, 255, 255, 0.06);
  box-shadow: 0 22px 34px rgba(16, 20, 31, 0.28);
}

.toast strong,
.toast p {
  margin: 0;
}

.toast p {
  margin-top: 6px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
}

.hidden-file-input {
  position: fixed;
  inset: auto;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.is-highlight {
  color: #fff;
}

.is-empty {
  box-shadow: none;
}

@media (max-width: 1480px) {
  .hero-dashboard,
  .dashboard-grid,
  .studio-grid,
  .helper-grid {
    grid-template-columns: 1fr;
  }

  .asset-inspector {
    position: static;
  }

  .collage-layout {
    grid-template-columns: 280px minmax(0, 1fr);
  }

  .collage-layout > aside:last-child {
    grid-column: 1 / -1;
  }

  .video-layout {
    grid-template-columns: 280px minmax(0, 1fr);
  }

  .video-layout > aside:last-child {
    grid-column: 1 / -1;
  }

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

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

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 250px minmax(0, 1fr);
  }

  .gallery-layout,
  .collage-layout,
  .video-layout {
    grid-template-columns: 1fr;
  }

  .collage-layout > aside:last-child,
  .video-layout > aside:last-child {
    grid-column: auto;
  }

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

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

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

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

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    gap: 14px;
    padding: 14px;
    position: static;
    max-height: none;
    border-right: 0;
    border-bottom: 1px solid rgba(18, 22, 34, 0.06);
  }

  .current-project-card {
    display: none;
  }

  .nav-group {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .nav-label {
    grid-column: 1 / -1;
    padding: 0;
  }

  .topbar {
    margin: 14px 14px 0;
    position: static;
  }

  .content {
    padding: 14px;
  }

  .brand-card h1 {
    font-size: 30px;
  }

  .hero-simple {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .topbar,
  .topbar-left,
  .topbar-right,
  .toolbar,
  .selection-bar,
  .project-actions,
  .panel-header {
    flex-direction: column;
    align-items: stretch;
  }

  .signal-row,
  .metric-grid,
  .project-grid,
  .helper-card-grid,
  .field-grid,
  .asset-grid,
  .upload-grid {
    grid-template-columns: 1fr;
  }

  .hero-mosaic {
    grid-template-columns: 1fr 1fr;
  }

  .hero-mosaic-cell.is-large {
    grid-row: span 1;
    grid-column: 1 / -1;
    min-height: 280px;
  }

  .collage-stage.template-focus,
  .collage-stage.template-story,
  .collage-stage.template-dual {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }

  .collage-stage.template-focus .stage-block.is-hero,
  .collage-stage.template-story .stage-block.is-hero {
    grid-row: auto;
  }

  .timeline-row {
    flex-direction: column;
  }

  .timeline-label {
    width: auto;
  }
}

@media (max-width: 560px) {
  .sidebar,
  .panel,
  .brand-card,
  .metric-card,
  .project-card,
  .queue-card,
  .selection-bar,
  .hero {
    padding: 16px;
  }

  .topbar {
    padding: 12px;
  }

  .search-field {
    min-width: 0;
  }

  .hero-copy h2 {
    font-size: 30px;
  }

  .brand-card h1 {
    font-size: 24px;
  }

  .nav-group {
    grid-template-columns: 1fr;
  }

  .dropzone-core {
    min-height: 160px;
  }

  .device-frame {
    width: 100%;
  }

  .toast-stack {
    right: 12px;
    left: 12px;
    bottom: 12px;
  }
}
