*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
@font-face {
    font-family: 'Paperozi';
    src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/2408-3@1.0/Paperlogy-5Medium.woff2') format('woff2');
    font-weight: 500;
    font-display: swap;
}
:root {
  --bg-void: #f6f8fb;
  --bg-rail: #0f172a;
  --bg-panel: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #fbfdff;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --accent: #1769e0;
  --accent-strong: #0f4fb3;
  --accent-soft: rgba(23, 105, 224, 0.11);
  --teal: #14b8a6;
  --coral: #ff7a59;
  --gold: #f5c451;
  --ok: #10b981;
  --ok-soft: rgba(16, 185, 129, 0.12);
  --text-primary: #111827;
  --text-secondary: #516070;
  --text-muted: #94a3b8;
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 18px 40px rgba(15, 23, 42, 0.14);
}

body {
  font-family: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, system-ui, Roboto, 'Helvetica Neue', 'Segoe UI', 'Apple SD Gothic Neo', 'Noto Sans KR', 'Malgun Gothic', 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', sans-serif;
  background: linear-gradient(180deg, #fbfdff 0%, var(--bg-void) 100%);
  color: var(--text-primary);
  height: 100vh;
  overflow: hidden;
  display: flex;
  -webkit-font-smoothing: antialiased;
}

/* Sidebar */
#sidebar {
  width: 272px;
  min-width: 272px;
  background: var(--bg-rail);
  border-right: 1px solid rgba(255,255,255,0.08);
  display: flex;
  flex-direction: column;
  padding: 0;
  position: relative;
  z-index: 10;
}

.logo-area {
  padding: 31px 22px 27px;
  display: flex; align-items: center; gap: 14px;
}

.logo-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--accent), #5eead4);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 24px rgba(23, 105, 224, 0.28);
}

.logo-text { font-weight: 800; font-size: 22px; letter-spacing: 0; color: #ffffff; }
.logo-sub { font-size: 11px; color: #93a4ba; font-weight: 600; margin-top: 1px; text-transform: uppercase; letter-spacing: 0.05em; }

.brand-logo-img {
  display: block;
  width: 112px;
  height: auto;
  object-fit: contain;
}

.sidebar-brand-logo {
  width: 154px;
}

.index-brand {
  min-height: 44px;
  padding: 0;
  border-radius: var(--radius-md);
  background: transparent;
}

nav { padding: 0 16px; flex: 1; }
.nav-section-label { font-size: 11px; color: #71839a; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: 22px 12px 10px; }

.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; border-radius: var(--radius-sm);
  font-size: 14px; color: #c3cedb;
  cursor: pointer; margin-bottom: 4px;
  transition: all .2s ease;
  font-weight: 600;
  text-decoration: none;
}

.nav-item:hover { background: rgba(255,255,255,0.07); color: #ffffff; }
.nav-item.active {
  background: #ffffff;
  color: var(--bg-rail);
  box-shadow: 0 12px 30px rgba(0,0,0,0.18);
}

.nav-item .badge {
  margin-left: auto; background: rgba(255,255,255,0.12); color: #cbd5e1;
  font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 10px;
}
.nav-item.active .badge { background: var(--accent); color: #ffffff; }

.sidebar-footer { padding: 22px 16px; border-top: 1px solid rgba(255,255,255,0.08); }

/* Main */
#main { flex: 1; display: flex; flex-direction: column; overflow: hidden; background: #ffffff; }

/* Header */
header {
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  padding: 0 36px;
  height: 76px;
  display: flex; align-items: center; gap: 24px;
  flex-shrink: 0;
}

.header-title-group { display: flex; flex-direction: column; gap: 4px; min-width: 210px; }
.header-title { font-weight: 800; font-size: 20px; letter-spacing: 0; }
.header-subtitle { font-size: 12px; color: var(--text-muted); font-weight: 700; }
.mobile-header-logo { display: none; }
.header-spacer { flex: 1; }

.search-bar {
  background: #f8fafc; border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 10px 18px;
  display: flex; align-items: center; gap: 12px;
  width: min(34vw, 360px);
  transition: all .2s;
}

.search-bar:focus-within { background: #ffffff; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.search-bar input {
  background: transparent; border: none; outline: none;
  color: var(--text-primary); font-size: 14px; font-weight: 500;
  width: 100%;
}
.search-bar input::placeholder { color: var(--text-muted); }

.header-action-btn {
  width: 44px; height: 44px; border-radius: var(--radius-md);
  background: #ffffff; border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; position: relative;
  transition: all .2s;
  color: var(--text-secondary);
}
.header-action-btn:hover { border-color: var(--accent); color: var(--accent); box-shadow: var(--shadow-sm); }
.notif-dot { position: absolute; top: 12px; right: 12px; width: 8px; height: 8px; background: var(--accent); border-radius: 50%; border: 2px solid #ffffff; }

.avatar {
  width: 44px; height: 44px; border-radius: var(--radius-md);
  background: #f1f5f9; color: var(--text-primary);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 15px;
  cursor: pointer; border: 1px solid var(--border);
}

.header-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 800;
  padding: 10px 8px;
  transition: color .2s ease;
}

.header-link:hover { color: var(--accent); }

.header-cta {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: var(--bg-rail);
  color: #ffffff;
  text-decoration: none;
  font-size: 14px;
  font-weight: 850;
  box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}

.header-cta:hover {
  transform: translateY(-1px);
  background: var(--accent);
  box-shadow: var(--shadow-md);
}

.header-cta svg,
.header-link svg,
.nav-item svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.index-brand {
  display: inline-flex;
  align-items: center;
  gap: 0;
  color: inherit;
  text-decoration: none;
}

.index-brand > span:last-child {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

/* Content Area */
#content {
  flex: 1; 
  overflow-y: auto;
  padding: 34px 36px 44px;
  background:
    linear-gradient(180deg, rgba(248, 250, 252, 0.6) 0%, rgba(246, 248, 251, 1) 440px),
    var(--bg-void);
  height: 100%; /* Ensure it fills parent */
  scroll-behavior: smooth;
}

/* Index page */
.index-page {
  display: block;
  min-height: 100vh;
  height: auto;
  overflow: auto;
  background:
    linear-gradient(180deg, #ffffff 0%, #f6f8fb 100%);
}

.index-page #main {
  min-height: 100vh;
  width: 100%;
}

.index-page header {
  position: sticky;
  top: 0;
  z-index: 20;
}

.index-page #content {
  padding: 28px 30px 44px;
}

.index-hero {
  min-height: clamp(620px, 78vh, 820px);
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  display: grid;
  grid-template-columns: minmax(0, .92fr) minmax(380px, .72fr);
  align-items: center;
  gap: clamp(24px, 4vw, 58px);
  padding: clamp(30px, 5.4vw, 74px);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: var(--shadow-lg);
}

.index-hero-media {
  position: absolute;
  inset: 0;
  background-image: url("../assets/bg_studio.png");
  background-size: cover;
  background-position: center;
  transform: scale(1.04);
}

.index-hero-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(2, 6, 23, 0.93) 0%, rgba(15, 23, 42, 0.78) 46%, rgba(15, 23, 42, 0.34) 100%),
    linear-gradient(180deg, rgba(2, 6, 23, 0.1) 0%, rgba(2, 6, 23, 0.76) 100%);
}

.index-hero-copy,
.index-studio-preview {
  position: relative;
  z-index: 1;
}

.index-hero-copy h1 {
  margin-top: 0;
  font-family: 'Paperozi', 'Pretendard Variable', Pretendard, sans-serif;
  font-size: clamp(40px, 5vw, 68px);
  line-height: 1.18;
  font-weight: normal;
  letter-spacing: 0;
  word-break: keep-all;
}

.index-hero-copy p {
  max-width: 660px;
  margin-top: 24px;
  color: rgba(255, 255, 255, .84);
  font-size: clamp(18px, 2.1vw, 25px);
  line-height: 1.48;
  font-weight: 650;
  word-break: keep-all;
}

.index-studio-preview {
  align-self: center;
  padding: 0;
  border-radius: var(--radius-lg);
  background: transparent;
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
}

.studio-screen {
  min-height: 360px;
  aspect-ratio: 16 / 10;
  position: relative;
  overflow: visible;
  border-radius: var(--radius-md);
  background: transparent;
  border: 0;
  box-shadow: none;
  perspective: 1100px;
}

.studio-screen::before {
  content: "";
  position: absolute;
  left: 7%;
  right: 15%;
  top: 50%;
  aspect-ratio: 16 / 9;
  translate: 0 -50%;
  border-radius: 20px;
  background:
    radial-gradient(circle at 50% 50%, rgba(94, 234, 212, .22), transparent 62%),
    radial-gradient(circle at 22% 80%, rgba(245, 196, 81, .16), transparent 38%);
  filter: blur(18px);
  opacity: .82;
  transform: rotateX(34deg) rotateZ(-7deg) scale(1.08);
  pointer-events: none;
}

.service-flow {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
}

.layer-stage {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
}

.merge-layer {
  position: absolute;
  left: 7%;
  right: 15%;
  top: 50%;
  aspect-ratio: 16 / 9;
  height: auto;
  border-radius: 18px;
  overflow: hidden;
  transform-origin: center;
  translate: 0 -50%;
  border: 1px solid rgba(255,255,255,.58);
  box-shadow: 0 28px 60px rgba(15, 23, 42, .22);
}

.video-layer {
  z-index: 2;
  background:
    linear-gradient(180deg, rgba(15, 23, 42, .06), rgba(15, 23, 42, .26)),
    url("../assets/bg_cyber.png") center/cover;
  animation: videoLayerMerge 7.4s ease-in-out infinite;
}

.video-layer::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(255,255,255,.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.1) 1px, transparent 1px);
  background-size: 42px 42px;
  opacity: .22;
}

