:root {
  --bg: #030814;
  --surface: #071426;
  --surface-2: #0b1b33;
  --surface-3: #102640;
  --line: rgba(255, 255, 255, .12);
  --text: #f5f8ff;
  --muted: #9fb3cc;
  --soft: #dbe8ff;
  --accent: #78ff3f;
  --accent-2: #1d9bff;
  --warning: #f5b84b;
  --danger: #ff6b6b;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(29, 155, 255, .18), transparent 34%),
    radial-gradient(circle at bottom right, rgba(120, 255, 63, .10), transparent 36%),
    var(--bg);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, #06101f, #030814);
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.identity {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-mark,
.brand-logo {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  flex: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  color: #06120d;
  background: var(--accent);
  font-weight: 900;
}

.brand-logo {
  display: block;
  object-fit: contain;
  object-position: center;
  padding: 8px;
  background:
    radial-gradient(circle at top, rgba(29, 155, 255, .16), transparent 42%),
    #050910;
  border: 1px solid rgba(120, 255, 63, .22);
  box-shadow:
    0 14px 34px rgba(0, 0, 0, .34),
    0 0 28px rgba(29, 155, 255, .12);
}

.identity strong,
.identity span {
  display: block;
}

.identity strong {
  font-size: 22px;
  letter-spacing: -.4px;
}

.identity span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
}

.nav-list {
  display: grid;
  gap: 4px;
}

.nav-list a {
  min-height: 42px;
  padding: 11px 12px;
  border-radius: 8px;
  color: var(--soft);
  text-decoration: none;
  font-weight: 700;
}

.nav-list a:hover,
.nav-list a.active {
  background: rgba(255, 255, 255, .06);
  color: var(--text);
}

.phase-box {
  margin-top: auto;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
}

.phase-box span,
.eyebrow,
.muted-label {
  margin: 0;
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.phase-box strong {
  display: block;
  margin-top: 8px;
}

.phase-box p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.workspace {
  min-width: 0;
  padding: 28px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 34px;
  line-height: 1.1;
}

h2 {
  margin-bottom: 0;
  font-size: 22px;
  line-height: 1.2;
}

.top-actions,
.command-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.primary-btn,
.ghost-btn {
  min-height: 44px;
  border-radius: 8px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  font-weight: 900;
  text-decoration: none;
}

.primary-btn {
  color: #03101f;
  background: linear-gradient(135deg, var(--accent), #d8ff3f);
  box-shadow: 0 12px 28px rgba(120, 255, 63, .18);
}

.primary-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 42px rgba(120, 255, 63, .24);
}

.primary-btn:disabled {
  opacity: .55;
  cursor: not-allowed;
}

.primary-btn.compact {
  min-width: 108px;
}

.ghost-btn {
  color: var(--text);
  background: var(--surface-2);
  border-color: var(--line);
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.metrics-grid article,
.panel,
.phone-panel {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
}

.metrics-grid article {
  padding: 16px;
}

.metrics-grid span,
.metrics-grid small {
  display: block;
  color: var(--muted);
}

.metrics-grid strong {
  display: block;
  margin: 10px 0 4px;
  font-size: 30px;
  line-height: 1;
}

.main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 20px;
}

.panel {
  padding: 20px;
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}

.status-pill {
  white-space: nowrap;
  border: 1px solid rgba(63, 207, 142, .4);
  border-radius: 999px;
  padding: 7px 10px;
  color: var(--accent);
  background: rgba(120, 255, 63, .10);
  font-size: 12px;
  font-weight: 900;
}

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

label {
  display: grid;
  gap: 8px;
  color: var(--soft);
  font-size: 13px;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  background: #0c1118;
  color: var(--text);
  padding: 11px 12px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(79, 140, 255, .2);
}

textarea {
  min-height: 82px;
  resize: vertical;
  line-height: 1.45;
}

.command-row {
  align-items: stretch;
  margin-top: 16px;
}

.audio-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0c1118;
}

.audio-note {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.toggle-row input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--accent);
}

input[type="range"] {
  padding: 0;
  accent-color: var(--accent);
}

.small-btn {
  min-height: 38px;
  padding: 0 12px;
  font-size: 12px;
}

.editor-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.editor-actions span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.status-box {
  flex: 1;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  color: var(--muted);
  background: #0c1118;
}

.phone-panel {
  display: grid;
  place-items: center;
  padding: 18px;
}

.phone {
  width: 235px;
  height: 462px;
  border: 8px solid #05070b;
  border-radius: 34px;
  background: #000;
  padding: 12px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .34);
}

.phone-top {
  width: 76px;
  height: 7px;
  margin: 0 auto 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .16);
}

.phone-screen {
  position: relative;
  height: 416px;
  border-radius: 24px;
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, .06), rgba(0, 0, 0, .82)),
    linear-gradient(135deg, #244a7c 0%, #111827 45%, #12261d 100%);
  background-position: center;
  background-size: cover;
}

.phone-screen[data-tone="startup"] {
  background:
    linear-gradient(180deg, rgba(0, 0, 0, .06), rgba(0, 0, 0, .84)),
    linear-gradient(135deg, #123a32 0%, #0b1720 48%, #0f2b22 100%);
}

.phone-screen[data-tone="premium"] {
  background:
    linear-gradient(180deg, rgba(0, 0, 0, .06), rgba(0, 0, 0, .84)),
    linear-gradient(135deg, #30291a 0%, #111111 52%, #2c2418 100%);
}

.phone-screen[data-tone="provocative"] {
  background:
    linear-gradient(180deg, rgba(0, 0, 0, .06), rgba(0, 0, 0, .84)),
    linear-gradient(135deg, #43151f 0%, #111827 52%, #291018 100%);
}

.motion-orb,
.motion-grid,
.motion-light {
  position: absolute;
  pointer-events: none;
}

.motion-orb {
  width: 260px;
  height: 260px;
  left: -62px;
  top: 92px;
  border: 1px solid rgba(63, 207, 142, .42);
  border-radius: 50%;
  box-shadow:
    0 0 0 8px rgba(63, 207, 142, .08),
    0 0 0 18px rgba(79, 140, 255, .05),
    inset 0 0 42px rgba(63, 207, 142, .12);
  animation: orbPush 6s ease-in-out infinite;
}

.motion-grid {
  inset: 0;
  opacity: .22;
  background:
    linear-gradient(rgba(255, 255, 255, .08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .07) 1px, transparent 1px);
  background-size: 34px 34px;
  transform: perspective(420px) rotateX(58deg) translateY(120px);
  animation: gridDrift 4.8s linear infinite;
}

.motion-light {
  width: 170px;
  height: 520px;
  right: -105px;
  top: -65px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .22), transparent);
  transform: rotate(22deg);
  animation: lightSweep 5.6s ease-in-out infinite;
}

.phone-screen[data-motion="pan"] .motion-orb {
  animation-name: orbPan;
}

.phone-screen[data-motion="scan"] .motion-grid {
  opacity: .34;
  animation-duration: 2.4s;
}

.phone-screen[data-motion="reveal"] .motion-light {
  animation-duration: 3.6s;
}

.phone-screen[data-has-image="true"] .motion-orb,
.phone-screen[data-has-image="true"] .motion-grid {
  opacity: .12;
}

.phone-screen[data-has-image="true"] .motion-light {
  opacity: .45;
}

.mini-label {
  position: relative;
  z-index: 2;
  align-self: flex-start;
  margin-bottom: auto;
  padding: 6px 8px;
  border-radius: 999px;
  color: #d6ffe9;
  background: rgba(255, 255, 255, .12);
  font-size: 11px;
  font-weight: 900;
}

.preview-copy {
  position: relative;
  z-index: 2;
  animation: copyFloat 4.6s ease-in-out infinite;
}

.phone-screen h3 {
  margin-bottom: 10px;
  font-size: 25px;
  line-height: 1;
  overflow-wrap: anywhere;
}

.phone-screen p {
  margin-bottom: 16px;
  color: #dce7f6;
  line-height: 1.35;
}

.preview-line {
  position: relative;
  z-index: 2;
  width: 72px;
  height: 4px;
  margin-bottom: 16px;
  border-radius: 999px;
  background: var(--accent);
  animation: linePulse 2.8s ease-in-out infinite;
}

.motion-note {
  position: relative;
  z-index: 2;
  display: block;
  margin-bottom: 10px;
  color: #b8c7dc;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.25;
}

.preview-logo {
  position: relative;
  z-index: 2;
  width: 136px;
  max-height: 68px;
  object-fit: contain;
  object-position: left center;
  margin: 0 0 8px;
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .45));
}

