/* klipnux — Luminous White Studio Design System */
:root {
  --bg-canvas: #f5f5f7;
  --bg-surface: #ffffff;
  --bg-elevated: #ffffff;
  --bg-subtle: #f5f5f7;
  --bg-muted: #e8e8ed;

  --text-primary: #111319;
  --text-secondary: #63666f;
  --text-tertiary: #8c8f98;

  --border-hairline: rgba(17, 19, 25, 0.08);
  --border-strong: rgba(17, 19, 25, 0.16);

  /* Brand Signature Palette (Derived from Official klipnux Emblem) */
  --brand-violet: #6f2cf3;
  --brand-violet-hover: #5e20db;
  --brand-violet-soft: rgba(111, 44, 243, 0.09);
  --brand-violet-ring: rgba(111, 44, 243, 0.22);

  --brand-emerald: #0ec88a;
  --brand-emerald-dark: #0a9e6c;
  --brand-emerald-soft: rgba(14, 200, 138, 0.12);

  --accent: #111319;
  --accent-hover: #272a34;
  --accent-soft: rgba(111, 44, 243, 0.08);
  --accent-ring: rgba(111, 44, 243, 0.22);

  --success: #0d9f6e;
  --success-bright: #0ec88a;
  --success-soft: rgba(14, 200, 138, 0.12);

  --warning: #d97706;
  --warning-soft: rgba(217, 119, 6, 0.1);

  --danger: #dc2626;
  --danger-soft: rgba(220, 38, 38, 0.1);

  --ease-spring: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-bounce: cubic-bezier(0.34, 1.45, 0.64, 1);

  --shadow-card: 0 1px 2px rgba(17, 19, 25, 0.03), 0 12px 32px rgba(17, 19, 25, 0.045);
  --shadow-float: 0 12px 36px rgba(17, 19, 25, 0.1), 0 2px 6px rgba(17, 19, 25, 0.04);
  --shadow-stage: 0 24px 54px rgba(17, 19, 25, 0.14), 0 4px 12px rgba(17, 19, 25, 0.06);
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: #ffffff;
  background-image:
    radial-gradient(ellipse 75% 42% at 50% -6%, rgba(111, 44, 243, 0.045), transparent 65%),
    linear-gradient(180deg, #ffffff 0%, #f7f7f9 520px, #f5f5f7 100%);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Plus Jakarta Sans", "Inter", system-ui, sans-serif;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

.hidden {
  display: none !important;
}

/* Optical Typography */
.kn-display {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Plus Jakarta Sans", "Inter", system-ui, sans-serif;
  font-size: clamp(2.15rem, 5.2vw, 3.85rem);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -0.04em;
  color: var(--text-primary);
  margin: 0;
}

.kn-section-title {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Plus Jakarta Sans", "Inter", system-ui, sans-serif;
  font-size: clamp(1.65rem, 3.4vw, 2.5rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.032em;
  color: var(--text-primary);
  margin: 0;
}

.kn-subtitle {
  font-size: clamp(1rem, 1.5vw, 1.15rem);
  line-height: 1.5;
  letter-spacing: -0.008em;
  color: var(--text-secondary);
  font-weight: 400;
  margin: 0;
}

.kn-tabular {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* Sticky Frosted Apple Chrome */
.kn-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 58px;
  padding: 0 max(16px, env(safe-area-inset-left));
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  border-bottom: 1px solid rgba(17, 19, 25, 0.06);
}

.kn-header-inner {
  max-width: 1200px;
  height: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

body.in-workspace .kn-header-inner {
  max-width: 1440px;
}

.kn-nav-link {
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 6px 10px;
  border-radius: 980px;
  transition: color 150ms ease, background-color 150ms ease;
}

.kn-nav-link:hover {
  color: var(--text-primary);
  background: rgba(17, 19, 25, 0.04);
}

/* Surfaces */
.kn-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: 22px;
  box-shadow: var(--shadow-card);
}

.kn-subcard {
  background: var(--bg-subtle);
  border: 1px solid var(--border-hairline);
  border-radius: 14px;
}

/* Pointer-down instant tactile feedback */
.kn-pressable {
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  transition:
    transform 100ms var(--ease-spring),
    background-color 160ms ease,
    border-color 160ms ease,
    box-shadow 180ms ease,
    color 160ms ease,
    opacity 150ms ease;
}

.kn-pressable:active:not(:disabled) {
  transform: scale(0.972);
}

.kn-pressable:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.kn-pressable:focus-visible,
.kn-input:focus-visible,
.kn-select:focus-visible {
  outline: 2px solid var(--brand-violet);
  outline-offset: 2px;
}

/* Buttons — High contrast crisp pill geometry */
.kn-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 11px 22px;
  border-radius: 980px;
  border: none;
  background: var(--text-primary);
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  box-shadow: 0 2px 12px rgba(17, 19, 25, 0.16);
}

.kn-btn-primary:hover:not(:disabled) {
  background: var(--brand-violet);
  box-shadow: 0 8px 24px rgba(111, 44, 243, 0.28);
  transform: translateY(-1px);
}

.kn-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 46px;
  padding: 10px 20px;
  border-radius: 980px;
  border: 1px solid var(--border-hairline);
  background: #ffffff;
  color: var(--text-primary);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.kn-btn-secondary:hover:not(:disabled) {
  background: var(--bg-subtle);
  border-color: var(--border-strong);
}

.kn-btn-success {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 10px 20px;
  border-radius: 14px;
  border: none;
  background: #0d9f6e;
  color: #ffffff;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(13, 159, 110, 0.24);
}

.kn-btn-success:hover:not(:disabled) {
  background: #0a875d;
  transform: translateY(-1px);
}

.kn-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 6px 12px;
  border-radius: 980px;
  border: 1px solid var(--border-hairline);
  background: rgba(255, 255, 255, 0.92);
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 600;
}

.kn-icon-btn:hover:not(:disabled) {
  color: var(--text-primary);
  border-color: var(--border-strong);
  background: #ffffff;
}

/* Segmented Controls */
.kn-segmented {
  display: inline-flex;
  position: relative;
  padding: 3px;
  border-radius: 980px;
  background: var(--bg-muted);
  border: 1px solid rgba(0, 0, 0, 0.04);
}

.kn-seg-btn {
  position: relative;
  z-index: 2;
  min-height: 36px;
  padding: 6px 14px;
  border: none;
  border-radius: 980px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
}

.kn-seg-btn.active {
  background: #ffffff;
  color: var(--text-primary);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1), 0 1px 1px rgba(0, 0, 0, 0.04);
}