.source-topbar {
  position: absolute;
  left: 16px;
  top: 16px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  background: rgba(15, 23, 42, .72);
  color: #ffffff;
  border: 1px solid rgba(255,255,255,.16);
}

.source-topbar span {
  padding: 4px 7px;
  border-radius: 6px;
  background: var(--coral);
  font-size: 10px;
  font-weight: 950;
}

.source-topbar b {
  font-size: 12px;
  font-weight: 900;
}

.countdown-layer,
.ticker-layer {
  z-index: 4;
  background: transparent;
  border-color: rgba(23, 105, 224, .44);
  box-shadow: 0 24px 56px rgba(23, 105, 224, .18);
}

.countdown-layer::before,
.ticker-layer::before {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: 14px;
  border: 1px dashed rgba(23, 105, 224, .42);
  opacity: .58;
  pointer-events: none;
  animation: layerGuideFade 7.4s ease-in-out infinite;
}

.countdown-layer {
  animation: countdownLayerMerge 7.4s ease-in-out infinite;
}

.ticker-layer {
  z-index: 5;
  animation: tickerLayerMerge 7.4s ease-in-out infinite;
}

.output-layer {
  z-index: 6;
  pointer-events: none;
  background: transparent;
  border: 2px solid rgba(94, 234, 212, .84);
  box-shadow:
    0 0 0 1px rgba(255,255,255,.42) inset,
    0 22px 68px rgba(20, 184, 166, .34);
  animation: outputLayerReveal 7.4s ease-in-out infinite;
}

.live-output-panel {
  position: absolute;
  left: 11%;
  right: 7%;
  top: 20%;
  height: 58%;
  z-index: 3;
  transform: rotateX(58deg) rotateZ(-10deg);
  transform-origin: center;
  border-radius: 18px;
  background: #0f172a;
  box-shadow: 0 32px 62px rgba(15, 23, 42, .28);
  animation: livePanelFloat 8s ease-in-out infinite;
}

.live-output-panel::after {
  content: "";
  position: absolute;
  inset: 100% 8% auto;
  height: 18px;
  border-radius: 0 0 18px 18px;
  background: #111827;
  transform: skewX(-34deg);
  transform-origin: top;
  opacity: .86;
}

.live-video {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(15, 23, 42, .16), rgba(15, 23, 42, .38)),
    url("../assets/bg_cyber.png") center/cover;
  border: 1px solid rgba(255,255,255,.52);
}

.live-status {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 4;
  padding: 8px 11px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,.94);
  color: #0f172a;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .06em;
}

.flow-card {
  position: absolute;
  z-index: 6;
  width: 210px;
  padding: 16px;
  border-radius: var(--radius-md);
  background: rgba(255,255,255,.94);
  border: 1px solid rgba(203, 213, 225, .9);
  box-shadow: 0 18px 38px rgba(15, 23, 42, .16);
  color: #0f172a;
  backdrop-filter: blur(12px);
}

.flow-card strong {
  display: block;
  margin-top: 6px;
  font-size: 16px;
  line-height: 1.25;
  font-weight: 950;
}