.phone-screen small {
  position: relative;
  z-index: 2;
  color: white;
  font-weight: 900;
}

@keyframes orbPush {
  0%, 100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(24px, -14px, 0) scale(1.08);
  }
}

@keyframes orbPan {
  0%, 100% {
    transform: translate3d(-18px, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(48px, -8px, 0) scale(1.04);
  }
}

@keyframes gridDrift {
  from {
    background-position: 0 0;
  }
  to {
    background-position: 34px 68px;
  }
}

@keyframes lightSweep {
  0%, 40% {
    opacity: 0;
    transform: translateX(-120px) rotate(22deg);
  }
  65% {
    opacity: .8;
  }
  100% {
    opacity: 0;
    transform: translateX(110px) rotate(22deg);
  }
}

@keyframes copyFloat {
  0%, 100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-7px) scale(1.015);
  }
}

@keyframes linePulse {
  0%, 100% {
    width: 72px;
    opacity: .8;
  }
  50% {
    width: 112px;
    opacity: 1;
  }
}

.system-grid {
  display: grid;
  grid-template-columns: 1.2fr .9fr .9fr;
  gap: 20px;
  margin-top: 20px;
}

.timeline-list {
  display: grid;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.timeline-list li {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 42px;
  gap: 10px;
  align-items: center;
  min-height: 48px;
  padding: 10px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid transparent;
  cursor: pointer;
}

.timeline-list li:hover,
.timeline-list li.selected {
  border-color: rgba(63, 207, 142, .45);
  background: #1a2330;
}

.timeline-list span,
.timeline-list small {
  color: var(--muted);
  font-weight: 900;
}

.timeline-list p {
  margin: 0;
  color: var(--soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.timeline-list b {
  color: var(--text);
}

.scene-editor-panel {
  grid-column: span 2;
}

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

.editor-grid .wide {
  grid-column: 1 / -1;
}

.memory-list {
  display: grid;
  gap: 10px;
}

.memory-list div {
  display: grid;
  gap: 4px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.memory-list div:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.memory-list span {
  color: var(--muted);
  line-height: 1.45;
}

.asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.asset-grid div,
.media-card {
  min-height: 112px;
  padding: 12px;
  border: 0;
  border-radius: 8px;
  background: var(--surface-2);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  color: var(--text);
  text-align: left;
  overflow: hidden;
}

.asset-grid span,
.media-card img {
  width: 34px;
  height: 34px;
  margin-bottom: auto;
  border-radius: 8px;
}

.asset-grid span {
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
}

.media-card {
  min-height: 190px;
  cursor: pointer;
}

.media-card:hover {
  outline: 1px solid rgba(106, 228, 255, .55);
}

.media-card img {
  width: 100%;
  height: 122px;
  object-fit: cover;
}

.asset-grid b,
.asset-grid small,
.media-card b,
.media-card small {
  display: block;
}

.asset-grid small,
.media-card small {
  margin-top: 4px;
  color: var(--muted);
}

.media-upload {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.media-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.media-upload span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.result-panel {
  margin-top: 20px;
}

video {
  width: 100%;
  max-height: 740px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #000;
}

.hidden {
  display: none;
}

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

  .sidebar {
    position: static;
    height: auto;
  }

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

  .phase-box {
    margin-top: 0;
  }

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

  .scene-editor-panel {
    grid-column: 1 / -1;
  }
}

@media (max-width: 820px) {
  .workspace {
    padding: 18px;
  }

  .topbar,
  .main-grid,
  .command-row {
    grid-template-columns: 1fr;
    display: grid;
  }

  .top-actions,
  .command-row {
    align-items: stretch;
  }

  .metrics-grid,
  .form-grid,
  .system-grid,
  .asset-grid,
  .audio-grid,
  .editor-grid {
    grid-template-columns: 1fr;
  }

  .editor-grid .wide {
    grid-column: auto;
  }

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

  h1 {
    font-size: 28px;
  }

  .brand-mark,
  .brand-logo {
    width: 58px;
    height: 58px;
    border-radius: 16px;
  }

  .identity strong {
    font-size: 20px;
  }
}

/* ==============================
   MatchIQ Studio V2.3 Enterprise Dashboard
   ============================== */
.workspace{
  max-width: 1580px;
  margin: 0 auto;
}

.studio-hero{
  min-height: 250px;
  align-items: stretch;
}

.studio-hero-copy h2{
  max-width: 760px;
}

.quick-grid{
  display:grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap:14px;
  margin-bottom:20px;
}

.quick-card{
  min-height:110px;
  padding:18px;
  border-radius:18px;
  border:1px solid var(--line);
  background:linear-gradient(180deg,var(--surface),var(--surface-2));
  color:var(--text);
  text-align:left;
  transition:.22s ease;
}

.quick-card:hover,
.recent-project-card:hover,
.assistant-list button:hover{
  transform:translateY(-3px);
  border-color:rgba(120,255,63,.42);
  box-shadow:0 18px 44px rgba(0,0,0,.28);
}

.quick-card span,
.recent-project-card span{
  display:block;
  color:var(--accent);
  font-size:12px;
  font-weight:900;
  text-transform:uppercase;
}

.quick-card strong{
  display:block;
  margin-top:10px;
  font-size:18px;
}

.quick-card small,
.recent-project-card small{
  display:block;
  margin-top:8px;
  color:var(--muted);
}

.enterprise-grid{
  display:grid;
  grid-template-columns:1.35fr .75fr .75fr;
  gap:18px;
  margin-bottom:20px;
}

.enterprise-card{
  border:1px solid var(--line);
  border-radius:22px;
  padding:20px;
  background:
    radial-gradient(circle at top right, rgba(29,155,255,.14), transparent 32%),
    linear-gradient(180deg,var(--surface),var(--surface-2));
}

.enterprise-main{
  grid-row:span 2;
}

.compact-heading{
  margin-bottom:14px;
}

.command-center{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:12px;
  margin-top:16px;
}

.command-center div{
  padding:16px;
  border:1px solid var(--line);
  border-radius:18px;
  background:rgba(255,255,255,.035);
}

.command-center span,
.render-queue span{
  display:block;
  color:var(--muted);
  font-size:12px;
  font-weight:800;
}

.command-center strong{
  display:block;
  margin:8px 0 6px;
  font-size:30px;
  line-height:1;
}

.command-center small{
  color:var(--muted);
  line-height:1.35;
}

.recent-projects{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:12px;
  margin-top:14px;
}

.recent-project-card,
.assistant-list button{
  width:100%;
  border:1px solid var(--line);
  border-radius:18px;
  padding:14px;
  color:var(--text);
  background:rgba(255,255,255,.04);
  text-align:left;
  transition:.22s ease;
}

.recent-project-card strong{
  display:block;
  margin-top:8px;
}

.assistant-card h2,
.render-card h2{
  margin-top:8px;
  margin-bottom:14px;
}

.assistant-list{
  display:grid;
  gap:10px;
}

.assistant-list button::before{
  content:"✦";
  color:var(--accent);
  margin-right:8px;
}

.render-queue{
  display:grid;
  gap:10px;
}

.render-queue div{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:13px;
  border:1px solid var(--line);
  border-radius:16px;
  background:rgba(255,255,255,.035);
}

.render-queue b{
  color:var(--accent);
  font-size:12px;
}

@media (max-width:1120px){
  .enterprise-grid{
    grid-template-columns:1fr;
  }
  .command-center,
  .recent-projects{
    grid-template-columns:1fr;
  }
}

@media (max-width:820px){
  .quick-grid{
    grid-template-columns:1fr 1fr;
  }
  .studio-hero{
    min-height:auto;
  }
  .enterprise-card{
    padding:16px;
    border-radius:18px;
  }
  .command-center strong{
    font-size:26px;
  }
}

@media (max-width:520px){
  .quick-grid{
    grid-template-columns:1fr;
  }
}


/* ==============================
   MatchIQ Studio V2.4 UX Premium
   ============================== */
.workspace{
  width:100%;
  max-width: none;
  margin:0;
  padding: clamp(22px, 2vw, 34px);
}

.topbar-v24{
  max-width: 1500px;
  margin:0 auto 20px;
}

.topbar-subtitle{
  margin:10px 0 0;
  color:var(--muted);
  font-size:14px;
  font-weight:700;
  line-height:1.45;
}

.studio-hero-v24,
.quick-grid,
.enterprise-grid-v24,
.metrics-grid,
.main-grid,
.system-grid,
.result-panel{
  max-width:1500px;
  margin-left:auto;
  margin-right:auto;
}

.studio-hero-v24{
  min-height: 390px;
  display:grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, .85fr);
  gap:22px;
  padding:30px;
  margin-bottom:20px;
  border:1px solid rgba(120,255,63,.22);
  border-radius:28px;
  background:
    radial-gradient(circle at top left, rgba(29,155,255,.22), transparent 34%),
    radial-gradient(circle at bottom right, rgba(120,255,63,.14), transparent 38%),
    linear-gradient(135deg, rgba(7,20,38,.96), rgba(3,8,20,.96));
  box-shadow:0 28px 80px rgba(0,0,0,.34);
}

.studio-hero-v24 .studio-hero-copy{
  display:flex;
  flex-direction:column;
  justify-content:center;
  min-width:0;
}

.hero-badge{
  width:max-content;
  border:1px solid rgba(120,255,63,.24);
  border-radius:999px;
  padding:8px 12px;
  background:rgba(120,255,63,.10);
  color:var(--accent);
  font-size:12px;
  font-weight:900;
  text-transform:uppercase;
}

.studio-hero-v24 h2{
  max-width:860px;
  margin:18px 0 12px;
  font-size: clamp(38px, 5vw, 74px);
  line-height:.95;
  letter-spacing:-2.5px;
}

.studio-hero-v24 p{
  max-width:760px;
  color:var(--muted);
  font-size:17px;
  line-height:1.65;
}

.hero-actions{
  display:flex;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
  margin-top:10px;
}

.hero-kpi-row{
  display:grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap:12px;
  margin-top:24px;
}

.hero-kpi-row div,
.assistant-message-card,
.pipeline-mini div{
  border:1px solid var(--line);
  border-radius:18px;
  background:rgba(255,255,255,.045);
}

.hero-kpi-row div{
  padding:16px;
}

.hero-kpi-row span{
  display:block;
  color:var(--muted);
  font-size:12px;
  font-weight:800;
}

.hero-kpi-row strong{
  display:block;
  margin-top:8px;
  font-size:34px;
  line-height:1;
}

.studio-command-preview{
  align-self:stretch;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  gap:14px;
  padding:22px;
  border:1px solid rgba(29,155,255,.22);
  border-radius:24px;
  background:
    linear-gradient(180deg, rgba(11,27,51,.72), rgba(7,20,38,.92)),
    radial-gradient(circle at top right, rgba(120,255,63,.13), transparent 36%);
  box-shadow: inset 0 0 50px rgba(29,155,255,.05);
}

.command-preview-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
}

.command-preview-head span,
.pipeline-mini span{
  color:var(--muted);
  font-size:12px;
  font-weight:900;
  text-transform:uppercase;
}

.command-preview-head b{
  color:var(--accent);
  border:1px solid rgba(120,255,63,.26);
  border-radius:999px;
  padding:7px 10px;
  background:rgba(120,255,63,.10);
}

.assistant-message-card{
  padding:18px;
}

.assistant-message-card strong{
  display:block;
  font-size:22px;
  line-height:1.15;
}

.assistant-message-card p{
  margin:10px 0 0;
  font-size:14px;
}

.pipeline-mini{
  display:grid;
  grid-template-columns:1fr;
  gap:10px;
}

.pipeline-mini div{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:14px;
}

.pipeline-mini b{
  color:var(--accent);
}

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

.quick-card{
  min-height:132px;
  position:relative;
  overflow:hidden;
}

.quick-card::after{
  content:"";
  position:absolute;
  inset:auto -40px -70px auto;
  width:120px;
  height:120px;
  border-radius:50%;
  background:radial-gradient(circle, rgba(120,255,63,.20), transparent 62%);
  opacity:.85;
}

.quick-card strong{
  font-size:20px;
}

.enterprise-grid-v24{
  grid-template-columns:1.25fr .75fr .75fr;
}

.enterprise-main{
  grid-row:auto;
}

.recent-projects-v24{
  grid-template-columns:1.15fr .9fr .9fr;
}

.featured-project{
  border-color:rgba(120,255,63,.34);
  background:
    radial-gradient(circle at top right, rgba(120,255,63,.12), transparent 38%),
    rgba(255,255,255,.045);
}

.assistant-intro{
  color:var(--muted);
  line-height:1.45;
  margin-bottom:14px;
}

.render-queue div{
  min-height:48px;
}

.main-grid{
  grid-template-columns:minmax(0, 1fr) 360px;
}

@media (min-width:1600px){
  .studio-hero-v24,
  .quick-grid,
  .enterprise-grid-v24,
  .metrics-grid,
  .main-grid,
  .system-grid,
  .result-panel,
  .topbar-v24{
    max-width:1640px;
  }
}

@media (max-width:1120px){
  .studio-hero-v24{
    grid-template-columns:1fr;
  }
  .hero-kpi-row,
  .quick-grid,
  .enterprise-grid-v24,
  .recent-projects-v24{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}

@media (max-width:820px){
  .studio-hero-v24{
    padding:20px;
    border-radius:22px;
  }
  .studio-hero-v24 h2{
    font-size:42px;
    letter-spacing:-1.6px;
  }
  .hero-kpi-row,
  .quick-grid,
  .enterprise-grid-v24,
  .recent-projects-v24{
    grid-template-columns:1fr;
  }
  .studio-command-preview{
    padding:16px;
  }
}


/* ==============================
   MatchIQ Studio V2.5 Studio OS
   Dashboard separata + Editor dedicato
   ============================== */

.studio-dashboard-view{
  animation: studioFadeUp .42s ease both;
}

.studio-editor-shell{
  max-width:1500px;
  margin:26px auto 0;
  animation: studioFadeUp .42s ease both;
}

.studio-editor-shell.hidden{
  display:none;
}

.editor-launch-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  margin-bottom:18px;
  padding:22px;
  border:1px solid rgba(120,255,63,.18);
  border-radius:24px;
  background:
    radial-gradient(circle at top right, rgba(120,255,63,.11), transparent 34%),
    linear-gradient(180deg, rgba(7,20,38,.96), rgba(11,27,51,.88));
  box-shadow:0 18px 50px rgba(0,0,0,.24);
}

.editor-launch-header h2{
  margin:8px 0 8px;
  font-size:30px;
  letter-spacing:-.8px;
}

.editor-launch-header p{
  margin:0;
  color:var(--muted);
  line-height:1.45;
}

body.studio-editor-open .studio-dashboard-view{
  display:none;
}

body.studio-editor-open .studio-editor-shell{
  display:block;
}

body.studio-editor-open .sidebar{
  background:
    radial-gradient(circle at top left, rgba(120,255,63,.08), transparent 36%),
    linear-gradient(180deg, #06101f, #030814);
}

body.studio-editor-open .nav-list a[href="#dashboard"]{
  opacity:.82;
}

.nav-list a,
.mobile-bottom-nav a{
  transition:.2s ease;
}

.nav-list a.active,
.mobile-bottom-nav a.active{
  border-color:rgba(120,255,63,.35);
  background:rgba(120,255,63,.10);
  color:#fff;
}

@keyframes studioFadeUp{
  from{opacity:0;transform:translateY(14px)}
  to{opacity:1;transform:translateY(0)}
}

@media (max-width:820px){
  .studio-editor-shell{
    margin-top:18px;
  }

  .editor-launch-header{
    display:grid;
    grid-template-columns:1fr;
    padding:18px;
    border-radius:20px;
  }

  .editor-launch-header .ghost-btn{
    width:100%;
  }

  body.studio-editor-open{
    padding-bottom:72px;
  }
}


/* ==============================
   MatchIQ Studio V2.6 Navigation Premium
   Sidebar + PWA navigation refinement
   ============================== */
.sidebar{
  width:280px;
  backdrop-filter: blur(18px);
}

.identity{
  padding:6px 4px 12px;
  border-bottom:1px solid rgba(255,255,255,.08);
}

.nav-list{
  position:relative;
  gap:8px;
}

.nav-list a{
  position:relative;
  display:flex;
  align-items:center;
  gap:12px;
  min-height:48px;
  padding:12px 14px;
  border:1px solid transparent;
  border-radius:16px;
  overflow:hidden;
}

.nav-list a::before{
  content:"";
  position:absolute;
  inset:0;
  opacity:0;
  background:linear-gradient(90deg, rgba(120,255,63,.12), rgba(29,155,255,.08));
  transition:.22s ease;
}

.nav-list a:hover::before,
.nav-list a.active::before{
  opacity:1;
}

.nav-list a.active{
  border-color:rgba(120,255,63,.34);
  box-shadow: inset 3px 0 0 var(--accent), 0 12px 28px rgba(0,0,0,.18);
}

.nav-list a span{
  position:relative;
  z-index:1;
}

.nav-icon{
  width:28px;
  height:28px;
  display:grid;
  place-items:center;
  border-radius:10px;
  color:var(--accent);
  background:rgba(120,255,63,.08);
  border:1px solid rgba(120,255,63,.12);
  font-size:14px;
  flex:none;
}

.sidebar-fab{
  min-height:48px;
  border:0;
  border-radius:16px;
  color:#03101f;
  font-weight:950;
  background:linear-gradient(135deg,var(--accent),#d8ff3f);
  box-shadow:0 16px 38px rgba(120,255,63,.18);
  transition:.22s ease;
}

.sidebar-fab:hover{
  transform:translateY(-2px);
  box-shadow:0 22px 50px rgba(120,255,63,.25);
}

.mobile-bottom-nav{
  position:fixed;
  left:50%;
  bottom:14px;
  transform:translateX(-50%);
  width:min(560px, calc(100% - 24px));
  z-index:60;
  display:none;
  grid-template-columns:repeat(5, minmax(0,1fr));
  gap:6px;
  padding:8px;
  border:1px solid rgba(120,255,63,.22);
  border-radius:22px;
  background:rgba(3,8,20,.88);
  backdrop-filter: blur(20px);
  box-shadow:0 18px 60px rgba(0,0,0,.42);
}

.mobile-bottom-nav a{
  min-height:52px;
  border-radius:16px;
  display:grid;
  place-items:center;
  gap:2px;
  color:var(--muted);
  text-decoration:none;
  font-size:11px;
  font-weight:900;
  border:1px solid transparent;
}

.mobile-bottom-nav a span{
  font-size:16px;
  line-height:1;
}

.mobile-bottom-nav a b{
  font-size:10px;
  line-height:1;
}

.mobile-bottom-nav a.active{
  color:#fff;
  border-color:rgba(120,255,63,.34);
  background:rgba(120,255,63,.12);
}

body.route-transition .workspace{
  animation: routePulse .22s ease both;
}

@keyframes routePulse{
  from{opacity:.88;transform:translateY(5px)}
  to{opacity:1;transform:translateY(0)}
}

@media (max-width:1120px){
  .sidebar{
    width:auto;
  }
  .sidebar-fab{
    width:100%;
  }
}

@media (max-width:820px){
  body{
    padding-bottom:86px;
  }

  .mobile-bottom-nav{
    display:grid;
  }

  .sidebar{
    padding:18px;
    gap:16px;
  }

  .nav-list{
    display:none;
  }

  .phase-box{
    display:none;
  }

  .sidebar-fab{
    min-height:44px;
  }

  .identity{
    border-bottom:0;
    padding-bottom:4px;
  }

  .identity span{
    font-size:12px;
  }
}


/* ==============================
   MatchIQ Studio V3.0 Workspace Editor
   Preview centrale + timeline professionale + inspector
   ============================== */
:root{
  --editor-glow: rgba(120,255,63,.20);
  --editor-blue-glow: rgba(29,155,255,.22);
}

.phase-box span{ color:var(--accent); }

body.studio-editor-open .workspace{
  max-width: none;
  padding-left: clamp(24px, 3vw, 54px);
  padding-right: clamp(24px, 3vw, 54px);
}

.studio-editor-shell{
  max-width: 1680px;
}

.editor-launch-header{
  position: relative;
  overflow: hidden;
}

.editor-launch-header::after{
  content:"";
  position:absolute;
  right:-80px;
  top:-120px;
  width:260px;
  height:260px;
  border-radius:50%;
  background: radial-gradient(circle, rgba(120,255,63,.18), transparent 68%);
  pointer-events:none;
}

.editor-status-strip{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:12px;
}

.editor-status-strip span{
  padding:7px 10px;
  border:1px solid rgba(120,255,63,.18);
  border-radius:999px;
  color:var(--soft);
  background:rgba(255,255,255,.045);
  font-size:11px;
  font-weight:900;
  text-transform:uppercase;
}

body.studio-editor-open .main-grid{
  max-width:1680px;
  grid-template-columns: minmax(420px, .9fr) minmax(430px, 560px);
  align-items:stretch;
}

body.studio-editor-open .project-panel{
  display:flex;
  flex-direction:column;
}

body.studio-editor-open .phone-panel{
  position:relative;
  min-height:720px;
  align-items:center;
  background:
    radial-gradient(circle at top, rgba(29,155,255,.18), transparent 42%),
    radial-gradient(circle at bottom, rgba(120,255,63,.13), transparent 42%),
    linear-gradient(180deg, rgba(7,20,38,.96), rgba(11,27,51,.84));
}

body.studio-editor-open .phone-panel::before{
  content:"LIVE PREVIEW";
  position:absolute;
  left:20px;
  top:18px;
  color:var(--accent);
  font-size:11px;
  font-weight:950;
  letter-spacing:.5px;
}

body.studio-editor-open .phone{
  width: min(360px, 100%);
  height: 690px;
  border-radius:42px;
  padding:16px;
  border-width:10px;
  box-shadow:
    0 34px 90px rgba(0,0,0,.52),
    0 0 0 1px rgba(255,255,255,.06),
    0 0 60px rgba(120,255,63,.10);
}

body.studio-editor-open .phone-screen{
  height: 626px;
  border-radius:30px;
  padding:30px 24px;
}

body.studio-editor-open .phone-screen h3{
  font-size: clamp(30px, 2.6vw, 42px);
  letter-spacing:-1.1px;
}

body.studio-editor-open .preview-logo{
  width: 164px;
  max-height: 84px;
}

body.studio-editor-open .system-grid{
  max-width:1680px;
  grid-template-columns: minmax(360px, .9fr) minmax(520px, 1.25fr);
  align-items:start;
}

body.studio-editor-open #timeline{
  min-height: 360px;
}

body.studio-editor-open .timeline-list{
  display:flex;
  gap:12px;
  overflow-x:auto;
  padding-bottom:12px;
  scroll-snap-type:x mandatory;
}

body.studio-editor-open .timeline-list::-webkit-scrollbar{
  height:8px;
}

body.studio-editor-open .timeline-list::-webkit-scrollbar-thumb{
  background:rgba(120,255,63,.22);
  border-radius:999px;
}

body.studio-editor-open .timeline-list li{
  min-width:230px;
  min-height:132px;
  grid-template-columns:1fr;
  align-content:space-between;
  gap:8px;
  scroll-snap-align:start;
  background:
    linear-gradient(180deg, rgba(11,27,51,.94), rgba(7,20,38,.96));
  border-color:rgba(255,255,255,.08);
}

body.studio-editor-open .timeline-list li span{
  width:max-content;
  padding:5px 8px;
  border-radius:999px;
  color:#071426;
  background:var(--accent);
}

body.studio-editor-open .timeline-list li p{
  white-space:normal;
  line-height:1.35;
}

body.studio-editor-open .timeline-list li small{
  display:flex;
  align-items:center;
  justify-content:space-between;
  min-height:8px;
  font-size:11px;
}

body.studio-editor-open .timeline-list li small::before{
  content:"";
  display:block;
  flex:1;
  height:6px;
  margin-right:10px;
  border-radius:999px;
  background:linear-gradient(90deg, var(--accent), rgba(29,155,255,.55));
}

body.studio-editor-open .scene-editor-panel{
  grid-column:auto;
  min-height:360px;
  box-shadow: inset 0 0 0 1px rgba(120,255,63,.06);
}

body.studio-editor-open .scene-editor-panel .panel-heading::after{
  content:"INSPECTOR";
  color:var(--accent);
  font-size:11px;
  font-weight:950;
  letter-spacing:.5px;
}

body.studio-editor-open .editor-grid{
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:14px;
}

body.studio-editor-open .editor-grid label{
  padding:12px;
  border:1px solid rgba(255,255,255,.07);
  border-radius:14px;
  background:rgba(255,255,255,.025);
}

body.studio-editor-open .editor-grid .wide{
  grid-column:1 / -1;
}

body.studio-editor-open #brand,
body.studio-editor-open #media{
  min-height:260px;
}

body.studio-editor-open .command-row{
  margin-top:auto;
  padding-top:16px;
  border-top:1px solid rgba(255,255,255,.08);
}

body.studio-editor-open .result-panel:not(.hidden){
  animation: renderReveal .5s ease both;
  border-color:rgba(120,255,63,.28);
  box-shadow:0 24px 80px rgba(0,0,0,.32), 0 0 44px rgba(120,255,63,.08);
}

body.studio-editor-open .result-panel:not(.hidden)::before{
  content:"Render pipeline completata";
  display:block;
  margin-bottom:12px;
  color:var(--accent);
  font-size:12px;
  font-weight:950;
  text-transform:uppercase;
}

@keyframes renderReveal{
  from{opacity:0;transform:translateY(18px) scale(.985)}
  to{opacity:1;transform:translateY(0) scale(1)}
}

@media (max-width:1280px){
  body.studio-editor-open .main-grid,
  body.studio-editor-open .system-grid{
    grid-template-columns:1fr;
  }
  body.studio-editor-open .phone-panel{
    min-height:auto;
  }
  body.studio-editor-open .phone{
    width:310px;
    height:610px;
  }
  body.studio-editor-open .phone-screen{
    height:548px;
  }
}

@media (max-width:820px){
  body.studio-editor-open .workspace{
    padding:14px 14px 92px;
  }
  body.studio-editor-open .main-grid,
  body.studio-editor-open .system-grid{
    gap:14px;
  }
  body.studio-editor-open .phone-panel{
    order:-1;
    padding-top:46px;
  }
  body.studio-editor-open .phone{
    width:min(290px, 96%);
    height:560px;
  }
  body.studio-editor-open .phone-screen{
    height:500px;
  }
  body.studio-editor-open .timeline-list li{
    min-width:210px;
  }
  body.studio-editor-open .editor-grid{
    grid-template-columns:1fr;
  }
  .editor-status-strip{
    display:grid;
    grid-template-columns:1fr 1fr;
  }
}

.workspace-pulse{animation:studioFadeUp .35s ease both;}


/* ==============================
   MatchIQ Studio V3.1 Render Station
   ============================== */
.render-station{
  max-width:1500px;
  margin:20px auto 0;
  border-color:rgba(120,255,63,.18);
  background:
    radial-gradient(circle at top right, rgba(120,255,63,.10), transparent 34%),
    radial-gradient(circle at bottom left, rgba(29,155,255,.12), transparent 38%),
    linear-gradient(180deg,var(--surface),var(--surface-2));
}
.render-heading{
  align-items:center;
}
.render-subtitle{
  margin:8px 0 0;
  color:var(--muted);
  font-size:13px;
  line-height:1.45;
}
.render-actions{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}
.render-dashboard{
  display:grid;
  grid-template-columns:minmax(0,.9fr) minmax(0,1.1fr);
  gap:16px;
}
.render-progress-card{
  min-height:190px;
  padding:20px;
  border:1px solid var(--line);
  border-radius:20px;
  background:rgba(255,255,255,.04);
  display:flex;
  flex-direction:column;
  justify-content:center;
}
.render-progress-top{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:14px;
  margin-bottom:18px;
}
.render-progress-top span{
  color:var(--soft);
  font-weight:900;
  font-size:15px;
}
.render-progress-top strong{
  font-size:42px;
  line-height:.9;
  color:var(--accent);
  text-shadow:0 0 24px rgba(120,255,63,.18);
}
.render-progress-track{
  height:14px;
  border-radius:999px;
  overflow:hidden;
  background:rgba(255,255,255,.08);
  border:1px solid var(--line);
}
.render-progress-track span{
  display:block;
  width:0%;
  height:100%;
  border-radius:999px;
  background:linear-gradient(90deg,var(--accent),var(--accent-2));
  box-shadow:0 0 22px rgba(120,255,63,.28);
  transition:width .35s ease;
}
.render-progress-card p{
  margin:16px 0 0;
  color:var(--muted);
  line-height:1.45;
}
.render-steps{
  display:grid;
  grid-template-columns:repeat(5,minmax(0,1fr));
  gap:10px;
}
.render-step{
  min-height:150px;
  padding:14px;
  border:1px solid var(--line);
  border-radius:18px;
  background:rgba(255,255,255,.035);
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  transition:.22s ease;
}
.render-step span{
  color:var(--accent);
  font-size:11px;
  font-weight:900;
}
.render-step b{
  display:block;
  font-size:15px;
  line-height:1.15;
}
.render-step small{
  color:var(--muted);
  font-weight:800;
}
.render-step.is-active{
  border-color:rgba(120,255,63,.45);
  background:rgba(120,255,63,.08);
  transform:translateY(-3px);
  box-shadow:0 18px 44px rgba(0,0,0,.24);
}
.render-step.is-done{
  border-color:rgba(120,255,63,.32);
}
.render-step.is-done small{
  color:var(--accent);
}
.render-video-head{
  margin:20px 0 14px;
}
.render-station video{
  max-height:680px;
}
@media (max-width:1120px){
  .render-dashboard,
  .render-steps{
    grid-template-columns:1fr;
  }
  .render-step{
    min-height:auto;
    gap:8px;
  }
}
@media (max-width:820px){
  .render-heading{
    align-items:flex-start;
  }
  .render-actions,
  .render-actions .primary-btn,
  .render-actions .ghost-btn{
    width:100%;
  }
  .render-progress-top strong{
    font-size:34px;
  }
}


/* ==============================
   MatchIQ Studio V4.3 Easy Creator
   ============================== */
.easy-creator-panel{
  max-width:1500px;
  margin:0 auto 20px;
  padding:22px;
  border:1px solid rgba(120,255,63,.24);
  border-radius:24px;
  background:
    radial-gradient(circle at top left, rgba(29,155,255,.16), transparent 34%),
    linear-gradient(180deg, rgba(7,20,38,.98), rgba(11,27,51,.88));
}
.easy-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:18px;
  margin-bottom:18px;
}
.easy-head h2{
  margin:8px 0;
  font-size:30px;
  letter-spacing:-.7px;
}
.easy-head p,
.creative-director-box p,
.advanced-settings p{
  margin:0;
  color:var(--muted);
  line-height:1.45;
}
.easy-flow-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:12px;
}
.creative-director-box{
  margin-top:14px;
  padding:16px;
  border:1px solid rgba(29,155,255,.24);
  border-radius:18px;
  background:rgba(255,255,255,.04);
  display:flex;
  justify-content:space-between;
  gap:16px;
}
.creative-director-box span{
  color:var(--accent);
  font-size:12px;
  font-weight:950;
  text-transform:uppercase;
}
.creative-director-box strong{
  display:block;
  margin:7px 0;
  font-size:20px;
}
.director-actions,
.scene-card-actions{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}
.preset-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:10px;
  margin-top:14px;
}
.preset-card{
  min-height:104px;
  padding:14px;
  border:1px solid var(--line);
  border-radius:16px;
  background:rgba(255,255,255,.035);
  color:var(--text);
  text-align:left;
}
.preset-card.is-selected{
  border-color:rgba(120,255,63,.52);
  background:rgba(120,255,63,.10);
}
.preset-card span{
  display:block;
  color:var(--accent);
  font-size:11px;
  font-weight:950;
  text-transform:uppercase;
}
.preset-card strong{
  display:block;
  margin:8px 0 4px;
}
.preset-card small{
  color:var(--muted);
  line-height:1.35;
}
.advanced-settings{
  margin-top:12px;
  border-top:1px solid rgba(255,255,255,.08);
  padding-top:12px;
}
.advanced-settings summary{
  cursor:pointer;
  color:var(--soft);
  font-weight:900;
}
.scene-card-actions{
  grid-column:1 / -1;
  margin-top:4px;
}
.scene-card-actions button{
  min-height:30px;
  padding:0 9px;
  border:1px solid rgba(255,255,255,.10);
  border-radius:999px;
  color:var(--soft);
  background:rgba(255,255,255,.045);
  font-size:11px;
  font-weight:900;
}
.scene-card-actions button:hover{
  border-color:rgba(120,255,63,.42);
  color:#fff;
}
body.studio-editor-open .timeline-list li{
  min-height:164px;
}
@media (max-width:1120px){
  .easy-flow-grid,
  .preset-grid{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  .creative-director-box,
  .easy-head{
    display:grid;
    grid-template-columns:1fr;
  }
}
@media (max-width:720px){
  .easy-flow-grid,
  .preset-grid{
    grid-template-columns:1fr;
  }
  .easy-creator-panel{
    padding:16px;
    border-radius:18px;
  }
}

/* ==============================
   MatchIQ Studio V4.4 Layout + Motion
   ============================== */
html{
  background:#030814;
}
body{
  overflow-x:hidden;
}
body::before{
  content:"";
  position:fixed;
  inset:0;
  z-index:-1;
  pointer-events:none;
  opacity:.22;
  background:
    linear-gradient(90deg, rgba(120,255,63,.06) 1px, transparent 1px),
    linear-gradient(180deg, rgba(29,155,255,.05) 1px, transparent 1px);
  background-size:72px 72px;
  mask-image:linear-gradient(90deg, transparent 0%, #000 18%, #000 82%, transparent 100%);
  animation:studioGridDrift 18s linear infinite;
}
@keyframes studioGridDrift{
  from{background-position:0 0,0 0}
  to{background-position:72px 36px,36px 72px}
}

@media (min-width:1180px){
  .app{
    grid-template-columns:220px minmax(0,1fr);
  }
  .sidebar{
    width:auto;
    padding:22px 18px;
  }
  .workspace{
    width:100%;
    max-width:none;
    margin:0;
    padding:24px clamp(22px, 2vw, 38px);
  }
  .topbar-v24,
  .studio-hero-v24,
  .easy-creator-panel,
  .quick-grid,
  .enterprise-grid-v24,
  .metrics-grid,
  .studio-editor-shell,
  .main-grid,
  .system-grid,
  .render-station,
  .result-panel{
    width:100%;
    max-width:1760px;
    margin-left:0;
    margin-right:auto;
  }
  .topbar-v24{
    display:flex;
    align-items:flex-start;
  }
  .studio-hero-v24{
    grid-template-columns:minmax(0,1.45fr) minmax(340px,.7fr);
    min-height:350px;
  }
  .easy-flow-grid{
    grid-template-columns:1fr 1fr 1fr minmax(320px,1.4fr);
  }
  .quick-grid{
    grid-template-columns:repeat(4,minmax(0,1fr));
  }
  .enterprise-grid-v24{
    grid-template-columns:minmax(0,1.3fr) minmax(280px,.7fr) minmax(280px,.7fr);
  }
  .metrics-grid{
    grid-template-columns:repeat(4,minmax(0,1fr));
  }
  body.studio-editor-open .workspace{
    padding:22px clamp(22px, 2vw, 38px);
  }
  body.studio-editor-open .main-grid{
    width:100%;
    max-width:1760px;
    grid-template-columns:minmax(520px,1fr) minmax(330px,390px);
    gap:18px;
  }
  body.studio-editor-open .system-grid{
    width:100%;
    max-width:1760px;
    grid-template-columns:minmax(390px,.78fr) minmax(560px,1.22fr);
    gap:18px;
  }
  body.studio-editor-open .render-station{
    max-width:1760px;
  }
  body.studio-editor-open .phone-panel{
    min-height:640px;
  }
  body.studio-editor-open .phone{
    width:min(330px,100%);
    height:630px;
  }
  body.studio-editor-open .phone-screen{
    height:568px;
  }
}

.studio-hero-v24,
.easy-creator-panel,
.enterprise-card,
.panel,
.phone-panel,
.render-station{
  position:relative;
}
.studio-hero-v24::before,
.easy-creator-panel::before,
.render-station::before{
  content:"";
  position:absolute;
  inset:0;
  border-radius:inherit;
  pointer-events:none;
  opacity:.0;
  background:linear-gradient(120deg, transparent 0%, rgba(255,255,255,.08) 38%, transparent 62%);
  transform:translateX(-65%);
  transition:opacity .25s ease;
}
.studio-hero-v24:hover::before,
.easy-creator-panel:hover::before,
.render-station:hover::before{
  opacity:1;
  animation:panelSheen 1.15s ease;
}
@keyframes panelSheen{
  from{transform:translateX(-70%)}
  to{transform:translateX(70%)}
}

.quick-card,
.preset-card,
.recent-project-card,
.assistant-list button,
.media-card,
.scene-card-actions button{
  will-change:transform;
}
.quick-card:hover,
.preset-card:hover,
.media-card:hover{
  transform:translateY(-4px);
  box-shadow:0 18px 45px rgba(0,0,0,.28), 0 0 0 1px rgba(120,255,63,.16);
}
.primary-btn{
  position:relative;
  overflow:hidden;
}
.primary-btn::after{
  content:"";
  position:absolute;
  inset:0;
  background:linear-gradient(110deg, transparent 0%, rgba(255,255,255,.38) 42%, transparent 58%);
  transform:translateX(-120%);
}
.primary-btn:hover::after{
  animation:buttonSweep .72s ease;
}
@keyframes buttonSweep{
  to{transform:translateX(120%)}
}

.phone-screen[data-has-image="true"]{
  animation:imageBreath 8s ease-in-out infinite;
}
@keyframes imageBreath{
  0%,100%{background-size:100% auto}
  50%{background-size:108% auto}
}
.preview-copy{
  text-shadow:0 8px 28px rgba(0,0,0,.58);
}
.preview-line{
  box-shadow:0 0 22px rgba(120,255,63,.45);
}

.timeline-list li.selected{
  box-shadow:0 0 0 1px rgba(120,255,63,.38), 0 18px 42px rgba(0,0,0,.22);
}
.scene-card-actions button{
  transition:.18s ease;
}
.scene-card-actions button:hover{
  transform:translateY(-2px);
  background:rgba(120,255,63,.12);
}

.render-progress-track span{
  position:relative;
  overflow:hidden;
}
.render-progress-track span::after{
  content:"";
  position:absolute;
  inset:0;
  background:linear-gradient(90deg, transparent, rgba(255,255,255,.34), transparent);
  animation:progressFlow 1.4s linear infinite;
}
@keyframes progressFlow{
  from{transform:translateX(-100%)}
  to{transform:translateX(100%)}
}
.render-step.is-active{
  animation:stepPulse 1.15s ease-in-out infinite;
}
@keyframes stepPulse{
  0%,100%{box-shadow:0 0 0 rgba(120,255,63,0)}
  50%{box-shadow:0 0 32px rgba(120,255,63,.18)}
}

@media (prefers-reduced-motion: reduce){
  *,
  *::before,
  *::after{
    animation-duration:.01ms !important;
    animation-iteration-count:1 !important;
    scroll-behavior:auto !important;
  }
}

@media (max-width:820px){
  .workspace{
    padding:16px 14px 92px;
  }
  .easy-head .primary-btn,
  .top-actions .primary-btn,
  .top-actions .ghost-btn{
    width:100%;
  }
  .top-actions{
    width:100%;
    display:grid;
    grid-template-columns:1fr 1fr;
  }
  .studio-hero-v24 h2{
    font-size:38px;
    letter-spacing:-1px;
  }
  .phone-panel{
    padding:14px;
  }
}

/* ==============================
   MatchIQ Studio V4.5 Center + Reel FX
   ============================== */
@media (min-width:1180px){
  .workspace{
    display:flex;
    flex-direction:column;
    align-items:center;
    padding-left:clamp(22px,2vw,38px);
    padding-right:clamp(22px,2vw,38px);
  }
  .topbar-v24,
  .studio-hero-v24,
  .easy-creator-panel,
  .quick-grid,
  .enterprise-grid-v24,
  .metrics-grid,
  .studio-editor-shell,
  .main-grid,
  .system-grid,
  .render-station,
  .result-panel{
    width:min(100%, 1500px);
    max-width:1500px;
    margin-left:auto !important;
    margin-right:auto !important;
  }
  .studio-hero-v24{
    grid-template-columns:minmax(0,1.2fr) minmax(340px,.8fr);
  }
  .easy-flow-grid{
    grid-template-columns:1fr 1fr 1fr minmax(280px,1.15fr);
  }
  body.studio-editor-open .main-grid,
  body.studio-editor-open .system-grid,
  body.studio-editor-open .render-station{
    width:min(100%, 1560px);
    max-width:1560px;
  }
  body.studio-editor-open .main-grid{
    grid-template-columns:minmax(520px,1fr) minmax(330px,410px);
  }
  body.studio-editor-open .system-grid{
    grid-template-columns:minmax(390px,.82fr) minmax(560px,1.18fr);
  }
}
.studio-hero-v24,
.easy-creator-panel,
.quick-card,
.enterprise-card,
.panel,
.render-station{
  transform-origin:center;
}
.phone-screen[data-visual-style="social"] .preview-copy,
.phone-screen[data-visual-style="captions"] .preview-copy{
  animation:copyPunch 2.4s ease-in-out infinite;
}
.phone-screen[data-visual-style="neon"] .motion-light{
  opacity:.82;
  animation-duration:2.8s;
}
@keyframes copyPunch{
  0%,100%{transform:translateY(0) scale(1)}
  12%{transform:translateY(-10px) scale(1.035)}
  24%{transform:translateY(0) scale(1)}
}

/* ==============================
   MatchIQ Studio V4.6 Auth
   ============================== */
body.auth-locked{
  min-height:100vh;
  overflow:hidden;
}
body.auth-locked .app,
body.auth-locked .mobile-bottom-nav{
  display:none;
}
.auth-shell{
  min-height:100vh;
  display:grid;
  grid-template-columns:minmax(0,1.05fr) minmax(420px,.72fr);
  gap:28px;
  align-items:center;
  width:min(1180px, calc(100% - 40px));
  margin:0 auto;
  padding:34px 0;
}
.auth-shell[hidden]{
  display:none;
}
.auth-brand-panel,
.auth-card{
  border:1px solid rgba(120,255,63,.20);
  border-radius:28px;
  background:
    radial-gradient(circle at top left, rgba(29,155,255,.20), transparent 36%),
    linear-gradient(180deg, rgba(7,20,38,.98), rgba(3,8,20,.94));
  box-shadow:0 30px 90px rgba(0,0,0,.38);
}
.auth-brand-panel{
  min-height:620px;
  padding:42px;
  display:flex;
  flex-direction:column;
  justify-content:flex-end;
  overflow:hidden;
  position:relative;
}
.auth-brand-panel::before{
  content:"";
  position:absolute;
  inset:36px;
  border:1px solid rgba(120,255,63,.13);
  border-radius:24px;
  background:
    linear-gradient(90deg, rgba(120,255,63,.06) 1px, transparent 1px),
    linear-gradient(180deg, rgba(29,155,255,.05) 1px, transparent 1px);
  background-size:54px 54px;
  mask-image:linear-gradient(180deg, transparent 0%, #000 24%, #000 100%);
}
.auth-brand-panel img,
.auth-brand-panel span,
.auth-brand-panel h1,
.auth-brand-panel p,
.auth-proof-grid{
  position:relative;
  z-index:1;
}
.auth-brand-panel img{
  width:210px;
  max-height:100px;
  object-fit:contain;
  object-position:left center;
  margin-bottom:auto;
}
.auth-brand-panel span{
  color:var(--accent);
  font-size:12px;
  font-weight:950;
  text-transform:uppercase;
}
.auth-brand-panel h1{
  max-width:720px;
  margin:16px 0;
  font-size:clamp(42px, 5vw, 70px);
  line-height:.96;
  letter-spacing:-2px;
}
.auth-brand-panel p{
  max-width:620px;
  color:var(--muted);
  font-size:16px;
  line-height:1.6;
}
.auth-proof-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:10px;
  margin-top:24px;
}
.auth-proof-grid div{
  padding:16px;
  border:1px solid var(--line);
  border-radius:16px;
  background:rgba(255,255,255,.045);
}
.auth-proof-grid strong,
.auth-proof-grid small{
  display:block;
}
.auth-proof-grid strong{
  font-size:26px;
}
.auth-proof-grid small{
  margin-top:5px;
  color:var(--muted);
}
.auth-card{
  padding:28px;
}
.auth-card-head h2{
  margin:8px 0;
  font-size:32px;
  letter-spacing:-.8px;
}
.auth-card-head p{
  color:var(--muted);
  line-height:1.45;
}
.auth-tabs{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:8px;
  margin:20px 0;
  padding:6px;
  border:1px solid var(--line);
  border-radius:14px;
  background:rgba(255,255,255,.04);
}
.auth-tabs button{
  min-height:42px;
  border:0;
  border-radius:10px;
  color:var(--muted);
  background:transparent;
  font-weight:950;
}
.auth-tabs button.active{
  color:#06120d;
  background:var(--accent);
}
.auth-form{
  display:grid;
  gap:14px;
}
.auth-submit{
  width:100%;
  margin-top:4px;
}
.auth-status{
  min-height:20px;
  margin:0;
  color:var(--muted);
  font-size:13px;
  line-height:1.4;
}
#logoutBtn{
  min-width:76px;
}
@media (max-width:980px){
  body.auth-locked{
    overflow:auto;
  }
  .auth-shell{
    grid-template-columns:1fr;
    width:min(720px, calc(100% - 28px));
  }
  .auth-brand-panel{
    min-height:auto;
    padding:28px;
  }
}
@media (max-width:560px){
  .auth-proof-grid{
    grid-template-columns:1fr;
  }
  .auth-card,
  .auth-brand-panel{
    padding:20px;
    border-radius:20px;
  }
  .auth-brand-panel h1{
    font-size:38px;
  }
}

/* ==============================
   MatchIQ Studio V5.5 Timeline + Render QA
   ============================== */
body.studio-editor-open .system-grid{
  grid-template-columns:1fr;
  gap:18px;
}

body.studio-editor-open #timeline{
  grid-column:1 / -1;
  min-height:0;
  overflow:visible;
}