/* Inputs */
.kn-input {
  width: 100%;
  min-height: 50px;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1.5px solid var(--border-hairline);
  background: #ffffff;
  color: var(--text-primary);
  font-size: 14.5px;
  font-family: inherit;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.kn-input:focus {
  border-color: var(--brand-violet);
  box-shadow: 0 0 0 4px var(--brand-violet-ring);
  outline: none;
}

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

.kn-select {
  width: 100%;
  min-height: 44px;
  padding: 8px 34px 8px 12px;
  border-radius: 12px;
  border: 1.5px solid var(--border-hairline);
  background-color: #ffffff;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2363666f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  cursor: pointer;
}

/* Wizard Step Pill Bar */
.kn-wizard-nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 4px;
  border-radius: 980px;
  background: rgba(17, 19, 25, 0.035);
  border: 1px solid rgba(17, 19, 25, 0.05);
}

.kn-wiz-step {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border-radius: 980px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-tertiary);
  transition: all 220ms var(--ease-spring);
}

.kn-wiz-step.active {
  color: var(--text-primary);
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.kn-wiz-step.done {
  color: var(--success);
}

.kn-wiz-num {
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: var(--bg-muted);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10.5px;
  font-weight: 700;
}

.kn-wiz-step.active .kn-wiz-num {
  background: var(--brand-violet);
  color: #ffffff;
}

.kn-wiz-step.done .kn-wiz-num {
  background: var(--success);
  color: #ffffff;
}

/* Count Quick-Select Pills */
.kn-count-pill {
  min-height: 50px;
  padding: 10px 10px;
  border-radius: 14px;
  border: 1.5px solid var(--border-hairline);
  background: #ffffff;
  color: var(--text-primary);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.kn-count-pill:hover {
  border-color: var(--border-strong);
  background: var(--bg-subtle);
}

.kn-count-pill.active {
  border-color: var(--brand-violet);
  background: var(--brand-violet-soft);
  box-shadow: 0 0 0 3px var(--brand-violet-ring);
}

/* Badges */
.kn-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: 980px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
}

.kn-badge-blue { background: var(--brand-violet-soft); color: var(--brand-violet); }
.kn-badge-green { background: var(--success-soft); color: #0b8059; }
.kn-badge-amber { background: var(--warning-soft); color: #b45309; }
.kn-badge-red { background: var(--danger-soft); color: #b91c1c; }
.kn-badge-purple { background: rgba(111, 44, 243, 0.1); color: #5b21b6; }
.kn-badge-neutral { background: var(--bg-muted); color: var(--text-secondary); }

/* Caption Swatches */
.caption-swatch {
  border-radius: 14px;
  border: 1.5px solid var(--border-hairline);
  background: #ffffff;
  padding: 8px;
  text-align: left;
  transition: all 180ms var(--ease-spring);
}

.caption-swatch:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.caption-swatch.active {
  border-color: var(--brand-violet);
  box-shadow: 0 0 0 3px var(--brand-violet-ring);
}

.caption-swatch-stage {
  border-radius: 9px;
  background: #14151a;
  padding: 10px 8px;
  text-align: center;
  margin-bottom: 6px;
}

/* Apple-Style On-Scroll Editorial Showcase */
.kn-showcase-wrap {
  max-width: 1120px;
  width: 100%;
  margin: 0 auto;
  padding: 18px 16px 84px;
  display: flex;
  flex-direction: column;
  gap: 72px;
}

.kn-reveal {
  opacity: 0;
  transform: translateY(26px) scale(0.985);
  transition: opacity 680ms var(--ease-spring), transform 760ms var(--ease-spring);
  will-change: opacity, transform;
}

.kn-reveal.in-view {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.kn-media-frame {
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid var(--border-hairline);
  background: #f5f5f7;
  box-shadow: var(--shadow-float);
}

.kn-media-frame img,
.kn-media-frame video {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
  transition: transform 600ms var(--ease-spring);
}

.kn-bento-card {
  background: #ffffff;
  border: 1px solid var(--border-hairline);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: transform 280ms var(--ease-spring), box-shadow 280ms ease;
}

.kn-bento-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-float);
}

.kn-bento-card:hover .kn-media-frame img {
  transform: scale(1.025);
}

/* Clip Cards in Queue */
.clip-card {
  border-radius: 14px;
  border: 1px solid var(--border-hairline);
  background: #ffffff;
  padding: 12px 14px;
  cursor: pointer;
  transition: transform 160ms var(--ease-spring), border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.clip-card:hover {
  border-color: var(--border-strong);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.045);
}

.clip-card.active {
  border-color: var(--brand-violet);
  background: rgba(111, 44, 243, 0.035);
  box-shadow: 0 0 0 3px var(--brand-violet-ring);
}

/* Retention Heatmap */
.heatmap-span {
  position: absolute;
  top: 4px;
  bottom: 4px;
  border-radius: 5px;
  cursor: pointer;
  transition: transform 150ms var(--ease-spring), opacity 150ms ease, box-shadow 150ms ease;
}

.heatmap-span:hover {
  transform: scaleY(1.22);
  opacity: 1 !important;
  z-index: 25;
}

.heatmap-tooltip {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #111319;
  color: #ffffff;
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 11px;
  white-space: nowrap;
  z-index: 40;
  box-shadow: var(--shadow-float);
  pointer-events: none;
}

.heatmap-span:hover .heatmap-tooltip {
  display: block;
}

/* Transcript Words */
.transcript-word {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-primary);
  border: 1px solid transparent;
  transition: background-color 110ms ease, color 110ms ease;
}

.transcript-word:hover {
  background: var(--brand-violet-soft);
  color: var(--brand-violet);
}

.transcript-word.active-word {
  background: var(--success-soft);
  border-color: rgba(14, 200, 138, 0.35);
  color: #097b55;
  font-weight: 700;
}

.transcript-word.editable-word {
  border-bottom: 1.5px dashed var(--brand-violet);
  background: rgba(111, 44, 243, 0.05);
}

/* Audio Waveform 1:1 Pointer Scrubber */
#waveformContainer {
  touch-action: none;
  user-select: none;
}

.waveform-bar {
  flex: 1;
  min-width: 2px;
  border-radius: 3px;
  transition: background-color 80ms linear;
}

/* Device Stage */
#deviceFrame {
  width: 100%;
  max-width: 268px;
  aspect-ratio: 9 / 16;
  background: #111319;
  border-radius: 30px;
  padding: 7px;
  border: 1px solid rgba(0, 0, 0, 0.16);
  box-shadow: var(--shadow-stage);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: max-width 280ms var(--ease-spring), aspect-ratio 280ms var(--ease-spring), border-radius 280ms var(--ease-spring);
}

#deviceFrame.aspect-1-1 {
  max-width: 310px;
  aspect-ratio: 1 / 1;
  border-radius: 24px;
}