.flow-label {
  color: var(--accent);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.template-picker {
  left: 6%;
  top: 9%;
  animation: cardSelect 8s ease-in-out infinite;
}

.template-list {
  display: grid;
  gap: 7px;
  margin-top: 13px;
}

.template-list span {
  display: flex;
  align-items: center;
  min-height: 28px;
  padding: 6px 9px;
  border-radius: var(--radius-sm);
  background: #f1f5f9;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 850;
}

.template-list span.active {
  background: var(--accent);
  color: #ffffff;
}

.url-builder {
  right: 6%;
  top: 8%;
  width: 238px;
  animation: cardGenerate 8s ease-in-out infinite;
}

.url-builder code {
  display: block;
  margin-top: 12px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  background: #0f172a;
  color: #5eead4;
  font-size: 11px;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.url-progress {
  height: 6px;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e8f0;
}

.url-progress span {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--teal));
  transform-origin: left;
  animation: urlBuild 8s ease-in-out infinite;
}

.output-badge {
  position: absolute;
  right: 7%;
  bottom: 12%;
  z-index: 7;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 10px 13px;
  border-radius: var(--radius-md);
  background: #0f172a;
  color: #ffffff;
  border: 1px solid rgba(255,255,255,.16);
  box-shadow: 0 16px 30px rgba(15, 23, 42, .25);
  font-size: 13px;
  font-weight: 900;
  animation: outputPulse 8s ease-in-out infinite;
}

.output-badge svg {
  width: 17px;
  height: 17px;
  color: #5eead4;
}

.flow-arrow {
  position: absolute;
  z-index: 5;
  width: 76px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent));
  opacity: .74;
}

.flow-arrow::after {
  content: "";
  position: absolute;
  right: -1px;
  top: -4px;
  width: 10px;
  height: 10px;
  border-top: 2px solid var(--accent);
  border-right: 2px solid var(--accent);
  transform: rotate(45deg);
}

.arrow-one {
  left: 38%;
  top: 21%;
  --arrow-rotate: 7deg;
  transform: rotate(var(--arrow-rotate));
  animation: arrowBlink 8s ease-in-out infinite;
}

.arrow-two {
  right: 25%;
  bottom: 22%;
  --arrow-rotate: 34deg;
  transform: rotate(var(--arrow-rotate));
  animation: arrowBlink 8s ease-in-out infinite .9s;
}

.screen-ticker {
  position: absolute;
  z-index: 4;
}

.countdown-preview {
  position: absolute;
  left: -28%;
  top: -44%;
  z-index: 2;
  width: 156%;
  height: 176%;
  border: 0;
  background: transparent;
  pointer-events: none;
}

.screen-ticker span {
  color: var(--accent);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .08em;
}

.screen-ticker {
  left: 0;
  right: 0;
  bottom: 0;
  min-height: 46px;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  background: rgba(3, 7, 18, .92);
}

.screen-ticker span {
  height: 46px;
  display: grid;
  place-items: center;
  padding: 0 15px;
  background: var(--teal);
  color: #03121f;
}

.ticker-window {
  min-width: 0;
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent 0, #000 24px, #000 calc(100% - 24px), transparent 100%);
}

.ticker-track {
  width: max-content;
  display: flex;
  align-items: center;
  gap: 38px;
  animation: tickerMarquee 24s linear infinite;
  will-change: transform;
}

.screen-ticker p {
  margin: 0;
  padding: 0;
  color: rgba(255,255,255,.84);
  font-size: 13px;
  font-weight: 750;
  white-space: nowrap;
}

.screen-ticker p::after {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-left: 38px;
  border-radius: 999px;
  background: var(--accent);
  vertical-align: middle;
}

@keyframes tickerMarquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@keyframes layerGuideFade {
  0%, 22% { opacity: .58; }
  42%, 72% { opacity: 0; }
  88%, 100% { opacity: .58; }
}

@keyframes videoLayerMerge {
  0%, 18% {
    opacity: .96;
    transform: rotateX(34deg) rotateZ(-7deg) translate3d(-48px, 58px, -80px);
  }
  42%, 72% {
    opacity: 1;
    transform: rotateX(0deg) rotateZ(0deg) translate3d(0, 0, 0);
  }
  88%, 100% {
    opacity: .96;
    transform: rotateX(34deg) rotateZ(-7deg) translate3d(-48px, 58px, -80px);
  }
}

@keyframes countdownLayerMerge {
  0%, 18% {
    opacity: .88;
    border-color: rgba(23, 105, 224, .44);
    transform: rotateX(34deg) rotateZ(-7deg) translate3d(56px, -82px, 128px);
  }
  42%, 72% {
    opacity: 1;
    border-color: transparent;
    transform: rotateX(0deg) rotateZ(0deg) translate3d(0, 0, 8px);
  }
  88%, 100% {
    opacity: .88;
    border-color: rgba(23, 105, 224, .44);
    transform: rotateX(34deg) rotateZ(-7deg) translate3d(56px, -82px, 128px);
  }
}

@keyframes tickerLayerMerge {
  0%, 18% {
    opacity: .9;
    border-color: rgba(20, 184, 166, .48);
    transform: rotateX(34deg) rotateZ(-7deg) translate3d(-82px, 72px, 96px);
  }
  42%, 72% {
    opacity: 1;
    border-color: transparent;
    transform: rotateX(0deg) rotateZ(0deg) translate3d(0, 0, 14px);
  }
  88%, 100% {
    opacity: .9;
    border-color: rgba(20, 184, 166, .48);
    transform: rotateX(34deg) rotateZ(-7deg) translate3d(-82px, 72px, 96px);
  }
}

@keyframes outputLayerReveal {
  0%, 35% {
    opacity: 0;
    transform: rotateX(34deg) rotateZ(-7deg) translate3d(0, 12px, 16px) scale(.98);
  }
  48%, 72% {
    opacity: 1;
    transform: rotateX(0deg) rotateZ(0deg) translate3d(0, 0, 20px) scale(1);
  }
  88%, 100% {
    opacity: 0;
    transform: rotateX(34deg) rotateZ(-7deg) translate3d(0, 12px, 16px) scale(.98);
  }
}

@keyframes livePanelFloat {
  0%, 100% { transform: rotateX(58deg) rotateZ(-10deg) translateY(0); }
  50% { transform: rotateX(58deg) rotateZ(-10deg) translateY(-10px); }
}

@keyframes cardSelect {
  0%, 12% { opacity: .45; transform: translateY(12px) scale(.96); }
  20%, 92% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: .45; transform: translateY(12px) scale(.96); }
}

