:root {
  color-scheme: dark;
  --bg: #07070b;
  --panel: #10111a;
  --panel-strong: #171827;
  --panel-soft: #0c0d14;
  --text: #f8f3ff;
  --muted: #aaa2bb;
  --line: rgba(255, 255, 255, 0.1);
  --pink: #ff2db2;
  --purple: #7b35ff;
  --orange: #ff7a2f;
  --gold: #f8c35a;
  --green: #32d583;
  --red: #ff5678;
  --blue: #55b8ff;
  --radius: 8px;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.5);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 0%, rgba(255, 45, 178, 0.13), transparent 30%),
    radial-gradient(circle at 90% 12%, rgba(255, 122, 47, 0.12), transparent 26%),
    linear-gradient(135deg, #050507, #0a0a12 48%, #120812);
  color: var(--text);
}

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

button {
  cursor: pointer;
}

:focus-visible {
  outline: 3px solid rgba(248, 195, 90, 0.88);
  outline-offset: 3px;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 18px;
  background: rgba(7, 7, 11, 0.92);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 18px;
  z-index: 10;
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
  font-weight: 800;
  letter-spacing: 0;
}

.brand img {
  width: 42px;
  height: 42px;
  object-fit: cover;
  border-radius: 8px;
}

#primaryNav {
  display: grid;
  gap: 6px;
}

.nav-link {
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 42px;
  padding: 9px 10px;
  border-radius: var(--radius);
  text-align: left;
}

.nav-link span:first-child {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.nav-link.active,
.nav-link:hover {
  color: var(--text);
  background: linear-gradient(135deg, rgba(123, 53, 255, 0.24), rgba(255, 45, 178, 0.12));
  border-color: rgba(255, 255, 255, 0.1);
}

.design-swatch {
  min-height: 90px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  padding: 12px;
  display: flex;
  align-items: flex-end;
  font-weight: 800;
}

.swatch-pink { background: var(--pink); }
.swatch-purple { background: var(--purple); }
.swatch-orange { background: var(--orange); }
.swatch-gold { background: var(--gold); color: #17110a; }
.swatch-panel { background: var(--panel); }
.swatch-black { background: var(--bg); }

.phase-card,
.card,
.metric-card,
.panel,
.phone-frame,
.tv-frame {
  border: 1px solid var(--line);
  background: rgba(16, 17, 26, 0.82);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.phase-card {
  margin-top: auto;
  padding: 14px;
}

.phase-card span,
.eyebrow,
.tag,
.status {
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0;
  font-size: 0.72rem;
  font-weight: 800;
}

.phase-card strong {
  display: block;
  margin: 6px 0;
}

.phase-card small,
.muted,
.copy,
.meta {
  color: var(--muted);
}

main {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 8;
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 28px;
  background: rgba(7, 7, 11, 0.82);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(1.55rem, 2vw, 2.35rem);
}

h2 {
  font-size: clamp(1.28rem, 2vw, 1.9rem);
}

h3 {
  font-size: 1rem;
}

.top-actions,
.actions,
.pill-row,
.tabs,
.toolbar,
.status-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.primary-button,
.ghost-button,
.icon-button,
.chip {
  min-height: 38px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  color: var(--text);
}

.primary-button {
  border: 0;
  padding: 0 16px;
  background: linear-gradient(135deg, var(--pink), var(--orange));
  font-weight: 800;
}

.ghost-button,
.icon-button,
.chip {
  background: rgba(255, 255, 255, 0.05);
  padding: 0 12px;
}

.icon-button {
  min-width: 40px;
  padding: 0;
}

.menu-button {
  display: none;
}

.mobile-backdrop {
  display: none;
}

.view {
  padding: 28px;
}

.hero {
  min-height: 500px;
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(320px, 1.05fr);
  gap: 24px;
  align-items: stretch;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(24px, 4vw, 48px);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(123, 53, 255, 0.16), rgba(255, 45, 178, 0.08)),
    rgba(16, 17, 26, 0.7);
  border: 1px solid var(--line);
}

.hero-copy h2 {
  font-size: clamp(2.1rem, 5vw, 4.9rem);
  line-height: 0.96;
  margin-bottom: 18px;
}

.hero-media {
  min-height: 420px;
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  border: 1px solid var(--line);
}

.hero-media img,
.poster img,
.asset-card img,
.phone-frame img,
.tv-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(7, 7, 11, 0.65), transparent 48%);
}

.section {
  margin-top: 28px;
}

.section-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 14px;
}

.grid {
  display: grid;
  gap: 14px;
}

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

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

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

.card,
.panel,
.metric-card {
  padding: 16px;
}

.card.compact {
  padding: 12px;
}

.poster {
  aspect-ratio: 16 / 10;
  border-radius: var(--radius);
  overflow: hidden;
  background: #171827;
  border: 1px solid var(--line);
  margin-bottom: 12px;
}