#deviceFrame.aspect-16-9 {
  max-width: 380px;
  aspect-ratio: 16 / 9;
  border-radius: 18px;
}

/* Toggle Switch */
.kn-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.kn-switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.kn-switch-track {
  width: 40px;
  height: 24px;
  border-radius: 999px;
  background: #d2d2d7;
  padding: 2px;
  transition: background-color 180ms var(--ease-spring);
  display: flex;
  align-items: center;
}

.kn-switch input:checked + .kn-switch-track {
  background: var(--brand-emerald);
}

.kn-switch-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform 200ms var(--ease-bounce);
}

.kn-switch input:checked + .kn-switch-track .kn-switch-thumb {
  transform: translateX(16px);
}

/* Motion Keyframes */
@keyframes panelEnter {
  from { opacity: 0; transform: translateY(10px) scale(0.99); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes slideNextIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes slideBackIn {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes popIn {
  0% { opacity: 0; transform: scale(0.94); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.animate-panel { animation: panelEnter 320ms var(--ease-spring) forwards; }
.animate-step-next { animation: slideNextIn 280ms var(--ease-spring) forwards; }
.animate-step-back { animation: slideBackIn 280ms var(--ease-spring) forwards; }
.animate-pop { animation: popIn 220ms var(--ease-bounce) forwards; }
.animate-spin { animation: spin 0.9s linear infinite; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, 0.16); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0, 0, 0, 0.28); }

/* Responsive Layout & Mobile Workspace Ergonomics */
#studioWorkspaceShell {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-areas:
    "preview"
    "timeline"
    "inspector"
    "clips";
  gap: 12px;
  align-items: start;
}

#panePreview { grid-area: preview; }
#nleTimelineDeck { grid-area: timeline; }
#paneInspector { grid-area: inspector; }
#paneClips { grid-area: clips; }

.mobile-pane-hidden {
  display: none !important;
}

@media (min-width: 1024px) {
  .mobile-pane-hidden { display: flex !important; }
  #studioWorkspaceShell {
    grid-template-columns: 276px minmax(0, 1fr) 368px;
    grid-template-areas:
      "clips preview inspector"
      "timeline timeline timeline";
    gap: 14px;
  }
}

@media (max-width: 640px) {
  .kn-card { border-radius: 18px; }
  .kn-header { height: 52px; }
  .kn-showcase-wrap { gap: 40px; padding-bottom: 52px; }
  #deviceFrame { max-width: 214px; border-radius: 24px; padding: 5px; }
  #deviceFrame.aspect-4-5 { max-width: 236px; border-radius: 22px; }
  #deviceFrame.aspect-1-1 { max-width: 256px; border-radius: 20px; }
  #deviceFrame.aspect-16-9 { max-width: 100%; border-radius: 16px; }
}

/* Toast Notification */
#toast {
  position: fixed;
  bottom: max(20px, env(safe-area-inset-bottom));
  right: 20px;
  left: 20px;
  max-width: 420px;
  margin-left: auto;
  z-index: 120;
  transition: transform 240ms var(--ease-spring), opacity 200ms ease;
}