@keyframes cardGenerate {
  0%, 30% { opacity: .35; transform: translateY(14px) scale(.96); }
  40%, 92% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: .35; transform: translateY(14px) scale(.96); }
}

@keyframes urlBuild {
  0%, 36% { transform: scaleX(.08); }
  56%, 100% { transform: scaleX(1); }
}

@keyframes outputPulse {
  0%, 54% { opacity: .32; transform: translateY(12px) scale(.96); }
  66%, 92% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: .32; transform: translateY(12px) scale(.96); }
}

@keyframes arrowBlink {
  0%, 28% { opacity: .18; transform: translateX(-8px) rotate(var(--arrow-rotate, 0deg)); }
  42%, 74% { opacity: .76; transform: translateX(0) rotate(var(--arrow-rotate, 0deg)); }
  100% { opacity: .18; transform: translateX(8px) rotate(var(--arrow-rotate, 0deg)); }
}

@media (prefers-reduced-motion: reduce) {
  .ticker-track {
    animation-duration: 80s;
  }
}

.index-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0 34px;
}

.index-metrics div {
  min-height: 92px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  padding: 20px;
  border-radius: var(--radius-lg);
  background: #ffffff;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.index-metrics strong {
  color: var(--text-primary);
  font-size: 27px;
  line-height: 1;
  font-weight: 900;
}

.index-metrics span {
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 800;
}

.category-marquee {
  width: calc(100% + 60px);
  margin: 22px -30px 0;
  overflow: hidden;
  padding: 20px 0 6px;
  mask-image: linear-gradient(90deg, transparent 0, #000 9%, #000 91%, transparent 100%);
}

.category-track {
  width: max-content;
  display: flex;
  align-items: center;
  gap: 14px;
  animation: categoryFlow 58s linear infinite;
  will-change: transform;
}

.category-marquee:hover .category-track {
  animation-play-state: paused;
}

.category-pill {
  width: 348px;
  height: 158px;
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 24px 30px;
  border-radius: var(--radius-md);
  color: #ffffff;
  text-decoration: none;
  font-size: 30px;
  font-weight: 900;
  letter-spacing: 0;
  border: 1px solid rgba(255, 255, 255, .2);
  box-shadow: 0 14px 34px rgba(15, 23, 42, .14);
  background-color: #0f172a;
  background-size: cover;
  background-position: center;
  isolation: isolate;
}

.category-pill::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background: var(--category-image, url("../assets/bg_studio.png")) center/cover;
  opacity: .34;
  transform: scale(1.08);
}

.category-pill::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 20% 20%, rgba(255,255,255,.24), transparent 34%),
    linear-gradient(135deg, var(--category-a), var(--category-b));
  opacity: .9;
}

.category-pill:hover {
  transform: translateY(-2px);
}

.category-pill.youtube { --category-a: rgba(239, 68, 68, .9); --category-b: rgba(15, 23, 42, .92); --category-image: url("../assets/bg_studio.png"); }
.category-pill.podcast { --category-a: rgba(126, 34, 206, .88); --category-b: rgba(15, 23, 42, .92); --category-image: url("../assets/wallpaper.png"); }
.category-pill.game { --category-a: rgba(23, 105, 224, .9); --category-b: rgba(2, 6, 23, .94); --category-image: url("../assets/bg_cyber.png"); }
.category-pill.weather { --category-a: rgba(20, 184, 166, .84); --category-b: rgba(15, 23, 42, .9); --category-image: url("../assets/bg_neutral.png"); }
.category-pill.sports { --category-a: rgba(16, 185, 129, .86); --category-b: rgba(15, 23, 42, .92); --category-image: url("../assets/bg_cyber.png"); }
.category-pill.news { --category-a: rgba(23, 105, 224, .88); --category-b: rgba(15, 23, 42, .94); --category-image: url("../assets/bg_studio.png"); }
.category-pill.church { --category-a: rgba(245, 196, 81, .8); --category-b: rgba(15, 23, 42, .94); --category-image: url("../assets/bg_neutral.png"); }
.category-pill.business { --category-a: rgba(71, 85, 105, .88); --category-b: rgba(15, 23, 42, .96); --category-image: url("../assets/bg_minimal.png"); }
.category-pill.education { --category-a: rgba(14, 165, 233, .84); --category-b: rgba(15, 23, 42, .92); --category-image: url("../assets/bg_minimal.png"); }

@keyframes categoryFlow {
  from { transform: translateX(0); }
  to { transform: translateX(calc(-50% - 7px)); }
}

.feature-band,
.workflow-band,
.template-showcase {
  margin-top: 34px;
}

.index-section-header {
  margin-bottom: 18px;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.feature-card {
  min-height: 226px;
  padding: 22px;
  border-radius: var(--radius-lg);
  background: #ffffff;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.feature-card svg {
  width: 28px;
  height: 28px;
  color: var(--accent);
}

.feature-card h2 {
  margin-top: 18px;
  color: var(--text-primary);
  font-size: 17px;
  line-height: 1.35;
  font-weight: 900;
}

.feature-card p {
  margin-top: 10px;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
  font-weight: 550;
  word-break: keep-all;
}

.workflow-band {
  display: grid;
  grid-template-columns: minmax(230px, .42fr) 1fr;
  gap: 24px;
  align-items: start;
  padding: 28px;
  border-radius: var(--radius-lg);
  background: #0f172a;
  color: #ffffff;
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: var(--shadow-md);
}

.workflow-band .section-copy {
  color: rgba(255,255,255,.64);
}

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

.workflow-steps div {
  min-height: 168px;
  padding: 20px;
  border-radius: var(--radius-md);
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
}

.workflow-steps span {
  color: #5eead4;
  font-size: 12px;
  font-weight: 950;
  letter-spacing: .08em;
}

.workflow-steps strong {
  display: block;
  margin-top: 18px;
  font-size: 18px;
  font-weight: 900;
}

.workflow-steps p {
  margin-top: 9px;
  color: rgba(255,255,255,.7);
  font-size: 14px;
  line-height: 1.55;
  word-break: keep-all;
}

.showcase-link {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 13px;
  border-radius: var(--radius-md);
  background: #ffffff;
  border: 1px solid var(--border);
  color: var(--text-primary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 850;
  box-shadow: var(--shadow-sm);
}

.showcase-link svg {
  width: 16px;
  height: 16px;
}

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

.showcase-card {
  display: block;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: #ffffff;
  border: 1px solid var(--border);
  color: inherit;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}

.showcase-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}

.showcase-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  border-bottom: 1px solid var(--border);
}