.poster.tall {
  aspect-ratio: 3 / 4;
}

.metric-card strong {
  display: block;
  margin: 7px 0;
  font-size: 1.55rem;
}

.metric-card small {
  color: var(--green);
}

.shelf {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(180px, 1fr);
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 8px;
}

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

.phone-frame {
  aspect-ratio: 9 / 16;
  overflow: hidden;
}

.tv-frame {
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.tv-rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(220px, 1fr);
  gap: 16px;
  overflow-x: auto;
  padding: 8px 0 12px;
}

.tv-card {
  min-height: 150px;
  border: 2px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.tv-card.focused {
  border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(248, 195, 90, 0.15), 0 24px 70px rgba(0, 0, 0, 0.55);
  background: linear-gradient(135deg, rgba(248, 195, 90, 0.16), rgba(255, 45, 178, 0.1));
}

.remote-hints {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.remote-hints span {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius);
  padding: 8px 10px;
  color: var(--muted);
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  color: var(--muted);
}

th {
  color: var(--text);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(248, 195, 90, 0.12);
  border: 1px solid rgba(248, 195, 90, 0.25);
}

.status.good {
  color: var(--green);
  background: rgba(50, 213, 131, 0.12);
  border-color: rgba(50, 213, 131, 0.25);
}

.status.warn {
  color: var(--orange);
  background: rgba(255, 122, 47, 0.12);
  border-color: rgba(255, 122, 47, 0.25);
}

.status.bad {
  color: var(--red);
  background: rgba(255, 86, 120, 0.12);
  border-color: rgba(255, 86, 120, 0.25);
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
  gap: 14px;
}

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

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.85rem;
}

input,
select,
textarea {
  min-height: 42px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  padding: 10px;
}

textarea {
  min-height: 110px;
  resize: vertical;
}

.shorts-layout {
  display: grid;
  grid-template-columns: minmax(260px, 380px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.short-card {
  aspect-ratio: 9 / 16;
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}

.short-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.short-overlay {
  position: absolute;
  inset: auto 0 0;
  padding: 18px;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.82), transparent);
}

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

.asset-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
}

.asset-card img {
  aspect-ratio: 16 / 10;
}

.asset-card span {
  display: block;
  padding: 8px;
  color: var(--muted);
  font-size: 0.78rem;
}

.hide {
  display: none;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 30;
  max-width: min(420px, calc(100vw - 32px));
  padding: 12px 14px;
  border: 1px solid rgba(50, 213, 131, 0.32);
  background: rgba(16, 17, 26, 0.96);
  color: var(--text);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transform: translateY(120%);
  opacity: 0;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

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

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(88vw, 320px);
    transform: translateX(-105%);
    transition: transform 0.2s ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  body.nav-open {
    overflow: hidden;
  }

  body.nav-open::after {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 9;
  }

  .menu-button {
    display: inline-grid;
    place-items: center;
  }

  .hero,
  .split,
  .shorts-layout {
    grid-template-columns: 1fr;
  }

  .grid.cols-3,
  .grid.cols-4,
  .phone-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topbar {
    gap: 12px;
  }
}

@media (max-width: 680px) {
  .brand span {
    font-size: 0.95rem;
  }

  .topbar {
    align-items: flex-start;
    padding: 14px;
    min-height: 72px;
  }

  .top-actions {
    display: none;
  }

  .view {
    padding: 14px;
  }

  h1 {
    font-size: 1.28rem;
  }

  h2 {
    font-size: 1.18rem;
    line-height: 1.15;
  }

  .eyebrow,
  .tag,
  .status {
    font-size: 0.68rem;
  }

  .hero-copy {
    padding: 18px;
  }

  .hero-media {
    min-height: 240px;
  }

  .hero {
    min-height: auto;
    gap: 14px;
  }

  .card,
  .panel,
  .metric-card {
    padding: 13px;
  }

  .actions,
  .toolbar {
    align-items: stretch;
  }

  .actions > *,
  .toolbar > * {
    flex: 1 1 100%;
  }

  .primary-button,
  .ghost-button,
  .chip {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  .grid.cols-2,
  .grid.cols-3,
  .grid.cols-4,
  .phone-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .shelf {
    grid-auto-columns: minmax(150px, 72vw);
  }

  .tv-rail {
    grid-auto-columns: minmax(180px, 78vw);
  }

  .table-wrap {
    margin-inline: -4px;
  }

  table {
    min-width: 640px;
  }

  th,
  td {
    padding: 10px;
  }

  .phone-frame {
    max-height: 560px;
  }

  .toast {
    left: 10px;
    right: 10px;
    bottom: 10px;
  }
}

@media (max-width: 420px) {
  .view {
    padding: 10px;
  }

  .topbar {
    padding: 12px 10px;
  }

  .hero-copy h2 {
    font-size: 1.85rem;
  }

  .metric-card strong {
    font-size: 1.28rem;
  }
}