#toast.toast-hidden {
  transform: translateY(24px);
  opacity: 0;
  pointer-events: none;
}

.kn-toast-box {
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--border-hairline);
  border-radius: 14px;
  padding: 12px 16px;
  box-shadow: var(--shadow-float);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .kn-reveal { opacity: 1 !important; transform: none !important; }
}

@media (prefers-reduced-transparency: reduce) {
  .kn-header, .kn-toast-box {
    background: #ffffff;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

/* =========================================================
   HOMEPAGE HERO, INTERACTIVE PLAYGROUND & UPLOAD LAUNCHER
========================================================== */
.kn-hero-shell {
  max-width: 1180px;
  width: 100%;
  margin: 0 auto;
  padding: 28px 16px 36px;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: 28px;
  align-items: center;
}

@media (max-width: 960px) {
  .kn-hero-shell {
    grid-template-columns: 1fr;
    padding: 20px 14px 28px;
    gap: 22px;
  }
}

.kn-upload-hero {
  position: relative;
  border: 2px dashed rgba(111, 44, 243, 0.30);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(246, 245, 255, 0.92) 100%);
  padding: 28px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  cursor: pointer;
  transition: transform 200ms var(--ease-spring), border-color 180ms ease, box-shadow 220ms ease, background 180ms ease;
  box-shadow: 0 8px 28px rgba(111, 44, 243, 0.06);
}

.kn-upload-hero:hover,
.kn-upload-hero.drag-over {
  border-color: var(--brand-violet);
  background: linear-gradient(180deg, #ffffff 0%, rgba(111, 44, 243, 0.07) 100%);
  transform: translateY(-2px);
  box-shadow: 0 16px 36px rgba(111, 44, 243, 0.14);
}

.kn-upload-hero-icon {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(111, 44, 243, 0.16) 0%, rgba(14, 200, 138, 0.15) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 220ms var(--ease-spring);
}

.kn-upload-hero:hover .kn-upload-hero-icon {
  transform: scale(1.08);
}

.kn-file-meta-card {
  width: 100%;
  border-radius: 16px;
  border: 1px solid var(--border-hairline);
  background: #ffffff;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: var(--shadow-card);
  animation: panelEnter 240ms var(--ease-spring) forwards;
}

/* Interactive Live Hero Playground Card */
.kn-playground-card {
  border-radius: 26px;
  background: #0f1117;
  border: 1px solid rgba(255, 255, 255, 0.10);
  padding: 14px;
  color: #ffffff;
  box-shadow: 0 26px 64px rgba(15, 17, 23, 0.24), 0 0 0 1px rgba(111, 44, 243, 0.14);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.kn-playground-stage {
  position: relative;
  width: 100%;
  height: 336px;
  border-radius: 18px;
  overflow: hidden;
  background: radial-gradient(circle at 50% 25%, rgba(111, 44, 243, 0.25), #090a0e 72%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}

@media (max-width: 640px) {
  .kn-playground-stage {
    height: 270px;
  }
}

.kn-pg-frame {
  position: relative;
  height: 100%;
  aspect-ratio: 9 / 16;
  max-width: 100%;
  border-radius: 16px;
  overflow: hidden;
  background: #000000;
  border: 1.5px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.55);
  transition: aspect-ratio 240ms var(--ease-spring), width 240ms var(--ease-spring);
}

.kn-pg-frame.pg-4-5 { aspect-ratio: 4 / 5; }
.kn-pg-frame.pg-1-1 { aspect-ratio: 1 / 1; }
.kn-pg-frame.pg-16-9 { aspect-ratio: 16 / 9; width: 100%; height: auto; max-height: 100%; }

.kn-pg-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.kn-pg-btn {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.78);
  padding: 5px 10px;
  min-height: 30px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease, transform 100ms var(--ease-spring);
}

.kn-pg-btn:hover {
  background: rgba(255, 255, 255, 0.13);
  color: #ffffff;
}

.kn-pg-btn.active {
  background: var(--brand-violet);
  border-color: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.kn-pg-scrubber-wrap {
  position: relative;
  height: 40px;
  border-radius: 12px;
  background: #171a24;
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
  cursor: ew-resize;
  display: flex;
  align-items: center;
  touch-action: none;
  user-select: none;
}

.kn-pg-scrubber-strip {
  position: absolute;
  inset: 4px 6px;
  border-radius: 8px;
  background: repeating-linear-gradient(
    90deg,
    rgba(111, 44, 243, 0.34) 0px,
    rgba(111, 44, 243, 0.34) 44px,
    rgba(14, 200, 138, 0.28) 46px,
    rgba(14, 200, 138, 0.28) 90px
  );
  border: 1.5px solid rgba(251, 191, 36, 0.7);
}

.kn-pg-needle {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2.5px;
  background: #ffffff;
  box-shadow: 0 0 10px rgba(14, 200, 138, 0.9);
  left: 35%;
  pointer-events: none;
}

/* Spotlight Dark Bento Card on Homepage */
.kn-spotlight-banner {
  border-radius: 28px;
  background: #0f1117;
  color: #ffffff;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow-stage);
}

/* =========================================================
   IN-STAGE LIVE CAPTION OVERLAYS & STUDIO EXTRAS
========================================================== */
.live-subtitle-overlay {
  position: absolute;
  bottom: 14%;
  left: 6%;
  right: 6%;
  z-index: 35;
  pointer-events: auto;
  cursor: pointer;
  display: flex;
  justify-content: center;
  text-align: center;
  transition: bottom 140ms ease-out;
}

.live-caption-box {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 9px;
  padding: 7px 13px;
  border-radius: 10px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Plus Jakarta Sans", "Inter", sans-serif;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.85);
  line-height: 1.25;
}

.live-word-active {
  display: inline-block;
  transform: scale(1.12);
  transition: transform 90ms var(--ease-spring);
}

.caption-style-hormozi .live-word-active {
  background: #0ec88a;
  color: #052e16 !important;
  padding: 2px 8px;
  border-radius: 6px;
  text-shadow: none;
}

.caption-style-mrbeast .live-word-active {
  color: #ff2d2d !important;
  text-shadow: 0 0 14px rgba(255, 45, 45, 0.8);
}

.caption-style-tiktok .live-word-active {
  color: #fe2c55 !important;
  text-shadow: 0 0 12px rgba(254, 44, 85, 0.7);
}

.caption-style-neon .live-word-active {
  color: #00ffff !important;
  text-shadow: 0 0 14px rgba(0, 255, 255, 0.8);
}

.caption-style-podcast .live-word-active {
  color: #fbbf24 !important;
}

.caption-style-kinetic .live-word-active {
  color: #38bdf8 !important;
  text-shadow: 0 0 18px rgba(56, 189, 248, 0.9), 0 2px 6px rgba(0, 0, 0, 0.85);
}

.caption-style-minimal {
  background: rgba(255, 252, 245, 0.94);
  padding: 6px 14px;
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.28);
  text-shadow: none !important;
}

.caption-style-minimal .live-word-active {
  background: #111319;
  color: #ffffff !important;
  padding: 1px 7px;
  border-radius: 6px;
}

.caption-style-noir {
  letter-spacing: 0.04em;
}

.caption-style-noir .live-word-active {
  color: #ffffff !important;
  text-shadow: 0 0 16px rgba(255, 255, 255, 0.85), 0 2px 8px rgba(0, 0, 0, 0.95);
  border-bottom: 2px solid #ffffff;
}

@keyframes slideUpWord {
  from { opacity: 0.4; transform: translateY(6px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1.1); }
}

.caption-anim-slide .live-word-active {
  animation: slideUpWord 140ms var(--ease-spring) forwards;
}

.caption-anim-solid .live-word-active {
  transform: none !important;
}

.kn-watermark-pill {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 36;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(11, 12, 16, 0.58);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.92);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
  pointer-events: none;
}

.kn-retention-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  background: rgba(255, 255, 255, 0.16);
  z-index: 38;
  pointer-events: none;
}

.kn-retention-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #6f2cf3 0%, #0ec88a 100%);
  transition: width 120ms linear;
}