.showcase-card div {
  padding: 19px 20px 20px;
}

.showcase-card span {
  color: var(--accent);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.showcase-card strong {
  display: block;
  margin-top: 8px;
  color: var(--text-primary);
  font-size: 18px;
  line-height: 1.35;
  font-weight: 900;
}

.showcase-card p {
  margin-top: 9px;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.5;
  font-weight: 550;
  word-break: keep-all;
}

/* Landing */
.landing-hero {
  min-height: clamp(520px, 72vh, 720px);
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  margin-bottom: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.78fr);
  align-items: center;
  gap: clamp(24px, 4vw, 54px);
  padding: clamp(28px, 5vw, 68px);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: var(--shadow-lg);
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-image: url("../assets/bg_studio.png");
  background-size: cover;
  background-position: center;
  transform: scale(1.03);
}

.hero-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(3, 7, 18, 0.88) 0%, rgba(15, 23, 42, 0.72) 48%, rgba(15, 23, 42, 0.28) 100%),
    linear-gradient(180deg, rgba(3, 7, 18, 0.1) 0%, rgba(3, 7, 18, 0.78) 100%);
}

.hero-content,
.hero-panel {
  position: relative;
  z-index: 1;
}

.hero-kicker {
  width: fit-content;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.84);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.live-pulse {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--coral);
  box-shadow: 0 0 0 6px rgba(255, 122, 89, 0.18);
}

.landing-hero h1 {
  font-size: clamp(74px, 12vw, 152px);
  line-height: .88;
  letter-spacing: 0;
  margin-top: 28px;
  font-weight: 900;
}

.hero-copy {
  max-width: 560px;
  margin-top: 24px;
  color: rgba(255, 255, 255, 0.82);
  font-size: clamp(18px, 2.2vw, 25px);
  line-height: 1.42;
  font-weight: 650;
  word-break: keep-all;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.hero-btn {
  min-height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 850;
  text-decoration: none;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}

.hero-btn svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.hero-btn.primary {
  color: #07111f;
  background: #ffffff;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.24);
}

.hero-btn.secondary {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.24);
}

.hero-btn:hover {
  transform: translateY(-2px);
}

.hero-panel {
  align-self: center;
  background: rgba(7, 17, 31, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-lg);
  padding: 12px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(18px);
}

.panel-topbar {
  height: 34px;
  display: flex;
  align-items: center;
  gap: 7px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .08em;
  padding: 0 6px 10px;
}

.panel-topbar span {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #ff5f57;
}

.panel-topbar span:nth-child(2) { background: var(--gold); }
.panel-topbar span:nth-child(3) { background: var(--teal); }
.panel-topbar strong { margin-left: auto; }

.broadcast-frame {
  aspect-ratio: 16 / 10;
  min-height: 270px;
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-md);
  background:
    linear-gradient(135deg, rgba(20, 184, 166, 0.26), rgba(255, 122, 89, 0.18)),
    url("../assets/bg_cyber.png") center/cover;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.frame-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, .08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .08) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(180deg, transparent 0%, #000 24%, #000 78%, transparent 100%);
}

.frame-badge {
  position: absolute;
  top: 18px;
  left: 18px;
  padding: 8px 11px;
  border-radius: var(--radius-sm);
  background: var(--coral);
  color: #ffffff;
  font-size: 12px;
  font-weight: 900;
}

.frame-score {
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 28px;
  min-height: 58px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: rgba(3, 7, 18, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.frame-score span {
  font-size: 13px;
  font-weight: 900;
  color: rgba(255, 255, 255, .86);
}

.frame-score span:last-child { text-align: right; }
.frame-score strong {
  min-width: 86px;
  text-align: center;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  font-size: 22px;
  line-height: 1;
  font-weight: 950;
}

.frame-lower {
  position: absolute;
  right: 22px;
  top: 76px;
  width: min(260px, calc(100% - 44px));
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.92);
  color: #0f172a;
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.25);
}

.frame-lower small {
  display: block;
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
}

.frame-lower b {
  display: block;
  margin-top: 5px;
  font-size: 18px;
  line-height: 1.25;
}

.trust-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 32px;
}

.trust-strip div {
  min-height: 64px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 15px 18px;
  box-shadow: var(--shadow-sm);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 800;
}

.trust-strip svg {
  width: 20px;
  height: 20px;
  color: var(--accent);
  flex: 0 0 auto;
}

/* Section header */
.section-header { display: flex; align-items: flex-start; gap: 20px; margin-bottom: 18px; }
.section-title { display: block; font-weight: 800; font-size: 25px; letter-spacing: 0; }
.section-copy { color: var(--text-secondary); font-size: 14px; font-weight: 500; margin-top: 6px; }
.section-spacer { flex: 1; }

.filter-tabs { display: flex; gap: 4px; background: #ffffff; padding: 4px; border-radius: var(--radius-md); border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.filter-tab {
  min-width: 68px; text-align: center;
  padding: 8px 14px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 800;
  cursor: pointer; color: var(--text-secondary);
  transition: all .2s ease;
}
.filter-tab:hover { color: var(--text-primary); }
.filter-tab.active { background: var(--bg-rail); color: #ffffff; }

.library-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.stat-item {
  min-height: 72px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
}

.stat-value { font-size: 21px; font-weight: 850; color: var(--text-primary); }
.stat-label { font-size: 12px; font-weight: 800; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; }

/* Template Grid */
.template-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 22px; }

.template-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  cursor: pointer;
  transition: transform .24s ease, box-shadow .24s ease, border-color .24s ease, background .24s ease;
  position: relative;
  box-shadow: var(--shadow-sm);
}

.template-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
  background: var(--bg-card-hover);
}

.card-preview {
  width: 100%; aspect-ratio: 16/9;
  position: relative; overflow: hidden;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
}

.card-preview-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.22), rgba(15, 23, 42, 0.72));
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: all .3s ease;
}
.template-card:hover .card-overlay { opacity: 1; }

.overlay-buttons {
  display: flex; gap: 12px; transform: translateY(20px);
  transition: all .4s cubic-bezier(0.23, 1, 0.32, 1);
}
.template-card:hover .overlay-buttons { transform: translateY(0); }

.btn-overlay {
  min-height: 42px;
  padding: 10px 16px; border-radius: var(--radius-md);
  font-size: 13px; font-weight: 800;
  cursor: pointer; display: flex; align-items: center; gap: 10px;
  transition: all .2s;
}

