@layer reset, tokens, base, components, pages, responsive;

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

  html {
    color-scheme: dark;
    font-family:
      Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    text-rendering: optimizeLegibility;
  }

  body {
    margin: 0;
    min-width: 320px;
    min-height: 100vh;
  }

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

  button,
  a,
  input,
  textarea,
  select {
    -webkit-tap-highlight-color: transparent;
  }

  button {
    border: 0;
  }

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

  img,
  svg,
  video,
  canvas {
    display: block;
    max-width: 100%;
  }

  [hidden] {
    display: none !important;
  }
}

@layer tokens {
  :root {
    --bg-950: #080c12;
    --bg-925: #0b1017;
    --bg-900: #0e141d;
    --bg-875: #111923;
    --bg-850: #141d29;
    --bg-800: #192432;
    --bg-750: #202d3d;
    --line-strong: #334155;
    --line: #263445;
    --line-soft: #1d2936;
    --text: #f8fafc;
    --text-soft: #d6deea;
    --muted: #94a3b8;
    --muted-strong: #b4c0d0;
    --violet: #8b5cf6;
    --violet-light: #a78bfa;
    --violet-dark: #6d40db;
    --cyan: #2dd4bf;
    --green: #34d399;
    --amber: #fbbf24;
    --red: #fb7185;
    --red-strong: #ef4444;
    --blue: #60a5fa;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-xl: 26px;
    --shadow-sm: 0 8px 24px rgb(0 0 0 / 18%);
    --shadow-lg: 0 24px 80px rgb(0 0 0 / 38%);
    --focus: 0 0 0 3px rgb(139 92 246 / 35%);
  }
}

@layer base {
  body {
    background: var(--bg-925);
    color: var(--text);
  }

  a {
    color: inherit;
  }

  button,
  select,
  input {
    color: inherit;
  }

  button,
  [role="button"] {
    cursor: pointer;
  }

  button:disabled,
  input:disabled,
  select:disabled {
    cursor: not-allowed;
    opacity: 0.48;
  }

  :focus-visible {
    outline: 2px solid var(--violet-light);
    outline-offset: 3px;
  }

  ::selection {
    background: rgb(139 92 246 / 42%);
  }

  .sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
  }

  .skip-link {
    position: fixed;
    z-index: 1000;
    left: 16px;
    top: 12px;
    translate: 0 -160%;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    background: var(--text);
    color: var(--bg-950);
    font-weight: 750;
    text-decoration: none;
  }

  .skip-link:focus {
    translate: 0;
  }

  .icon {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
  }

  .media-source-video {
    position: fixed;
    pointer-events: none;
    width: 1px;
    height: 1px;
    opacity: 0;
    inset: auto auto 0 0;
  }

  .section-kicker,
  .panel-kicker {
    margin: 0 0 6px;
    color: var(--violet-light);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
  }

  .panel-kicker {
    color: var(--muted);
    font-size: 0.64rem;
  }
}