#deviceFrame.aspect-4-5 {
  max-width: 286px;
  aspect-ratio: 4 / 5;
  border-radius: 26px;
}

/* =========================================================
   CAPCUT / VN-STYLE OBSIDIAN TIMELINE DECK
========================================================== */
.kn-nle-deck {
  background: #12141c;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 20px;
  padding: 12px 14px;
  color: #ffffff;
  box-shadow: var(--shadow-stage);
  display: flex;
  flex-direction: column;
  gap: 10px;
  user-select: none;
}

.kn-nle-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.kn-nle-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}

.kn-nle-actions::-webkit-scrollbar {
  display: none;
}

.kn-nle-pill-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 36px;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.90);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  transition: background-color 140ms ease, border-color 140ms ease, transform 90ms var(--ease-spring);
}

.kn-nle-pill-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.24);
}

.kn-nle-pill-btn.accent {
  background: rgba(111, 44, 243, 0.26);
  border-color: rgba(111, 44, 243, 0.55);
  color: #e9d5ff;
}

.kn-nle-pill-btn.danger {
  color: #fda4af;
  border-color: rgba(244, 63, 94, 0.28);
}

.kn-transport-btn {
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color 140ms ease, transform 100ms var(--ease-spring);
}

.kn-transport-btn:hover {
  background: rgba(255, 255, 255, 0.16);
}