.btn-settings { background: #ffffff; color: var(--text-primary); border: none; }
.btn-preview { background: var(--accent); color: #ffffff; border: none; }

.btn-overlay:hover { transform: translateY(-1px); }

.card-body { padding: 19px 20px 18px; }
.card-title { font-weight: 850; font-size: 17px; line-height: 1.35; margin-bottom: 12px; letter-spacing: 0; }
.card-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 17px; min-height: 25px; }

.tag {
  font-size: 11px; font-weight: 800; padding: 4px 9px; border-radius: 999px;
  background: #f8fafc; color: var(--text-secondary);
  border: 1px solid var(--border);
}

.card-meta { display: flex; align-items: center; gap: 16px; padding-top: 15px; border-top: 1px solid var(--border); }
.card-meta-item { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-secondary); font-weight: 600; }
.card-spacer { flex: 1; }
.resolution-badge { font-size: 11px; font-weight: 850; color: var(--accent-strong); background: var(--accent-soft); padding: 4px 8px; border-radius: 999px; }

/* Preview Modal */
#preview-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1100;
  align-items: center;
  justify-content: center;
  padding: 32px;
  background: rgba(2, 6, 23, .72);
}

#preview-backdrop.open {
  display: flex;
}

#preview-modal {
  width: min(1180px, calc(100vw - 64px));
  display: grid;
  gap: 14px;
  animation: previewIn .28s cubic-bezier(.16, 1, .3, 1);
}

@keyframes previewIn {
  from { opacity: 0; transform: translateY(12px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.preview-toolbar {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px 12px 18px;
  border-radius: var(--radius-lg);
  background: rgba(15, 23, 42, .82);
  border: 1px solid rgba(255,255,255,.12);
  color: #ffffff;
  box-shadow: 0 18px 38px rgba(0,0,0,.22);
}

.preview-title {
  font-size: 16px;
  font-weight: 900;
  line-height: 1.3;
}

.preview-subtitle {
  margin-top: 2px;
  color: rgba(226, 232, 240, .68);
  font-size: 12px;
  font-weight: 700;
}

.preview-close {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: var(--radius-md);
  display: grid;
  place-items: center;
  background: rgba(255,255,255,.08);
  color: #ffffff;
  cursor: pointer;
  transition: background .2s ease, transform .2s ease;
}

.preview-close:hover {
  background: rgba(255,255,255,.16);
  transform: translateY(-1px);
}

.preview-stage {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255,255,255,.34);
  background-color: #e2e8f0;
  background-image:
    linear-gradient(45deg, #cbd5e1 25%, transparent 25%),
    linear-gradient(-45deg, #cbd5e1 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #cbd5e1 75%),
    linear-gradient(-45deg, transparent 75%, #cbd5e1 75%);
  background-size: 32px 32px;
  background-position: 0 0, 0 16px, 16px -16px, -16px 0;
  box-shadow:
    0 0 0 9999px rgba(2, 6, 23, .18),
    0 28px 80px rgba(0,0,0,.36);
}

.preview-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .14);
}

#previewFrame {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
  background: transparent;
}

.preview-click-cue {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 76px;
  height: 76px;
  z-index: 3;
  display: grid;
  place-items: center;
  color: #ffffff;
  background: rgba(15, 23, 42, .78);
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 999px;
  box-shadow: 0 18px 42px rgba(15,23,42,.34);
  opacity: 0;
  transform: translate(-50%, -50%) scale(.9);
  pointer-events: none;
}

.preview-click-cue svg {
  width: 42px;
  height: 42px;
  filter: drop-shadow(0 3px 8px rgba(0,0,0,.28));
}

.preview-click-cue::after {
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: inherit;
  border: 2px solid rgba(94, 234, 212, .72);
  opacity: 0;
  transform: scale(.72);
}

.preview-click-cue.play {
  animation: previewFingerTap 1.25s ease-out both;
}

.preview-click-cue.play::after {
  animation: previewTapRing 1.25s ease-out both;
}

@keyframes previewFingerTap {
  0% { opacity: 0; transform: translate(-44%, -40%) scale(.88); }
  18% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  42% { opacity: 1; transform: translate(-50%, -50%) scale(.86); }
  58% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.04); }
}

@keyframes previewTapRing {
  0%, 32% { opacity: 0; transform: scale(.72); }
  44% { opacity: .86; transform: scale(.78); }
  100% { opacity: 0; transform: scale(1.34); }
}

/* Modal */
#modal-backdrop {
  display: none; position: fixed; inset: 0;
  background: transparent;
  z-index: 1000;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}
#modal-backdrop.open { display: flex; }

#modal {
  position: relative;
  background: #ffffff;
  border: 1px solid var(--border);
  border-bottom: 0;
  border-radius: 22px 22px 0 0;
  width: 100%;
  height: clamp(340px, 40vh, 460px);
  max-height: none;
  overflow: hidden;
  box-shadow: 0 -18px 54px rgba(15,23,42,0.2), 0 0 0 1px rgba(255,255,255,0.72) inset;
  display: grid;
  grid-template-columns: minmax(220px, 300px) 1fr minmax(220px, 280px);
  grid-template-rows: 1fr;
  animation: bottomSheetUp .38s cubic-bezier(0.16, 1, 0.3, 1);
}

#modal::before {
  content: "";
  width: 46px;
  height: 5px;
  border-radius: 999px;
  background: #cbd5e1;
  position: absolute;
  top: 9px;
  left: 50%;
  transform: translateX(-50%);
}

@keyframes modalScale { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }
@keyframes bottomSheetUp {
  from { opacity: 0; transform: translateY(42px); }
  to { opacity: 1; transform: translateY(0); }
}

.modal-header {
  padding: 28px 22px 22px;
  border-right: 1px solid var(--border);
  border-bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 16px;
  min-width: 0;
}

.modal-preview-mini {
  width: 100%; aspect-ratio: 16/9; border-radius: var(--radius-md); overflow: hidden; flex-shrink: 0;
  border: 1px solid var(--border); background: #f8fafc;
}