@layer components {
  .app-shell {
    min-height: 100vh;
    background:
      radial-gradient(circle at 80% 0%, rgb(110 63 224 / 10%), transparent 34rem),
      var(--bg-925);
  }

  .app-header {
    min-height: 68px;
    padding: 0 clamp(20px, 4vw, 64px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    border-bottom: 1px solid var(--line-soft);
    background: rgb(11 16 23 / 86%);
    backdrop-filter: blur(18px);
  }

  .app-brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    color: var(--text);
    font-size: 1.04rem;
    font-weight: 790;
    letter-spacing: -0.02em;
    text-decoration: none;
  }

  .brand-mark {
    position: relative;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    overflow: hidden;
    border: 1px solid rgb(167 139 250 / 35%);
    border-radius: 10px;
    background: linear-gradient(145deg, #a78bfa, #6d40db);
    box-shadow: 0 8px 22px rgb(109 64 219 / 32%);
  }

  .brand-mark span:first-child {
    width: 11px;
    height: 16px;
    border: 2px solid #fff;
    border-radius: 6px 6px 4px 4px;
  }

  .brand-mark span:last-child {
    position: absolute;
    width: 17px;
    height: 8px;
    top: 16px;
    border: solid #fff;
    border-width: 0 2px 2px;
    border-radius: 0 0 8px 8px;
  }

  .app-brand--compact {
    font-size: 0.95rem;
  }

  .app-brand--compact .brand-mark {
    width: 30px;
    height: 30px;
  }

  .header-actions,
  .studio-header-actions,
  .studio-header-left,
  .stage-toolbar-actions,
  .hero-actions,
  .trust-row,
  .source-controls,
  .record-controls {
    display: flex;
    align-items: center;
  }

  .header-actions {
    gap: 18px;
  }

  .text-link {
    color: var(--muted-strong);
    font-size: 0.88rem;
    font-weight: 650;
    text-decoration: none;
  }

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

  .button {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 0 17px;
    border: 1px solid transparent;
    border-radius: 10px;
    font-size: 0.88rem;
    font-weight: 750;
    line-height: 1;
    text-decoration: none;
    transition:
      background 160ms ease,
      border-color 160ms ease,
      color 160ms ease,
      transform 160ms ease;
  }

  .button:not(:disabled):active {
    transform: translateY(1px);
  }

  .button--primary {
    border-color: #9f7aea;
    background: linear-gradient(180deg, #956cf2, #7547df);
    color: #fff;
    box-shadow:
      inset 0 1px rgb(255 255 255 / 18%),
      0 9px 26px rgb(109 64 219 / 24%);
  }

  .button--primary:not(:disabled):hover {
    background: linear-gradient(180deg, #a17cf5, #8053e7);
    box-shadow:
      inset 0 1px rgb(255 255 255 / 22%),
      0 12px 32px rgb(109 64 219 / 34%);
  }

  .button--secondary {
    border-color: var(--line-strong);
    background: var(--bg-850);
    color: var(--text-soft);
  }

  .button--secondary:not(:disabled):hover {
    border-color: #4b5e76;
    background: var(--bg-800);
    color: var(--text);
  }

  .button--quiet {
    min-height: 38px;
    border-color: transparent;
    background: transparent;
    color: var(--muted-strong);
  }

  .button--quiet:hover {
    background: var(--bg-800);
    color: var(--text);
  }

  .button--danger-quiet {
    border-color: transparent;
    background: transparent;
    color: #fda4af;
  }

  .button--danger-quiet:hover {
    background: rgb(239 68 68 / 9%);
    color: #fecdd3;
  }

  .button--large {
    min-height: 50px;
    padding-inline: 22px;
    border-radius: var(--radius-md);
    font-size: 0.94rem;
  }

  .button--small {
    min-height: 36px;
    padding-inline: 13px;
    font-size: 0.8rem;
  }

  .button--full {
    width: 100%;
  }

  .button--hidden {
    display: none;
  }

  .icon-button {
    width: 40px;
    height: 40px;
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--bg-850);
    color: var(--muted-strong);
    transition:
      background 150ms ease,
      color 150ms ease,
      border-color 150ms ease;
  }

  .icon-button:hover {
    border-color: var(--line-strong);
    background: var(--bg-800);
    color: var(--text);
  }

  .icon-button--small {
    width: 34px;
    height: 34px;
    border-radius: 8px;
  }

  .icon-button--small .icon {
    width: 17px;
    height: 17px;
  }

  .badge,
  .local-chip,
  .storage-mode {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: max-content;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 750;
    letter-spacing: 0.01em;
    white-space: nowrap;
  }

  .badge {
    padding: 6px 9px;
    border: 1px solid var(--line);
    background: var(--bg-800);
    color: var(--muted-strong);
  }

  .badge .icon {
    width: 14px;
    height: 14px;
  }

  .badge--ready {
    border-color: rgb(52 211 153 / 25%);
    background: rgb(52 211 153 / 10%);
    color: #6ee7b7;
  }

  .badge--warning {
    border-color: rgb(251 191 36 / 25%);
    background: rgb(251 191 36 / 10%);
    color: #fde68a;
  }

  .badge--danger {
    border-color: rgb(251 113 133 / 25%);
    background: rgb(251 113 133 / 10%);
    color: #fda4af;
  }

  .badge--working {
    border-color: rgb(96 165 250 / 25%);
    background: rgb(96 165 250 / 10%);
    color: #93c5fd;
  }

  .badge--neutral {
    color: var(--muted-strong);
  }

  .alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--bg-800);
    color: var(--text-soft);
    font-size: 0.82rem;
    line-height: 1.45;
  }

  .alert .icon {
    width: 18px;
    height: 18px;
    margin-top: 1px;
  }

  .alert--hidden {
    display: none;
  }

  .alert--warning {
    border-color: rgb(251 191 36 / 26%);
    background: rgb(251 191 36 / 8%);
    color: #fde68a;
  }

  .alert--danger {
    border-color: rgb(251 113 133 / 26%);
    background: rgb(251 113 133 / 8%);
    color: #fecdd3;
  }

  .alert--success {
    border-color: rgb(52 211 153 / 26%);
    background: rgb(52 211 153 / 8%);
    color: #a7f3d0;
  }

  .field-group {
    display: grid;
    gap: 8px;
    min-width: 0;
    margin: 0;
  }

  .field-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-soft);
    font-size: 0.78rem;
    font-weight: 720;
  }

  .field-label .icon {
    width: 16px;
    height: 16px;
    color: var(--muted);
  }

  .field-group input[type="text"],
  .field-group textarea,
  .field-group select,
  .project-name-input {
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--bg-900);
    color: var(--text);
  }

  .field-group input[type="text"] {
    padding: 0 12px;
  }

  .field-group textarea {
    padding: 10px 12px;
    resize: vertical;
  }

  .field-group input[type="text"]::placeholder,
  .field-group textarea::placeholder,
  .project-name-input::placeholder {
    color: var(--muted);
  }

  .select-wrap {
    position: relative;
    display: block;
  }

  .select-wrap select {
    appearance: none;
    padding: 0 40px 0 12px;
  }

  .select-wrap > .icon {
    position: absolute;
    right: 12px;
    top: 50%;
    width: 17px;
    height: 17px;
    translate: 0 -50%;
    color: var(--muted);
    pointer-events: none;
  }

  .segmented-control,
  .choice-row {
    display: grid;
    gap: 7px;
  }

  .segmented-control {
    grid-template-columns: 1fr 1fr;
  }

  .choice-row {
    grid-template-columns: repeat(3, 1fr);
  }

  .segmented-control label,
  .choice-row label {
    position: relative;
  }

  .segmented-control input,
  .choice-row input {
    position: absolute;
    top: 0;
    left: 0;
    width: 1px;
    height: 1px;
    margin: 0;
    opacity: 0;
    pointer-events: none;
  }

  .segmented-control span,
  .choice-row span {
    min-height: 48px;
    display: grid;
    place-items: center;
    gap: 2px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--bg-900);
    color: var(--muted-strong);
    font-size: 0.8rem;
    font-weight: 750;
    cursor: pointer;
  }

  .segmented-control small {
    color: var(--muted);
    font-size: 0.64rem;
    font-weight: 570;
  }

  .segmented-control input:checked + span,
  .choice-row input:checked + span {
    border-color: var(--violet);
    background: rgb(139 92 246 / 12%);
    color: #ddd6fe;
    box-shadow: var(--focus);
  }

  .segmented-control input:focus-visible + span,
  .choice-row input:focus-visible + span {
    outline: 2px solid var(--violet-light);
    outline-offset: 2px;
  }

  .meter-track,
  .channel-meter {
    position: relative;
    overflow: hidden;
    border-radius: 999px;
    background: var(--bg-750);
  }

  .meter-track {
    height: 8px;
  }

  .meter-fill,
  .channel-meter > span {
    display: block;
    width: var(--meter-level, 0%);
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--cyan) 0 68%, var(--amber) 84%, var(--red) 100%);
    transition: width 80ms linear;
  }

  .toast-region {
    position: fixed;
    z-index: 1000;
    right: 20px;
    bottom: 20px;
    width: min(380px, calc(100vw - 40px));
    pointer-events: none;
  }

  .toast {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 13px 15px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-md);
    background: rgb(20 29 41 / 96%);
    color: var(--text-soft);
    box-shadow: var(--shadow-lg);
    font-size: 0.84rem;
    line-height: 1.45;
    animation: toast-in 180ms ease-out;
  }

  .toast--success .icon {
    color: var(--green);
  }

  .toast--warning .icon {
    color: var(--amber);
  }

  .toast--danger .icon {
    color: var(--red);
  }

  @keyframes toast-in {
    from {
      opacity: 0;
      transform: translateY(8px);
    }
  }

  .dialog-card {
    width: min(500px, calc(100vw - 32px));
    padding: 0;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-lg);
    background: var(--bg-875);
    color: var(--text);
    box-shadow: var(--shadow-lg);
  }

  .dialog-card::backdrop {
    background: rgb(3 7 12 / 72%);
    backdrop-filter: blur(5px);
  }

  .support-corner {
    position: fixed;
    right: max(12px, env(safe-area-inset-right));
    bottom: max(12px, env(safe-area-inset-bottom));
    z-index: 30;
  }

  .support-corner .button {
    min-height: 36px;
    box-shadow: var(--shadow-sm);
    font-size: 0.7rem;
  }

  .support-dialog p:not(.section-kicker) {
    margin: 0;
    color: var(--text-soft);
    font-size: 0.85rem;
    line-height: 1.5;
  }

  .dialog-card form {
    display: grid;
    gap: 16px;
    padding: 24px;
  }

  .dialog-card h2 {
    margin: -8px 0 0;
    font-size: 1.45rem;
    letter-spacing: -0.03em;
  }

  .dialog-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .dialog-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border: 1px solid rgb(139 92 246 / 30%);
    border-radius: var(--radius-md);
    background: rgb(139 92 246 / 12%);
    color: var(--violet-light);
  }

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

  .privacy-list li {
    display: flex;
    gap: 10px;
    color: var(--text-soft);
    font-size: 0.87rem;
    line-height: 1.5;
  }

  .privacy-list .icon {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    color: var(--green);
  }

  .privacy-list li:nth-child(n + 3) .icon {
    color: var(--amber);
  }

  .shortcut-list {
    display: grid;
    gap: 0;
    margin: 0 0 8px;
  }

  .shortcut-list > div {
    min-height: 49px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 1px solid var(--line-soft);
  }

  .shortcut-list dt {
    color: var(--text-soft);
    font-size: 0.83rem;
  }

  .shortcut-list dd {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0;
    color: var(--muted);
    font-size: 0.7rem;
  }

  kbd {
    min-width: 27px;
    min-height: 25px;
    display: inline-grid;
    place-items: center;
    padding: 0 6px;
    border: 1px solid var(--line-strong);
    border-bottom-width: 2px;
    border-radius: 6px;
    background: var(--bg-800);
    color: var(--text-soft);
    font: 650 0.68rem ui-monospace, SFMono-Regular, Menlo, monospace;
  }
}