.kn-transport-btn.btn-play-hero {
  width: 40px;
  height: 40px;
  background: var(--brand-violet);
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(111, 44, 243, 0.45);
}

.kn-transport-btn.btn-play-hero:hover {
  background: var(--brand-violet-hover);
}

/* Interactive Filmstrip Track & Golden Drag Handles */
.kn-nle-track-shell {
  position: relative;
  border-radius: 12px;
  background: #0a0c10;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.kn-filmstrip-rail {
  position: relative;
  width: 100%;
  height: 52px;
  border-radius: 9px;
  background: #171a23;
  overflow: hidden;
  touch-action: none;
  cursor: crosshair;
}

.kn-filmstrip-thumbs {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  opacity: 0.55;
  pointer-events: none;
}

.kn-filmstrip-thumbs img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-right: 1px solid rgba(0, 0, 0, 0.35);
}

.kn-nle-selection {
  position: absolute;
  top: 2px;
  bottom: 2px;
  left: 10%;
  width: 30%;
  border-top: 2.5px solid #fbbf24;
  border-bottom: 2.5px solid #fbbf24;
  background: rgba(111, 44, 243, 0.18);
  border-radius: 8px;
  box-shadow: 0 0 0 9999px rgba(8, 10, 14, 0.42);
  z-index: 10;
  pointer-events: none;
}