body.studio-editor-open .timeline-list{
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(156px, 1fr));
  gap:12px;
  overflow:visible;
  padding-bottom:0;
  scroll-snap-type:none;
}

body.studio-editor-open .timeline-list li{
  min-width:0;
  min-height:158px;
  padding:12px;
  grid-template-columns:1fr;
  grid-template-rows:auto minmax(48px, 1fr) auto auto;
  align-content:stretch;
  gap:8px;
  border-radius:14px;
}

body.studio-editor-open .timeline-list li span{
  width:34px;
  height:34px;
  display:grid;
  place-items:center;
  padding:0;
  font-size:13px;
}

body.studio-editor-open .timeline-list li p{
  white-space:normal;
  display:-webkit-box;
  -webkit-line-clamp:3;
  -webkit-box-orient:vertical;
  overflow:hidden;
  min-height:50px;
  font-size:13px;
  line-height:1.28;
}

body.studio-editor-open .timeline-list li small{
  min-height:14px;
  font-size:10px;
  gap:7px;
}

body.studio-editor-open .timeline-list li small::before{
  height:5px;
  margin-right:0;
}

body.studio-editor-open .scene-card-actions{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:7px;
  margin-top:2px;
}

body.studio-editor-open .scene-card-actions button{
  min-width:0;
  min-height:28px;
  padding:0 6px;
  font-size:10px;
}

body.studio-editor-open .scene-editor-panel{
  grid-column:1 / -1;
}

@media (min-width:1280px){
  body.studio-editor-open .scene-editor-panel .editor-grid{
    grid-template-columns:repeat(3, minmax(0,1fr));
  }
  body.studio-editor-open .scene-editor-panel .editor-grid .wide{
    grid-column:1 / -1;
  }
}

@media (max-width:720px){
  body.studio-editor-open .timeline-list{
    grid-template-columns:repeat(2, minmax(0,1fr));
  }
}