.modal-title-group { flex: 1; }
.modal-title { font-weight: 850; font-size: 20px; line-height: 1.32; letter-spacing: 0; color: var(--text-primary); }
.modal-subtitle { color: var(--text-secondary); font-size: 13px; margin-top: 4px; font-weight: 600; }

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px; height: 40px; border-radius: var(--radius-md);
  background: #f1f5f9; border: none;
  color: var(--text-secondary); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .2s;
}
.modal-close:hover { background: #e2e8f0; color: var(--text-primary); }

.modal-body { padding: 28px 24px 24px; overflow-y: auto; min-width: 0; background: #fbfdff; }

.modal-form-stack {
  display: flex;
  flex-direction: column;
  gap: 22px;
  min-width: 0;
}

.form-grid { display: grid; grid-template-columns: repeat(4, minmax(160px, 1fr)); gap: 14px; }
.form-group { display: flex; flex-direction: column; gap: 10px; }
.form-group.full,
.form-grid > .full { grid-column: 1/-1; }

.agenda-items {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  min-width: 0;
}

.agenda-row {
  display: grid;
  grid-template-columns: 28px minmax(72px, .38fr) minmax(120px, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #ffffff;
  min-width: 0;
  overflow: hidden;
}

.agenda-row-index {
  width: 28px;
  height: 28px;
  align-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
}

.agenda-row .form-group {
  gap: 6px;
  min-width: 0;
}

.agenda-row .form-input {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  padding: 9px 11px;
}

.agenda-time-field,
.agenda-text-field {
  grid-column: auto;
}

.agenda-actions {
  display: flex;
  justify-content: flex-start;
  padding-top: 2px;
}

.btn-add-row {
  width: auto;
  min-height: 34px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  background: #ffffff;
  color: var(--accent);
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.btn-add-row:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.pip-upload-form {
  display: grid;
  gap: 10px;
}

.pip-upload-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pip-clear-btn {
  color: #dc2626;
}

.pip-upload-help,
.pip-upload-status {
  margin: 0;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.5;
}

.pip-upload-status {
  color: var(--accent);
}

.pip-upload-target {
  width: 0;
  height: 0;
  border: 0;
  position: absolute;
  pointer-events: none;
}

.form-label { font-size: 13px; font-weight: 700; color: var(--text-primary); }

.form-input, .form-select, .form-textarea {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 11px 13px;
  color: var(--text-primary); font-size: 14px; font-weight: 600;
  outline: none; transition: all .2s;
  width: 100%;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

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

.modal-section-title {
  padding-bottom: 2px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.modal-section-title strong {
  display: block;
  margin-top: 6px;
  color: var(--text-primary);
  font-size: 21px;
  line-height: 1.28;
  font-weight: 850;
}

.modal-section-label {
  display: block;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.modal-accent-inline {
  flex: 0 0 auto;
  min-width: 250px;
  padding-top: 2px;
}

.modal-accent-label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.form-select {
  appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center; background-size: 18px;
}

.color-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.color-swatch {
  width: 36px; height: 36px; cursor: pointer;
  border-radius: 10px; border: 2px solid transparent;
  transition: all .2s ease;
}
.color-swatch.selected { border-color: var(--text-primary); transform: scale(1.15); box-shadow: 0 4px 10px rgba(0,0,0,0.1); }
.color-custom {
  width: 36px;
  height: 36px;
  padding: 0;
  cursor: pointer;
  border: none;
  background: transparent;
}

.toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-radius: var(--radius-md);
  background: #ffffff; border: 1px solid var(--border);
}
.toggle-label { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.toggle { width: 50px; height: 28px; background: #e2e8f0; border-radius: 20px; position: relative; cursor: pointer; transition: background .3s; }
.toggle.on { background: var(--accent); }
.toggle.disabled {
  cursor: not-allowed;
  opacity: .56;
  background: #cbd5e1;
}
.toggle-knob { position: absolute; top: 4px; left: 4px; width: 20px; height: 20px; background: #fff; border-radius: 50%; transition: all .3s cubic-bezier(0.175, 0.885, 0.32, 1.275); box-shadow: 0 2px 4px rgba(0,0,0,0.1); }
.toggle.on .toggle-knob { left: 26px; }

.modal-footer {
  padding: 62px 22px 22px;
  display: flex;
  flex-direction: column-reverse;
  align-items: stretch;
  justify-content: flex-start;
  gap: 12px;
  border-left: 1px solid var(--border);
  border-top: 0;
  background: #ffffff;
}

.btn-cancel {
  background: #f1f5f9; color: var(--text-secondary); border: none;
  padding: 13px 24px; font-size: 14px; font-weight: 800; border-radius: var(--radius-md);
  cursor: pointer; transition: all .2s;
}
.btn-cancel:hover { background: #e2e8f0; color: var(--text-primary); }

.btn-modal-preview {
  background: #ffffff;
  color: var(--accent);
  border: 1px solid var(--border-strong);
  padding: 13px 24px;
  font-size: 14px;
  font-weight: 800;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all .2s;
}
.btn-modal-preview:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.btn-generate {
  background: var(--accent); color: #ffffff; border: none;
  padding: 13px 32px; font-size: 14px; font-weight: 800; border-radius: var(--radius-md);
  cursor: pointer; display: flex; align-items: center; gap: 12px;
  transition: all .2s; justify-content: center;
}
.btn-generate:hover { background: var(--accent-strong); transform: translateY(-1px); box-shadow: 0 10px 22px rgba(23, 105, 224, 0.24); }

/* Scrollbar Customization */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; border: 2px solid transparent; background-clip: content-box; }

@media (max-width: 980px) {
  body { overflow: auto; height: auto; min-height: 100vh; }
  #sidebar { display: none; }
  #main { min-height: 100vh; }
  #preview-backdrop { padding: 20px; }
  #preview-modal { width: calc(100vw - 40px); }
  #modal-backdrop { padding: 0; }
  #modal {
    width: 100%;
    height: clamp(360px, 48vh, 520px);
    max-height: none;
    grid-template-columns: minmax(190px, 240px) 1fr minmax(190px, 230px);
  }
  header { padding: 0 20px; gap: 12px; }
  .header-subtitle { display: none; }
  .header-link { display: none; }
  .search-bar { width: 260px; }
  #content { padding: 28px 20px 36px; }
  .index-page #content { padding: 24px 20px 36px; }
  .index-hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding: 42px 28px 28px;
  }
  .index-hero-shade {
    background:
      linear-gradient(180deg, rgba(2, 6, 23, .9) 0%, rgba(15, 23, 42, .72) 50%, rgba(15, 23, 42, .92) 100%);
  }
  .index-studio-preview { width: 100%; }
  .studio-screen { min-height: 320px; }
  .studio-screen::before {
    left: 9%;
    right: 9%;
  }
  .live-output-panel {
    left: 9%;
    right: 5%;
    top: 26%;
    height: 54%;
  }
  .merge-layer {
    left: 9%;
    right: 9%;
    top: 54%;
    height: auto;
  }
  .template-picker {
    left: 5%;
    top: 7%;
  }
  .url-builder {
    right: 5%;
    top: 7%;
  }
  .index-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workflow-band { grid-template-columns: 1fr; }
  .showcase-grid { grid-template-columns: 1fr; }
  .category-marquee {
    width: calc(100% + 40px);
    margin-left: -20px;
    margin-right: -20px;
  }
  .category-pill {
    width: min(348px, 42vw);
    height: auto;
    aspect-ratio: 348 / 158;
    font-size: 24px;
  }
  .landing-hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding: 34px 24px 24px;
  }
  .hero-shade {
    background:
      linear-gradient(180deg, rgba(3, 7, 18, 0.86) 0%, rgba(15, 23, 42, 0.7) 54%, rgba(15, 23, 42, 0.9) 100%);
  }
  .hero-panel { width: 100%; }
  .broadcast-frame { min-height: 240px; }
  .trust-strip { grid-template-columns: 1fr; }
  .section-header { flex-direction: column; }
  .section-spacer { display: none; }
  .filter-tabs { width: 100%; overflow-x: auto; }
}

@media (max-width: 680px) {
  header { height: auto; min-height: 72px; flex-wrap: wrap; padding: 14px 16px; }
  .index-brand {
    min-height: 42px;
    padding: 0;
    background: transparent;
    box-shadow: none;
  }
  .index-brand .brand-logo-img {
    width: 104px;
  }
  .header-title-group { min-width: 0; flex: 1; }
  body:not(.index-page) .header-title-group {
    display: inline-flex;
    flex: 0 0 auto;
    min-height: 42px;
    padding: 0;
    border-radius: var(--radius-md);
    background: transparent;
    box-shadow: none;
  }
  body:not(.index-page) .mobile-header-logo {
    display: block;
    width: 104px;
    height: auto;
  }
  body:not(.index-page) .header-title-group .header-title,
  body:not(.index-page) .header-title-group .header-subtitle {
    display: none;
  }
  .header-cta { width: 100%; order: 3; }
  .search-bar { order: 3; width: 100%; }
  .index-page .search-bar { display: none; }
  .header-action-btn, .avatar { width: 40px; height: 40px; }
  .index-page #content { padding: 18px 16px 30px; }
  .index-hero {
    margin-left: -6px;
    margin-right: -6px;
    border-radius: var(--radius-md);
    padding: 30px 20px 20px;
  }
  .index-hero-copy h1 { font-size: clamp(31px, 9vw, 48px); }
  .index-hero-copy p { font-size: 17px; }
  .studio-screen { min-height: 290px; }
  .studio-screen::before {
    left: 6%;
    right: 6%;
  }
  .flow-card {
    width: 170px;
    padding: 12px;
  }
  .flow-card strong { font-size: 13px; }
  .template-list { gap: 5px; margin-top: 9px; }
  .template-list span {
    min-height: 24px;
    font-size: 10px;
  }
  .url-builder code { font-size: 9px; }
  .live-output-panel {
    left: 6%;
    right: 5%;
    top: 35%;
    height: 45%;
  }
  .merge-layer {
    left: 6%;
    right: 6%;
    top: 56%;
    height: auto;
    border-radius: 14px;
  }
  .source-topbar {
    left: 10px;
    right: auto;
    min-height: 32px;
    padding: 7px 9px;
    font-size: 10px;
  }
  .source-topbar { top: 10px; bottom: auto; }
  .source-topbar b { font-size: 10px; }
  .template-picker {
    left: 4%;
    top: 5%;
  }
  .url-builder {
    right: 4%;
    top: 5%;
  }
  .output-badge {
    right: 5%;
    bottom: 10%;
    min-height: 36px;
    font-size: 11px;
  }
  .flow-arrow { display: none; }
  .screen-ticker { grid-template-columns: 94px 1fr; }
  .ticker-track { animation-duration: 20s; }
  .index-metrics { grid-template-columns: 1fr; }
  .category-marquee {
    width: calc(100% + 32px);
    margin-left: -16px;
    margin-right: -16px;
    padding-top: 16px;
  }
  .category-track { gap: 10px; animation-duration: 46s; }
  .category-pill {
    width: min(280px, 72vw);
    height: auto;
    aspect-ratio: 348 / 158;
    padding: 18px 22px;
    font-size: 22px;
  }
  .feature-grid,
  .workflow-steps { grid-template-columns: 1fr; }
  .workflow-band { padding: 22px; }
  .library-stats { grid-template-columns: 1fr; }
  .stat-item { min-height: 60px; }
  .landing-hero { margin-left: -8px; margin-right: -8px; border-radius: var(--radius-md); }
  .hero-kicker { font-size: 10px; }
  .hero-actions { width: 100%; }
  .hero-btn { flex: 1 1 180px; padding-left: 14px; padding-right: 14px; }
  .broadcast-frame { min-height: 210px; }
  .frame-lower { top: 58px; }
  .frame-score {
    left: 14px;
    right: 14px;
    bottom: 18px;
    grid-template-columns: 1fr;
    justify-items: stretch;
    gap: 7px;
  }
  .frame-score span,
  .frame-score span:last-child,
  .frame-score strong { text-align: center; }
  .template-grid { grid-template-columns: 1fr; gap: 16px; }
  #preview-backdrop { padding: 10px; }
  #preview-modal { width: calc(100vw - 20px); gap: 10px; }
  .preview-toolbar { min-height: 50px; padding: 10px 10px 10px 13px; }
  .preview-title { font-size: 14px; }
  .preview-subtitle { display: none; }
  .preview-close { width: 36px; height: 36px; }
  #modal-backdrop { padding: 0; }
  #modal {
    width: 100%;
    height: min(78vh, 720px);
    max-height: none;
    border-radius: 18px 18px 0 0;
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto;
  }
  .modal-header {
    padding: 24px 22px 16px;
    gap: 14px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  .modal-preview-mini { display: none; }
  .modal-body { padding: 22px; }
  .modal-footer { padding: 18px 22px 22px; flex-direction: column-reverse; border-left: 0; border-top: 1px solid var(--border); }
  .btn-cancel, .btn-generate, .btn-modal-preview { width: 100%; }
  .form-grid { grid-template-columns: 1fr; }
  .agenda-items { grid-template-columns: 1fr; }
}