@layer pages {
  /* Landing */
  .landing-main {
    width: min(1220px, calc(100% - 40px));
    margin-inline: auto;
  }

  .hero-section {
    min-height: 650px;
    display: grid;
    grid-template-columns: minmax(0, 0.88fr) minmax(520px, 1.12fr);
    align-items: center;
    gap: clamp(42px, 7vw, 96px);
    padding: 72px 0 64px;
  }

  .eyebrow {
    width: max-content;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 22px;
    padding: 7px 11px;
    border: 1px solid rgb(139 92 246 / 30%);
    border-radius: 999px;
    background: rgb(139 92 246 / 8%);
    color: #c4b5fd;
    font-size: 0.73rem;
    font-weight: 760;
    letter-spacing: 0.035em;
    text-transform: uppercase;
  }

  .eyebrow .icon {
    width: 15px;
    height: 15px;
  }

  .hero-copy h1 {
    margin-bottom: 24px;
    font-size: clamp(3.4rem, 6.4vw, 6rem);
    font-weight: 790;
    letter-spacing: -0.075em;
    line-height: 0.94;
  }

  .hero-copy h1 span {
    background: linear-gradient(100deg, #c4b5fd 10%, #8b5cf6 62%, #5eead4 110%);
    background-clip: text;
    color: transparent;
  }

  .hero-lede {
    max-width: 570px;
    margin-bottom: 30px;
    color: var(--muted-strong);
    font-size: clamp(1rem, 1.4vw, 1.16rem);
    line-height: 1.65;
  }

  .hero-actions {
    flex-wrap: wrap;
    gap: 11px;
  }

  .trust-row {
    flex-wrap: wrap;
    gap: 18px;
    margin-top: 24px;
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 650;
  }

  .trust-row span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
  }

  .trust-row .icon {
    width: 14px;
    height: 14px;
    color: var(--green);
  }

  .hero-visual {
    position: relative;
  }

  .visual-glow {
    position: absolute;
    z-index: 0;
    inset: 7% 5%;
    border-radius: 50%;
    background: radial-gradient(circle, rgb(139 92 246 / 35%), rgb(45 212 191 / 9%) 47%, transparent 70%);
    filter: blur(35px);
  }

  .studio-preview-card {
    position: relative;
    z-index: 1;
    overflow: hidden;
    aspect-ratio: 1.36;
    border: 1px solid #2b394c;
    border-radius: 20px;
    background: #0d131c;
    box-shadow:
      0 35px 90px rgb(0 0 0 / 55%),
      0 0 0 1px rgb(255 255 255 / 3%) inset;
    transform: perspective(1300px) rotateY(-3deg) rotateX(1deg);
  }

  .preview-topbar {
    height: 12%;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 0 15px;
    border-bottom: 1px solid #202b39;
    color: #cbd5e1;
    font-size: clamp(0.56rem, 1vw, 0.72rem);
    font-weight: 680;
  }

  .preview-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--violet);
    box-shadow: 0 0 0 3px rgb(139 92 246 / 17%);
  }

  .preview-status {
    margin-left: auto;
    color: #6ee7b7;
  }

  .preview-body {
    height: 88%;
    display: grid;
    grid-template-columns: 16% minmax(0, 1fr) 21%;
  }

  .preview-scenes,
  .preview-inspector {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 13px 10px;
    background: #111923;
  }

  .preview-scenes {
    border-right: 1px solid #202b39;
  }

  .preview-inspector {
    border-left: 1px solid #202b39;
  }

  .mini-label {
    color: #77879a;
    font-size: clamp(0.39rem, 0.72vw, 0.55rem);
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
  }

  .mini-label--spaced {
    margin-top: 8px;
  }

  .mini-scene {
    aspect-ratio: 1.65;
    border: 1px solid #2c3b4e;
    border-radius: 4px;
    background: linear-gradient(145deg, #1e2a3a, #141d28);
  }

  .mini-scene--active {
    border-color: var(--violet);
    box-shadow: 0 0 0 1px var(--violet);
  }

  .mini-add {
    display: grid;
    place-items: center;
    height: 20px;
    border: 1px dashed #334155;
    border-radius: 4px;
    color: #77879a;
  }

  .preview-stage {
    display: grid;
    grid-template-rows: 1fr 16%;
    gap: 9px;
    min-width: 0;
    padding: 15px;
  }

  .preview-screen {
    position: relative;
    overflow: hidden;
    min-height: 0;
    border: 1px solid #28374a;
    border-radius: 9px;
    background:
      radial-gradient(circle at 78% 12%, rgb(139 92 246 / 45%), transparent 48%),
      linear-gradient(145deg, #172232, #0d141f);
  }

  .preview-window {
    position: absolute;
    inset: 9% 8%;
    padding: 5%;
    border: 1px solid rgb(255 255 255 / 12%);
    border-radius: 6px;
    background: #e8edf5;
    box-shadow: 0 10px 26px rgb(0 0 0 / 28%);
  }

  .preview-window > span {
    display: inline-block;
    width: 4px;
    height: 4px;
    margin-right: 3px;
    border-radius: 50%;
    background: #94a3b8;
  }

  .preview-window > div {
    height: 62%;
    margin-top: 9%;
    border-radius: 3px;
    background:
      linear-gradient(90deg, #8b5cf6 0 58%, transparent 58%),
      linear-gradient(#cbd5e1 15%, transparent 15% 30%, #dbe3ee 30% 42%, transparent 42% 57%, #e2e8f0 57% 69%, transparent 69%);
    opacity: 0.85;
  }

  .preview-camera {
    position: absolute;
    right: 5%;
    bottom: 7%;
    width: 28%;
    aspect-ratio: 16 / 10;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 2px solid rgb(255 255 255 / 45%);
    border-radius: 7px;
    background: linear-gradient(145deg, #334155, #1e293b);
    box-shadow: 0 8px 18px rgb(0 0 0 / 38%);
  }

  .avatar-shape {
    width: 37%;
    aspect-ratio: 1;
    border-radius: 50% 50% 42% 42%;
    background: #a78bfa;
    box-shadow: 0 17px 0 12px #8b5cf6;
  }

  .preview-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
  }

  .preview-controls > span {
    height: 80%;
    min-width: 26px;
    display: grid;
    place-items: center;
    padding: 0 6px;
    border: 1px solid #2d3a4c;
    border-radius: 6px;
    background: #16202c;
    color: #aab7c6;
  }

  .preview-controls .icon {
    width: 12px;
    height: 12px;
  }

  .preview-controls .preview-record {
    display: flex;
    gap: 4px;
    margin-left: auto;
    padding-inline: 8px;
    border-color: rgb(251 113 133 / 30%);
    color: #fda4af;
    font-size: 0.49rem;
    font-weight: 740;
  }

  .source-line {
    height: 24px;
    border: 1px solid #2b394a;
    border-radius: 4px;
    background: linear-gradient(90deg, #2a3748 20%, #1a2533 20%);
  }

  .color-line {
    height: 38px;
    border: 1px solid #2b394a;
    border-radius: 4px;
    background: linear-gradient(90deg, #8b5cf6 32%, #1a2533 32%);
  }

  .privacy-float {
    position: absolute;
    z-index: 2;
    right: -14px;
    bottom: -19px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 13px;
    border: 1px solid rgb(52 211 153 / 25%);
    border-radius: 10px;
    background: rgb(15 26 31 / 94%);
    color: #a7f3d0;
    box-shadow: var(--shadow-sm);
    font-size: 0.7rem;
    font-weight: 730;
  }

  .privacy-float .icon {
    width: 16px;
    height: 16px;
  }

  .recordings-section {
    padding: 58px 0 64px;
    border-top: 1px solid var(--line-soft);
  }

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

  .section-heading h2,
  .preflight-intro h1,
  .review-heading h1 {
    margin: 0;
    font-size: clamp(1.8rem, 3vw, 2.5rem);
    letter-spacing: -0.045em;
  }

  .storage-mode {
    padding: 7px 10px;
    border: 1px solid var(--line);
    color: var(--muted);
  }

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

  .empty-library,
  .recording-card {
    min-height: 88px;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 18px;
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-md);
    background: rgb(17 25 35 / 62%);
  }

  .empty-library {
    justify-content: center;
    color: var(--muted);
  }

  .empty-icon,
  .recording-card-icon {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border: 1px solid rgb(139 92 246 / 25%);
    border-radius: var(--radius-md);
    background: rgb(139 92 246 / 9%);
    color: var(--violet-light);
  }

  .empty-library strong,
  .empty-library p {
    display: block;
    margin: 0;
  }

  .empty-library strong {
    color: var(--text-soft);
    font-size: 0.87rem;
  }

  .empty-library p {
    margin-top: 3px;
    font-size: 0.76rem;
  }

  .recording-card-icon--warning {
    border-color: rgb(251 191 36 / 25%);
    background: rgb(251 191 36 / 9%);
    color: var(--amber);
  }

  .recording-card-main {
    min-width: 0;
    flex: 1;
  }

  .recording-card-title {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .recording-card h3 {
    overflow: hidden;
    margin: 0;
    color: var(--text-soft);
    font-size: 0.92rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .recording-card p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 0.73rem;
  }

  .recording-card-actions {
    display: flex;
    align-items: center;
    gap: 7px;
  }

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

  .principles-grid article {
    padding: 24px;
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-lg);
    background: linear-gradient(145deg, rgb(20 29 41 / 86%), rgb(13 20 29 / 82%));
  }

  .feature-icon {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    margin-bottom: 18px;
    border-radius: 11px;
  }

  .feature-icon--violet {
    background: rgb(139 92 246 / 13%);
    color: var(--violet-light);
  }

  .feature-icon--cyan {
    background: rgb(45 212 191 / 11%);
    color: #5eead4;
  }

  .feature-icon--amber {
    background: rgb(251 191 36 / 11%);
    color: #fde68a;
  }

  .principles-grid h3 {
    margin-bottom: 8px;
    font-size: 1rem;
  }

  .principles-grid p {
    margin: 0;
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.55;
  }

  .landing-footer {
    min-height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 max(20px, calc((100% - 1220px) / 2));
    border-top: 1px solid var(--line-soft);
    color: var(--muted);
    font-size: 0.72rem;
  }

  /* Preflight */
  .preflight-header {
    padding-inline: clamp(20px, 3vw, 44px);
  }

  .step-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted-strong);
    font-size: 0.72rem;
    font-weight: 680;
  }

  .step-indicator span {
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line-strong);
    border-radius: 50%;
    color: var(--muted-strong);
    font-size: 0.67rem;
  }

  .step-indicator span:first-child {
    border-color: var(--violet);
    background: var(--violet);
    color: #fff;
  }

  .step-indicator i {
    width: 28px;
    height: 1px;
    background: var(--line-strong);
  }

  .preflight-main {
    width: min(1120px, calc(100% - 40px));
    margin-inline: auto;
    padding: 52px 0 70px;
  }

  .preflight-intro {
    max-width: 660px;
    margin-bottom: 30px;
  }

  .preflight-intro p:last-child,
  .review-heading p:last-child {
    margin: 12px 0 0;
    color: var(--muted);
    line-height: 1.55;
  }

  .preflight-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(390px, 0.75fr);
    gap: 18px;
    align-items: start;
  }

  .device-preview-card,
  .setup-card,
  .player-card,
  .review-details-card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: rgb(17 25 35 / 86%);
    box-shadow: var(--shadow-sm);
  }

  .card-header {
    min-height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 0 20px;
    border-bottom: 1px solid var(--line-soft);
  }

  .card-header > div:first-child {
    display: flex;
    align-items: center;
    gap: 9px;
  }

  .setup-card .card-header > div:first-child {
    display: block;
  }

  .card-header h2 {
    margin: 0;
    font-size: 0.96rem;
  }

  .status-dot {
    width: 8px;
    height: 8px;
    display: inline-block;
    flex: 0 0 auto;
    border-radius: 50%;
    background: var(--muted);
  }

  .status-dot--pending {
    box-shadow: 0 0 0 4px rgb(148 163 184 / 10%);
  }

  .status-dot--ready {
    background: var(--green);
    box-shadow: 0 0 0 4px rgb(52 211 153 / 12%);
  }

  .device-preview {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 10;
    margin: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background:
      radial-gradient(circle at 50% 15%, #2a3b50, transparent 55%),
      var(--bg-950);
  }

  .device-preview video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1);
  }

  .device-placeholder {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 9px;
    padding: 30px;
    text-align: center;
  }

  .device-placeholder > span {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    margin-bottom: 5px;
    border: 1px solid var(--line-strong);
    border-radius: 50%;
    color: var(--muted-strong);
  }

  .device-placeholder strong {
    color: var(--text-soft);
    font-size: 0.9rem;
  }

  .device-placeholder small {
    max-width: 310px;
    color: var(--muted);
    font-size: 0.72rem;
    line-height: 1.45;
  }

  .preview-nameplate {
    position: absolute;
    left: 14px;
    bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border: 1px solid rgb(255 255 255 / 12%);
    border-radius: 7px;
    background: rgb(8 12 18 / 76%);
    color: var(--text-soft);
    font-size: 0.73rem;
    font-weight: 700;
    backdrop-filter: blur(8px);
  }

  .audio-check {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 22px;
    padding: 4px 20px 22px;
  }

  .audio-check-label {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .audio-check-label > .icon {
    color: var(--violet-light);
  }

  .audio-check-label div {
    display: grid;
    gap: 2px;
  }

  .audio-check-label strong {
    color: var(--text-soft);
    font-size: 0.76rem;
  }

  .audio-check-label small {
    color: var(--muted);
    font-size: 0.66rem;
  }

  .setup-card {
    padding-bottom: 18px;
  }

  .setup-card > .alert {
    margin: 16px 18px 0;
  }

  .setup-fields {
    display: grid;
    gap: 16px;
    padding: 18px;
  }

  .quality-fieldset {
    padding: 0;
    border: 0;
  }

  .readiness-list {
    display: grid;
    margin: 0 18px;
    border-block: 1px solid var(--line-soft);
  }

  .readiness-item {
    min-height: 59px;
    display: flex;
    align-items: center;
    gap: 11px;
  }

  .readiness-item + .readiness-item {
    border-top: 1px solid var(--line-soft);
  }

  .readiness-item > div {
    display: grid;
    gap: 2px;
  }

  .readiness-item strong {
    color: var(--text-soft);
    font-size: 0.76rem;
  }

  .readiness-item small {
    color: var(--muted);
    font-size: 0.67rem;
  }

  .check-icon {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgb(52 211 153 / 10%);
    color: var(--green);
  }

  .check-icon .icon {
    width: 15px;
    height: 15px;
  }

  .check-icon--pending {
    background: rgb(96 165 250 / 10%);
    color: var(--blue);
  }

  .local-note {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 16px 18px 0;
    padding: 12px;
    border-radius: 9px;
    background: rgb(139 92 246 / 7%);
    color: var(--muted-strong);
    font-size: 0.7rem;
    line-height: 1.45;
  }

  .local-note .icon {
    width: 17px;
    height: 17px;
    margin-top: 1px;
    color: var(--violet-light);
  }

  .local-note strong {
    color: #ddd6fe;
  }

  .setup-actions {
    display: grid;
    gap: 8px;
    padding: 18px 18px 0;
  }

  /* Studio */
  .studio-shell {
    min-height: 100vh;
    overflow: hidden;
    background: var(--bg-950);
  }

  .studio-header {
    height: 62px;
    display: grid;
    grid-template-columns: minmax(310px, 1fr) auto minmax(310px, 1fr);
    align-items: center;
    gap: 20px;
    padding: 0 16px;
    border-bottom: 1px solid var(--line-soft);
    background: var(--bg-900);
  }

  .studio-header-left {
    gap: 12px;
    min-width: 0;
  }

  .header-divider {
    width: 1px;
    height: 24px;
    background: var(--line);
  }

  .project-name-input {
    max-width: 180px;
    min-height: 34px;
    padding: 0 8px;
    border-color: transparent;
    background: transparent;
    font-size: 0.79rem;
    font-weight: 680;
  }

  .project-name-input:hover,
  .project-name-input:focus {
    border-color: var(--line);
    background: var(--bg-850);
  }

  .save-state,
  .write-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--muted);
    font-size: 0.67rem;
    white-space: nowrap;
  }

  .save-state .icon {
    width: 13px;
    height: 13px;
    color: var(--green);
  }

  .recording-health {
    min-width: 220px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 8px;
    padding: 7px 11px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--bg-875);
    font-size: 0.7rem;
  }

  .recording-state-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 0 3px rgb(52 211 153 / 10%);
  }

  .recording-state-dot--countdown,
  .recording-state-dot--recording {
    background: var(--red);
    box-shadow: 0 0 0 3px rgb(251 113 133 / 12%);
  }

  .recording-state-dot--recording {
    animation: recording-pulse 1.6s ease-in-out infinite;
  }

  .recording-state-dot--paused {
    background: var(--amber);
    box-shadow: 0 0 0 3px rgb(251 191 36 / 12%);
  }

  @keyframes recording-pulse {
    50% {
      opacity: 0.45;
    }
  }

  .recording-health > span:nth-child(2) {
    color: var(--text-soft);
    font-weight: 680;
  }

  .recording-health time {
    color: var(--muted-strong);
    font: 650 0.73rem ui-monospace, SFMono-Regular, Menlo, monospace;
  }

  .studio-header-actions {
    justify-content: flex-end;
    gap: 8px;
  }

  .studio-workspace {
    height: calc(100vh - 62px);
    display: grid;
    grid-template-columns: 220px minmax(520px, 1fr) 310px;
    overflow: hidden;
  }

  .panel {
    min-height: 0;
    background: var(--bg-900);
  }

  .scenes-panel {
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--line-soft);
  }

  .panel-heading,
  .inspector-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  .panel-heading {
    flex: 0 0 auto;
    min-height: 68px;
    padding: 0 14px;
    border-bottom: 1px solid var(--line-soft);
  }

  .panel-heading h2,
  .inspector-section-heading h2,
  .mixer-heading h2 {
    margin: 0;
    font-size: 0.83rem;
    letter-spacing: -0.01em;
  }

  .scene-list {
    min-height: 0;
    display: grid;
    align-content: start;
    gap: 7px;
    overflow-y: auto;
    padding: 11px 10px;
  }

  .scene-card {
    position: relative;
    border: 1px solid transparent;
    border-radius: 10px;
    background: var(--bg-875);
  }

  .scene-card:hover {
    border-color: var(--line);
  }

  .scene-card--active {
    border-color: var(--violet);
    background: rgb(139 92 246 / 8%);
    box-shadow: 0 0 0 1px rgb(139 92 246 / 18%);
  }

  .scene-select {
    width: 100%;
    display: grid;
    grid-template-columns: 20px 62px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    padding: 8px;
    border-radius: inherit;
    background: transparent;
    color: inherit;
    text-align: left;
  }

  .scene-number {
    align-self: start;
    padding-top: 3px;
    color: var(--muted);
    font: 630 0.56rem ui-monospace, SFMono-Regular, Menlo, monospace;
  }

  .scene-thumbnail {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 10;
    border: 1px solid #2e3d50;
    border-radius: 5px;
    background:
      radial-gradient(circle at 80% 0%, rgb(139 92 246 / 42%), transparent 60%),
      #16212f;
  }

  .scene-thumbnail i,
  .scene-thumbnail b {
    position: absolute;
    display: block;
    border-radius: 2px;
    background: #6b7b8e;
  }

  .scene-thumbnail--pip i,
  .scene-thumbnail--presentation i {
    inset: 16% 11%;
    background: #8997a8;
  }

  .scene-thumbnail--pip b {
    width: 26%;
    height: 27%;
    right: 8%;
    bottom: 8%;
    border: 1px solid #e2e8f0;
    background: #8b5cf6;
  }

  .scene-thumbnail--solo i {
    inset: 0;
    border-radius: 0;
    background: #475569;
  }

  .scene-thumbnail--split i,
  .scene-thumbnail--split b {
    top: 9%;
    bottom: 9%;
    width: 39%;
  }

  .scene-thumbnail--split i {
    left: 8%;
  }

  .scene-thumbnail--split b {
    right: 8%;
    background: #8b5cf6;
  }

  .scene-thumbnail--audio i {
    width: 25%;
    aspect-ratio: 1;
    left: 50%;
    top: 50%;
    translate: -50% -50%;
    border-radius: 50%;
    background: #8b5cf6;
  }

  .scene-meta {
    min-width: 0;
    display: grid;
    gap: 3px;
  }

  .scene-meta strong,
  .scene-meta small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .scene-meta strong {
    color: var(--text-soft);
    font-size: 0.7rem;
  }

  .scene-meta small {
    color: var(--muted);
    font-size: 0.58rem;
    text-transform: capitalize;
  }

  .scene-card--active .scene-meta small {
    color: #c4b5fd;
  }

  .scene-actions {
    display: none;
    grid-template-columns: repeat(5, 1fr);
    gap: 1px;
    padding: 2px 6px 6px 27px;
  }

  .scene-card:hover .scene-actions,
  .scene-card:focus-within .scene-actions {
    display: grid;
  }

  .scene-actions button {
    height: 26px;
    display: grid;
    place-items: center;
    border-radius: 5px;
    background: transparent;
    color: var(--muted);
  }

  .scene-actions button:hover:not(:disabled) {
    background: var(--bg-750);
    color: var(--text);
  }

  .scene-actions .icon {
    width: 13px;
    height: 13px;
  }

  .add-scene-button {
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin: 0 10px 10px;
    border: 1px dashed var(--line-strong);
    border-radius: 8px;
    background: transparent;
    color: var(--muted-strong);
    font-size: 0.68rem;
    font-weight: 680;
  }

  .add-scene-button:hover {
    border-color: var(--violet);
    background: rgb(139 92 246 / 6%);
    color: #c4b5fd;
  }

  .add-scene-button .icon {
    width: 15px;
    height: 15px;
  }

  .panel-tip {
    display: flex;
    gap: 8px;
    margin: auto 10px 10px;
    padding: 10px;
    border-radius: 8px;
    background: rgb(139 92 246 / 7%);
    color: var(--muted);
    font-size: 0.61rem;
    line-height: 1.45;
  }

  .panel-tip .icon {
    width: 14px;
    height: 14px;
    color: var(--violet-light);
  }

  .stage-column {
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 12px 16px 14px;
    background:
      radial-gradient(circle at 50% 20%, rgb(40 53 69 / 40%), transparent 38rem),
      var(--bg-950);
  }

  .stage-toolbar {
    min-height: 34px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 15px;
  }

  .stage-state {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--muted-strong);
    font-size: 0.68rem;
    font-weight: 720;
  }

  .stage-state i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--green);
  }

  .stage-state--recording {
    color: #fecdd3;
  }

  .stage-state--recording i {
    background: var(--red);
    animation: recording-pulse 1.6s ease-in-out infinite;
  }

  .stage-state--paused {
    color: #fde68a;
  }

  .stage-state--paused i {
    background: var(--amber);
  }

  .stage-toolbar-actions {
    gap: 9px;
    color: var(--muted);
    font-size: 0.62rem;
  }

  .local-chip {
    padding: 4px 7px;
    border: 1px solid rgb(52 211 153 / 18%);
    background: rgb(52 211 153 / 7%);
    color: #6ee7b7;
    font-size: 0.59rem;
  }

  .local-chip .icon {
    width: 12px;
    height: 12px;
  }

  .canvas-frame {
    position: relative;
    overflow: hidden;
    flex: 0 0 auto;
    width: min(100%, calc((100vh - 365px) * 1.777));
    min-width: 420px;
    margin-inline: auto;
    aspect-ratio: 16 / 9;
    border: 1px solid #334359;
    border-radius: 11px;
    background: #0a0e14;
    box-shadow:
      0 18px 45px rgb(0 0 0 / 35%),
      0 0 0 1px rgb(255 255 255 / 2%) inset;
  }

  .canvas-frame canvas {
    width: 100%;
    height: 100%;
    object-fit: contain;
  }

  .stage-editor {
    position: absolute;
    inset: 0;
    pointer-events: none;
  }

  .stage-selection {
    position: absolute;
    border: 2px solid var(--violet-light);
    border-radius: 8px;
  }

  .stage-move {
    position: absolute;
    inset: 0;
    width: 100%;
    background: transparent;
    cursor: move;
  }

  .stage-corner {
    position: absolute;
    width: 24px;
    height: 24px;
    padding: 0;
    border: 2px solid var(--text);
    border-radius: 6px;
    background: var(--violet);
  }

  .stage-move,
  .stage-corner,
  .stage-divider {
    pointer-events: auto;
    touch-action: none;
    user-select: none;
  }

  .stage-corner--nw { top: -10px; left: -10px; cursor: nwse-resize; }
  .stage-corner--ne { top: -10px; right: -10px; cursor: nesw-resize; }
  .stage-corner--sw { bottom: -10px; left: -10px; cursor: nesw-resize; }
  .stage-corner--se { bottom: -10px; right: -10px; cursor: nwse-resize; }

  .stage-divider {
    position: absolute;
    width: 28px;
    translate: -50% 0;
    display: grid;
    place-items: center;
    cursor: ew-resize;
  }

  .stage-divider::before {
    content: "";
    position: absolute;
    inset: 0 12px;
    background: var(--violet-light);
  }

  .stage-divider span {
    z-index: 1;
    padding: 10px 4px;
    border: 1px solid var(--violet-light);
    border-radius: 6px;
    background: var(--bg-875);
    color: var(--text);
  }

  .stage-edit-help {
    margin: 0 0 10px;
    color: var(--muted);
    font-size: 0.65rem;
    line-height: 1.5;
  }

  .countdown-overlay {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 8px;
    background: rgb(5 8 13 / 76%);
    backdrop-filter: blur(8px);
  }

  .countdown-overlay span,
  .countdown-overlay small {
    color: var(--muted-strong);
    font-size: 0.76rem;
  }

  .countdown-overlay strong {
    font-size: clamp(4rem, 10vw, 7rem);
    line-height: 1;
    letter-spacing: -0.08em;
  }

  .stage-notice {
    position: absolute;
    left: 50%;
    bottom: 14px;
    translate: -50% 0;
    padding: 8px 11px;
    border-radius: 7px;
    background: rgb(8 12 18 / 85%);
    color: var(--text-soft);
    font-size: 0.67rem;
  }

  .layout-bar {
    min-height: 63px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 9px 0;
  }

  .layout-label {
    margin-right: 6px;
    color: var(--muted);
    font-size: 0.61rem;
    font-weight: 740;
    text-transform: uppercase;
  }

  .layout-settings-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px 24px;
  }

  .layout-checkbox {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 32px;
    color: var(--text-soft);
    font-size: 0.75rem;
    cursor: pointer;
  }

  .layout-checkbox input {
    width: 16px;
    height: 16px;
    accent-color: var(--violet);
  }

  .layout-checkbox small {
    display: block;
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 0.65rem;
    line-height: 1.5;
  }

  .layout-button {
    min-width: 52px;
    min-height: 42px;
    display: grid;
    grid-template-columns: 34px;
    place-items: center;
    gap: 3px;
    padding: 5px 8px;
    border: 1px solid transparent;
    border-radius: 7px;
    background: transparent;
    color: var(--muted);
  }

  .layout-button:hover {
    background: var(--bg-850);
    color: var(--text-soft);
  }

  .layout-button[aria-pressed="true"] {
    border-color: rgb(139 92 246 / 35%);
    background: rgb(139 92 246 / 10%);
    color: #c4b5fd;
  }

  .layout-button > span:last-child {
    display: none;
    font-size: 0.54rem;
    white-space: nowrap;
  }

  .layout-thumb {
    position: relative;
    width: 34px;
    height: 22px;
    display: block;
    border: 1px solid currentColor;
    border-radius: 3px;
    opacity: 0.8;
  }

  .layout-thumb i,
  .layout-thumb b {
    position: absolute;
    display: block;
    border-radius: 1px;
    background: currentColor;
  }

  .layout-thumb--solo i {
    inset: 3px;
  }

  .layout-thumb--pip i,
  .layout-thumb--presentation i {
    inset: 4px;
  }

  .layout-thumb--pip b {
    width: 9px;
    height: 7px;
    right: 1px;
    bottom: 1px;
    border: 1px solid var(--bg-950);
  }

  .layout-thumb--split i,
  .layout-thumb--split b {
    top: 3px;
    bottom: 3px;
    width: 12px;
  }

  .layout-thumb--split i {
    left: 3px;
  }

  .layout-thumb--split b {
    right: 3px;
  }

  .layout-thumb--audio i {
    width: 8px;
    height: 8px;
    left: 50%;
    top: 50%;
    translate: -50% -50%;
    border-radius: 50%;
  }

  .mixer-card {
    flex: 0 0 auto;
    overflow: hidden;
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    background: rgb(14 20 29 / 84%);
  }

  .mixer-heading {
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    border-bottom: 1px solid var(--line-soft);
  }

  .mixer-heading > div {
    display: flex;
    align-items: baseline;
    gap: 8px;
  }

  .mixer-heading .panel-kicker {
    margin: 0;
  }

  .mixer-heading .badge {
    padding: 4px 7px;
    font-size: 0.58rem;
  }

  .mixer-channels {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .mixer-channel {
    min-width: 0;
    min-height: 53px;
    display: grid;
    grid-template-columns: 30px minmax(85px, 0.65fr) minmax(90px, 1fr) minmax(65px, 0.4fr) 38px;
    align-items: center;
    gap: 9px;
    padding: 8px 10px;
  }

  .mixer-channel + .mixer-channel {
    border-left: 1px solid var(--line-soft);
  }

  .mixer-channel--disabled {
    opacity: 0.52;
  }

  .audio-icon-button {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--bg-850);
    color: var(--muted-strong);
  }

  .audio-icon-button:hover:not(:disabled) {
    color: var(--text);
  }

  .audio-icon-button[aria-pressed="true"] {
    border-color: rgb(251 113 133 / 35%);
    background: rgb(251 113 133 / 8%);
    color: var(--red);
  }

  .audio-icon-button .icon {
    width: 16px;
    height: 16px;
  }

  .channel-details {
    min-width: 0;
    display: grid;
    gap: 2px;
  }

  .channel-details strong,
  .channel-details small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .channel-details strong {
    color: var(--text-soft);
    font-size: 0.65rem;
  }

  .channel-details small {
    color: var(--muted);
    font-size: 0.54rem;
  }

  .channel-meter {
    height: 7px;
  }

  .channel-meter i {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1px;
    background: rgb(8 12 18 / 45%);
  }

  .channel-meter i:nth-of-type(1) {
    left: 25%;
  }

  .channel-meter i:nth-of-type(2) {
    left: 50%;
  }

  .channel-meter i:nth-of-type(3) {
    left: 75%;
  }

  .gain-control {
    display: flex;
    align-items: center;
  }

  .gain-control input {
    width: 100%;
    height: 4px;
    accent-color: var(--violet);
  }

  .mixer-channel output {
    color: var(--muted);
    font: 600 0.57rem ui-monospace, SFMono-Regular, Menlo, monospace;
    text-align: right;
  }

  .transport-bar {
    min-height: 62px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 14px;
    padding-top: 10px;
  }

  .source-controls,
  .record-controls {
    gap: 7px;
  }

  .transport-button,
  .pause-button,
  .stop-button,
  .record-button {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 0 13px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--bg-850);
    color: var(--text-soft);
    font-size: 0.68rem;
    font-weight: 720;
  }

  .transport-button:hover,
  .pause-button:hover {
    border-color: var(--line-strong);
    background: var(--bg-800);
  }

  .transport-button--off {
    color: var(--muted);
  }

  .transport-button--active {
    border-color: rgb(139 92 246 / 35%);
    background: rgb(139 92 246 / 9%);
    color: #c4b5fd;
  }

  .record-button {
    min-width: 108px;
    border-color: rgb(251 113 133 / 36%);
    background: linear-gradient(180deg, #f05a71, #d83a55);
    color: #fff;
    box-shadow: 0 8px 20px rgb(216 58 85 / 18%);
  }

  .record-button:hover:not(:disabled) {
    background: linear-gradient(180deg, #fb7185, #e24861);
  }

  .record-button .icon {
    width: 15px;
    height: 15px;
  }

  .pause-button {
    min-width: 86px;
  }

  .stop-button {
    min-width: 82px;
    border-color: rgb(251 113 133 / 35%);
    background: rgb(251 113 133 / 9%);
    color: #fecdd3;
  }

  .stop-button:hover {
    background: rgb(251 113 133 / 15%);
  }

  .inspector-panel {
    overflow-y: auto;
    border-left: 1px solid var(--line-soft);
  }

  .inspector-tabs {
    height: 51px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding: 7px;
    border-bottom: 1px solid var(--line-soft);
  }

  .inspector-tabs button {
    position: relative;
    border-radius: 7px;
    background: transparent;
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 700;
  }

  .inspector-tabs button[aria-selected="true"] {
    background: var(--bg-800);
    color: var(--text);
  }

  .inspector-content {
    padding: 15px 13px;
    padding-bottom: 64px;
  }

  .library-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 12px 0;
  }

  .library-count {
    display: inline-block;
    min-width: 14px;
    padding: 1px 2px;
    border-radius: 4px;
    background: var(--bg-750);
    color: var(--text-soft);
    font-size: 0.6rem;
  }

  .library-toolbar [data-library-summary] {
    flex: 1 1 100%;
    margin: 0;
  }

  .download-cleanup-option {
    align-items: flex-start;
  }

  .download-cleanup-option input {
    flex-shrink: 0;
  }

  .studio-recordings-list .recording-card {
    display: grid;
    gap: 10px;
    padding: 12px;
  }

  .studio-recordings-list .recording-card-icon {
    display: none;
  }

  .studio-recordings-list .recording-card-title {
    flex-wrap: wrap;
  }

  .studio-recordings-list .recording-card-title h3 {
    font-size: 0.78rem;
    overflow-wrap: anywhere;
  }

  .studio-recordings-list .recording-card-main p {
    font-size: 0.65rem;
  }

  .studio-recordings-list .recording-card-actions {
    justify-content: flex-start;
  }

  .studio-recordings-list .empty-library {
    flex-wrap: wrap;
    padding: 16px;
  }

  [data-action="confirm-download-cleanup"] {
    white-space: normal;
    line-height: 1.4;
  }

  .sources-list {
    display: grid;
    gap: 6px;
    margin-top: 13px;
  }

  .source-row {
    min-height: 51px;
    display: grid;
    grid-template-columns: 16px 34px minmax(0, 1fr) 30px;
    align-items: center;
    gap: 7px;
    padding: 6px 7px;
    border: 1px solid var(--line-soft);
    border-radius: 9px;
    background: var(--bg-875);
  }

  .source-row--offline {
    opacity: 0.62;
  }

  .source-drag {
    color: var(--muted);
  }

  .source-drag .icon {
    width: 15px;
    height: 15px;
  }

  .source-icon {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 7px;
    background: var(--bg-750);
    color: var(--muted-strong);
  }

  .source-icon .icon {
    width: 16px;
    height: 16px;
  }

  .source-meta {
    min-width: 0;
    display: grid;
    gap: 3px;
  }

  .source-meta strong,
  .source-meta small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .source-meta strong {
    color: var(--text-soft);
    font-size: 0.68rem;
  }

  .source-meta small {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--muted);
    font-size: 0.57rem;
  }

  .source-meta small i {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--muted);
  }

  .source-meta small i.online {
    background: var(--green);
  }

  .source-visibility {
    width: 29px;
    height: 29px;
    display: grid;
    place-items: center;
    border-radius: 6px;
    background: transparent;
    color: var(--muted);
  }

  .source-visibility:hover {
    background: var(--bg-750);
    color: var(--text);
  }

  .source-visibility .icon {
    width: 15px;
    height: 15px;
  }

  .inspector-divider {
    height: 1px;
    margin: 16px 0;
    background: var(--line-soft);
  }

  .inspector-subheading {
    margin-bottom: 10px;
    color: var(--muted-strong);
    font-size: 0.68rem;
  }

  .quick-add-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
  }

  .quick-add-grid button {
    min-height: 62px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 6px;
    border: 1px dashed var(--line-strong);
    border-radius: 9px;
    background: transparent;
    color: var(--muted-strong);
    font-size: 0.64rem;
    font-weight: 650;
  }

  .quick-add-grid button:hover {
    border-color: var(--violet);
    background: rgb(139 92 246 / 6%);
    color: #c4b5fd;
  }

  .quick-add-grid .icon {
    width: 18px;
    height: 18px;
  }

  .inspector-info {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 16px;
    padding: 10px;
    border-radius: 8px;
    background: rgb(52 211 153 / 6%);
    color: var(--muted);
    font-size: 0.59rem;
    line-height: 1.45;
  }

  .inspector-info .icon {
    width: 14px;
    height: 14px;
    color: var(--green);
  }

  .brand-form {
    display: grid;
    gap: 15px;
    margin-top: 16px;
  }

  .overlay-controls {
    flex-shrink: 0;
    padding: 8px 0 12px;
  }

  .overlay-controls .layout-settings-row {
    gap: 8px 16px;
  }

  .design-help {
    margin: 0;
    color: var(--muted);
    font-size: 0.68rem;
    line-height: 1.5;
    overflow-wrap: anywhere;
  }

  #background-upload {
    width: 100%;
    min-width: 0;
    font-size: 0.68rem;
  }

  #background-upload::file-selector-button {
    margin-right: 8px;
    padding: 9px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--bg-850);
    color: var(--text);
    cursor: pointer;
  }

  .color-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .color-control {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
  }

  .color-control input[type="color"] {
    width: 40px;
    height: 42px;
    padding: 3px;
    border: 1px solid var(--line);
    border-right: 0;
    border-radius: 9px 0 0 9px;
    background: var(--bg-900);
  }

  .color-control input[type="text"] {
    border-radius: 0 9px 9px 0;
    font: 620 0.67rem ui-monospace, SFMono-Regular, Menlo, monospace;
    text-transform: uppercase;
  }

  .corner-fieldset {
    padding: 0;
    border: 0;
  }

  .choice-row span {
    min-height: 38px;
    font-size: 0.66rem;
  }

  /* Review */
  .review-main {
    width: min(1120px, calc(100% - 40px));
    margin-inline: auto;
    padding: 58px 0 80px;
  }

  .review-heading {
    max-width: 690px;
    margin-bottom: 30px;
  }

  .review-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 18px;
    align-items: start;
  }

  .player-card {
    padding: 14px;
  }

  .player-card video {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: var(--radius-md);
    background: #000;
  }

  .player-note {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 12px 3px 0;
    color: var(--muted);
    font-size: 0.68rem;
  }

  .player-note .icon {
    width: 14px;
    height: 14px;
    color: var(--green);
  }

  .review-details-card {
    display: grid;
    gap: 12px;
    padding: 22px;
  }

  .review-details-card h2 {
    overflow-wrap: anywhere;
    margin: -3px 0 2px;
    font-size: 1.2rem;
    letter-spacing: -0.025em;
  }

  .recording-details {
    display: grid;
    margin: 2px 0 6px;
  }

  .recording-details > div {
    min-height: 39px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid var(--line-soft);
  }

  .recording-details dt {
    color: var(--muted);
    font-size: 0.7rem;
  }

  .recording-details dd {
    margin: 0;
    color: var(--text-soft);
    font-size: 0.72rem;
    font-weight: 680;
  }

  .review-footnote {
    margin: 0;
    color: var(--muted);
    font-size: 0.65rem;
    line-height: 1.45;
    text-align: center;
  }

  .noscript-card,
  .fatal-error {
    width: min(540px, calc(100% - 40px));
    margin: 15vh auto;
    padding: 30px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--bg-875);
  }

  .noscript-card p,
  .fatal-error p {
    color: var(--muted);
    line-height: 1.55;
  }
}