.kn-nle-handle {
  position: absolute;
  top: -2px;
  bottom: -2px;
  width: 18px;
  background: #fbbf24;
  color: #111319;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: ew-resize;
  pointer-events: auto;
  touch-action: none;
  z-index: 25;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
}

.kn-nle-handle-left {
  left: -2px;
  border-radius: 7px 0 0 7px;
}

.kn-nle-handle-right {
  right: -2px;
  border-radius: 0 7px 7px 0;
}

.kn-nle-handle::after {
  content: "";
  width: 2.5px;
  height: 18px;
  border-radius: 99px;
  background: #111319;
}

.kn-nle-drag-readout {
  position: absolute;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  background: #fbbf24;
  color: #111319;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}

.kn-waveform-lane {
  position: relative;
  width: 100%;
  height: 36px;
  display: flex;
  align-items: flex-end;
  gap: 2px;
  padding: 4px 6px;
  background: #141720;
  border-radius: 8px;
  cursor: ew-resize;
  overflow: hidden;
  touch-action: none;
}

.waveform-cut-range {
  position: absolute;
  top: 0;
  bottom: 0;
  background: rgba(111, 44, 243, 0.24);
  border-left: 2px solid #fbbf24;
  border-right: 2px solid #fbbf24;
  pointer-events: none;
  z-index: 10;
}

/* Tool Tabs & Tactile Visual Pills (Zero Computer-Select Look) */
.kn-tool-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border-radius: 14px;
  background: var(--bg-muted);
}