@layer responsive {
  @media (min-width: 1440px) and (min-height: 850px) {
    .studio-workspace {
      grid-template-columns: 240px minmax(620px, 1fr) 330px;
    }

    .stage-column {
      padding-inline: 22px;
    }

    .layout-button > span:last-child {
      display: block;
    }

    .layout-button {
      grid-template-columns: 34px auto;
      min-width: 86px;
    }
  }

  @media (max-width: 1180px) {
    .hero-section {
      grid-template-columns: minmax(0, 0.9fr) minmax(470px, 1.1fr);
      gap: 44px;
    }

    .studio-workspace {
      grid-template-columns: 190px minmax(500px, 1fr) 270px;
    }

    .app-brand--compact > span:last-child,
    .studio-header .save-state,
    .studio-header .write-status {
      display: none;
    }

    .studio-header {
      grid-template-columns: minmax(250px, 1fr) auto minmax(120px, 1fr);
    }

    .mixer-channel {
      grid-template-columns: 30px minmax(70px, 0.6fr) minmax(70px, 1fr) 36px;
    }

    .mixer-channel .gain-control {
      display: none;
    }
  }

  @media (max-width: 980px) {
    .hero-section {
      min-height: auto;
      grid-template-columns: 1fr;
      padding-top: 64px;
    }

    .hero-copy {
      max-width: 720px;
    }

    .hero-visual {
      width: min(720px, 96%);
      margin-inline: auto;
    }

    .principles-grid {
      grid-template-columns: 1fr;
    }

    .preflight-grid {
      grid-template-columns: 1fr;
    }

    .setup-card {
      max-width: none;
    }

    .studio-shell {
      overflow: auto;
    }

    .studio-workspace {
      height: auto;
      min-height: calc(100vh - 62px);
      grid-template-columns: 160px minmax(500px, 1fr);
      overflow: visible;
    }

    .inspector-panel {
      position: static;
      z-index: auto;
      grid-column: 1 / -1;
      width: auto;
      display: block;
      overflow: visible;
      border-top: 1px solid var(--line-strong);
      border-left: 0;
      box-shadow: none;
    }

    .stage-column {
      min-height: calc(100vh - 62px);
    }

    .studio-header {
      position: sticky;
      z-index: 31;
      top: 0;
    }

    .review-grid {
      grid-template-columns: 1fr;
    }

    .review-details-card {
      width: min(100%, 620px);
    }
  }

  @media (max-width: 760px) {
    .app-header {
      padding-inline: 16px;
    }

    .header-actions .text-link,
    .step-indicator,
    .preflight-header .app-brand > span:last-child {
      display: none;
    }

    .landing-main,
    .preflight-main,
    .review-main {
      width: min(100% - 28px, 680px);
    }

    .hero-section {
      padding-top: 48px;
      gap: 50px;
    }

    .hero-copy h1 {
      font-size: clamp(3rem, 14vw, 4.8rem);
    }

    .hero-actions .button {
      width: 100%;
    }

    .privacy-float {
      right: 8px;
    }

    .section-heading {
      align-items: flex-start;
      flex-direction: column;
    }

    .empty-library,
    .recording-card {
      align-items: flex-start;
    }

    .recording-card {
      flex-wrap: wrap;
    }

    .recording-card-actions {
      width: 100%;
      justify-content: flex-end;
    }

    .landing-footer {
      align-items: flex-start;
      flex-direction: column;
      justify-content: center;
      gap: 5px;
      padding-inline: 16px;
    }

    .audio-check {
      grid-template-columns: 1fr;
      gap: 10px;
    }

    .studio-header {
      height: 56px;
      grid-template-columns: minmax(0, 1fr) auto;
      padding-inline: 10px;
    }

    .project-name-input {
      max-width: min(120px, 28vw);
    }

    .studio-header-left .header-divider,
    .studio-header-actions,
    .recording-health > span:nth-child(2) {
      display: none;
    }

    .recording-health {
      min-width: 92px;
      grid-template-columns: auto auto;
    }

    .studio-workspace {
      min-height: calc(100vh - 56px);
      display: flex;
      flex-direction: column;
    }

    .scenes-panel {
      flex: 0 0 auto;
      border-right: 0;
      border-bottom: 1px solid var(--line-soft);
    }

    .scenes-panel .panel-tip {
      display: none !important;
    }

    .scene-actions {
      display: grid;
    }

    .scene-list {
      display: flex;
      overflow-x: auto;
      padding: 8px 10px;
    }

    .scene-card {
      flex: 0 0 220px;
    }

    .scene-select {
      grid-template-columns: 18px 52px minmax(0, 1fr);
    }

    .stage-column {
      min-height: 0;
      padding: 10px;
      overflow: visible;
    }

    .canvas-frame {
      min-width: 0;
      width: 100%;
    }

    .mixer-channels {
      grid-template-columns: 1fr;
    }

    .mixer-channel + .mixer-channel {
      border-top: 1px solid var(--line-soft);
      border-left: 0;
    }

    .mixer-channel {
      grid-template-columns: 30px minmax(90px, 0.7fr) minmax(80px, 1fr) 40px;
    }

    .transport-bar {
      position: sticky;
      z-index: 15;
      bottom: 0;
      align-items: center;
      margin: 10px -10px -10px;
      padding: 10px;
      border-top: 1px solid var(--line);
      background: rgb(8 12 18 / 94%);
      backdrop-filter: blur(12px);
    }

    .studio-shell ~ .support-corner {
      bottom: max(74px, env(safe-area-inset-bottom));
    }

    .inspector-content {
      padding-bottom: 128px;
    }

    .transport-button span {
      display: none;
    }

    .transport-button {
      width: 42px;
      padding: 0;
    }

    .inspector-panel {
      width: 100%;
    }

    .review-main {
      padding-top: 42px;
    }
  }

  @media (max-width: 480px) {
    .hero-copy h1 {
      letter-spacing: -0.065em;
    }

    .trust-row {
      gap: 10px 14px;
    }

    .studio-preview-card {
      transform: none;
    }

    .preview-inspector {
      display: none;
    }

    .preview-body {
      grid-template-columns: 19% 1fr;
    }

    .principles-grid article {
      padding: 20px;
    }

    .device-preview {
      margin: 10px;
    }

    .card-header {
      padding-inline: 14px;
    }

    .segmented-control {
      grid-template-columns: 1fr;
    }

    .stage-toolbar-actions > span:first-child,
    .layout-label {
      display: none;
    }

    .layout-bar {
      justify-content: space-between;
      gap: 2px;
    }

    .layout-button {
      padding-inline: 5px;
    }

    .mixer-channel {
      grid-template-columns: 30px minmax(75px, 0.8fr) minmax(65px, 1fr) 34px;
      gap: 6px;
    }

    .source-controls {
      gap: 4px;
    }

    .record-button {
      min-width: 93px;
    }

    .review-details-card {
      padding: 18px;
    }
  }

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

  @media (forced-colors: active) {
    .button,
    .icon-button,
    .scene-card,
    .source-row,
    .canvas-frame,
    .device-preview-card,
    .setup-card,
    .player-card,
    .review-details-card {
      border: 1px solid ButtonText;
    }

    .hero-copy h1 span {
      background: none;
      color: LinkText;
    }

    .status-dot,
    .recording-state-dot,
    .source-meta small i {
      forced-color-adjust: none;
    }
  }
}