.kn-tool-tab-btn {
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--text-secondary);
  min-height: 40px;
  padding: 6px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 10.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 140ms ease, color 140ms ease, box-shadow 140ms ease;
}

.kn-tool-tab-btn.active {
  background: #ffffff;
  color: var(--brand-violet);
  box-shadow: 0 2px 6px rgba(17, 19, 25, 0.08);
}

.kn-visual-pill-group {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(74px, 1fr));
  gap: 6px;
}

.kn-visual-pill {
  min-height: 38px;
  padding: 6px 8px;
  border-radius: 11px;
  border: 1.5px solid var(--border-hairline);
  background: #ffffff;
  color: var(--text-primary);
  font-size: 11.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  transition: border-color 140ms ease, background-color 140ms ease, color 140ms ease, transform 90ms var(--ease-spring);
}

.kn-visual-pill:hover {
  border-color: var(--border-strong);
  background: var(--bg-subtle);
}

.kn-visual-pill.active {
  border-color: var(--brand-violet);
  background: var(--brand-violet-soft);
  color: var(--brand-violet);
}

.kn-zoom-slider {
  width: 100%;
  accent-color: var(--brand-violet);
  height: 6px;
  cursor: pointer;
}

/* Mobile CapCut/VN Sticky Bottom Dock */
#mobileBottomDock {
  display: none;
}

@media (max-width: 1023px) {
  body.in-workspace {
    padding-bottom: calc(68px + env(safe-area-inset-bottom));
  }

  #resultsSection {
    padding: 8px 10px 18px !important;
    gap: 10px !important;
  }

  #mobileBottomDock {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 85;
    padding: 6px 8px calc(8px + env(safe-area-inset-bottom));
    background: rgba(15, 17, 23, 0.94);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-top: 1px solid rgba(255, 255, 255, 0.12);
  }

  .kn-mobile-dock-btn {
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.65);
    min-height: 44px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    font-size: 10.5px;
    font-weight: 600;
    cursor: pointer;
  }

  .kn-mobile-dock-btn.active {
    background: rgba(111, 44, 243, 0.25);
    color: #ffffff;
  }

  .kn-nle-deck {
    padding: 10px;
    border-radius: 16px;
  }
}


