/* The shell stays flat while the media plane follows the measured screen corners. */
[data-kind="laptop-perspective"] .v2-stage {
  min-height: 0;
  padding: 0;
}

.lp-studio {
  --lp-accent: var(--accent, #35d6c8);
  --lp-stage: #121522;
  --lp-ink: #f5f3ec;
  --lp-muted: #c0bccd;
  --lp-rule: #ffffff24;
  --lp-panel: #1b1d2a;
  position: relative;
  isolation: isolate;
  container: lp-stage / inline-size;
  min-width: 0;
  padding: clamp(14px, 3vw, 32px);
  overflow: hidden;
  color: var(--brand-text, var(--lp-ink));
  background: var(--brand-surface, var(--lp-stage));
}

[data-theme="light"] .lp-studio {
  --lp-stage: #eeebf2;
  --lp-ink: #211c2a;
  --lp-muted: #625d70;
  --lp-rule: #231a3b28;
  --lp-panel: #f9f7fa;
}

.lp-stage-head {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 5px 14px;
  padding-bottom: 11px;
  border-bottom: 1px solid var(--lp-rule);
  color: var(--brand-text, var(--lp-muted));
  font-size: 12px;
}

.lp-stage-head p {
  margin: 0;
}

.lp-eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--brand-text, var(--lp-ink));
  font-weight: 700;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.lp-eyebrow i {
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: 50%;
  background: var(--lp-accent);
}

.lp-media-label {
  font-variant-numeric: tabular-nums;
}

.lp-composition {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(162px, .35fr);
  align-items: center;
  gap: clamp(12px, 3.8cqi, 44px);
  padding-block: clamp(15px, 2.9cqi, 32px);
}

.lp-device {
  --lp-shell-ratio: 1.5;
  --lp-height-budget: clamp(220px, 45svh, 495px);
  position: relative;
  isolation: isolate;
  min-width: 0;
  width: min(100%, 840px, calc(var(--lp-height-budget) * var(--lp-shell-ratio)));
  aspect-ratio: var(--lp-shell-ratio);
  margin: 0 auto;
}

.lp-shell {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: fill;
  filter: drop-shadow(0 18px 17px #08091162);
  pointer-events: none;
  user-select: none;
}

.lp-orbit, .lp-orbit-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.lp-orbit {
  z-index: 1;
  pointer-events: none;
}

.lp-orbit-canvas {
  cursor: grab;
  pointer-events: auto;
  touch-action: none;
}

.lp-orbit-canvas:active {
  cursor: grabbing;
}

.lp-orbit-reset {
  position: absolute;
  bottom: 0;
  right: 0;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--lp-rule);
  border-radius: 10px;
  color: var(--brand-text, var(--lp-ink));
  background: var(--lp-panel);
  pointer-events: auto;
}

.lp-orbit-reset svg {
  width: 18px;
  height: 18px;
}

.lp-device:has(.lp-orbit-canvas:not([hidden])) .lp-shell,
.lp-device:has(.lp-orbit-canvas[data-screen-visible="false"]:not([hidden])) .lp-screen {
  visibility: hidden;
}

.lp-studio:has(.lp-orbit-canvas:not([hidden])) .lp-static-note,
.lp-studio:not(:has(.lp-orbit-canvas:not([hidden]))) :is(.lp-orbit-note, .lp-orbit-badge) {
  display: none;
}

.lp-orbit-badge {
  color: var(--brand-text, var(--lp-muted));
  letter-spacing: normal;
}

.lp-screen {
  position: absolute;
  inset: 0 auto auto 0;
  z-index: 2;
  container: lp-plane / inline-size;
  width: 75%;
  aspect-ratio: 3456 / 2234;
  overflow: hidden;
  border-radius: 2.4% 2.4% 0 0 / 3.8% 3.8% 0 0;
  clip-path: polygon(0 0, 44.1% 0, 44.1% 3.8%, 55.9% 3.8%, 55.9% 0, 100% 0, 100% 100%, 0 100%);
  color: #f8f5ec;
  background: #13161d;
  transform-origin: 0 0;
  transform: var(--lp-projection, none);
  pointer-events: none;
}

.lp-screen[data-projected="false"] {
  visibility: hidden;
}

.lp-sample, .lp-image, .lp-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.lp-image, .lp-video {
  display: block;
  max-width: none;
  object-fit: contain;
  object-position: center;
}

.lp-screen[data-fit="cover"] :is(.lp-image, .lp-video) {
  object-fit: cover;
}

.lp-sample {
  display: grid;
  isolation: isolate;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: clamp(3px, 2cqi, 12px);
  padding: clamp(8px, 5cqi, 27px);
  color: var(--brand-text, #f4f5e9);
  background: var(--brand-surface, #11151e);
}

.lp-sample-top, .lp-sample-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 4px 8px;
  color: var(--brand-text, #d2e0d8);
  font-size: clamp(7px, 2.6cqi, 14px);
  line-height: 1.2;
}

.lp-sample-top {
  padding-bottom: clamp(3px, 1.4cqi, 8px);
  border-bottom: 1px solid #edf6e83d;
  font-weight: 700;
}

.lp-sample-foot {
  padding-top: clamp(3px, 1.4cqi, 8px);
  border-top: 1px solid #edf6e83d;
}

.lp-sample-content {
  display: grid;
  grid-template-columns: minmax(0, 1.14fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(6px, 3.6cqi, 21px);
}

.lp-sample-art {
  align-self: stretch;
  min-height: 0;
  overflow: hidden;
  border: 1px solid #c8b5ff42;
  border-radius: clamp(4px, 1.7cqi, 12px);
  background: radial-gradient(ellipse at 42% 34%, #453967, #211d35 78%);
}

.lp-sample-art img {
  display: block;
  width: 100%;
  height: 100%;
  padding: 7%;
  object-fit: contain;
}

.lp-sample-content h2 {
  margin: 0 0 clamp(3px, 1.9cqi, 11px);
  font: 480 clamp(13px, 7.5cqi, 48px) / 1.02 Fraunces, serif;
  letter-spacing: normal;
  overflow-wrap: anywhere;
}

.lp-sample-copy p {
  margin: 0;
  font-size: clamp(7px, 2.8cqi, 16px);
  line-height: 1.3;
}

.lp-sample-copy p:first-child {
  margin-bottom: clamp(3px, 1.2cqi, 8px);
  color: var(--brand-text, #b9e2cb);
  font-size: clamp(7px, 2.3cqi, 13px);
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.lp-stage-note {
  max-width: 280px;
  padding: 10px 0 10px clamp(12px, 2cqi, 23px);
  border-left: 1px solid var(--lp-rule);
}

.lp-stage-note p {
  margin: 0;
  color: var(--brand-text, var(--lp-muted));
  font-size: 13px;
}

.lp-stage-note :is(h2, h3, strong) {
  display: block;
  margin: 5px 0 8px;
  font: 480 clamp(24px, 3.4cqi, 37px) / 1.08 Fraunces, serif;
  letter-spacing: normal;
}

.lp-stage-note .lp-stage-kicker {
  color: var(--brand-text, var(--lp-ink));
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
}

.lp-stage-note .v2-button {
  margin-top: 13px;
  font-size: 13px;
}

.lp-transport {
  display: grid;
  grid-template-columns: max-content minmax(56px, 1fr) max-content max-content;
  align-items: center;
  gap: 6px 10px;
  max-width: 820px;
  margin-inline: auto;
  padding: 8px;
  border: 1px solid var(--lp-rule);
  border-radius: 13px;
  color: var(--brand-text, var(--lp-ink));
  background: var(--lp-panel);
}

.lp-transport button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 44px;
  min-height: 44px;
  padding: 5px 10px;
  border: 1px solid var(--lp-rule);
  border-radius: 9px;
  color: var(--brand-text, var(--lp-ink));
  background: transparent;
  font-size: 12px;
}

.lp-transport button:hover, .lp-transport button[aria-pressed="true"] {
  border-color: var(--lp-accent);
}

.lp-transport svg {
  width: 17px;
  height: 17px;
}

.lp-transport label {
  min-width: 0;
}

.lp-transport input[type="range"] {
  width: 100%;
  min-height: 44px;
  margin: 0;
  accent-color: var(--lp-accent);
}

.lp-elapsed {
  color: var(--brand-text, var(--lp-muted));
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.lp-settings, .lp-upload-row {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.lp-upload-row {
  grid-template-columns: repeat(auto-fit, minmax(min(106px, 100%), 1fr));
}

.lp-settings p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.lp-upload-row .v2-upload {
  position: relative;
  min-height: 44px;
  padding: 8px;
  font-size: 13px;
  text-align: center;
}

.lp-upload-row input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  opacity: 0;
  cursor: pointer;
}

.lp-upload-row .v2-upload:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.lp-settings .v2-text-button {
  justify-self: start;
}

.lp-fit {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
}

.lp-fit select {
  width: 100%;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--text);
  background: var(--page);
  font-size: 16px;
}

.lp-media-status:empty {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.lp-editor-scroll .v2-panel-live {
  margin-top: 12px;
  padding-top: 4px;
}

.lp-editor-scroll .v2-panel-live:first-child {
  border-top: 0;
  margin-top: 3px;
}

.lp-editor-scroll [data-template-brand-panel] {
  margin-top: 12px;
}

.lp-reset {
  margin-top: 8px;
}

[data-lp-workspace] .lp-editor-scroll :is(input, select, textarea, button, summary) {
  scroll-margin-block: 6px;
}

@container lp-stage (max-width: 575px) {
  .lp-composition {
    grid-template-columns: minmax(0, 1fr);
    gap: 7px;
  }

  .lp-stage-note {
    padding-block: 4px;
  }

  .lp-stage-note :is(h2, h3, strong) {
    font-size: 22px;
  }
}

@container lp-stage (max-width: 440px) {
  .lp-transport {
    gap: 4px;
  }

  .lp-transport button:has([data-lp-play-icon]:not(:empty), [data-lp-audio-icon]:not(:empty)) {
    width: 44px;
    padding: 5px;
  }

  .lp-transport button:has([data-lp-play-icon]:not(:empty), [data-lp-audio-icon]:not(:empty)) :is([data-lp-play-label], [data-lp-audio-label]) {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}

/* The viewport holds the artboard and heading while the inspector body scrolls. */
@media (min-width: 960px) and (min-height: 420px), (max-width: 959px) and (min-height: 450px) {
  [data-lp-workspace][data-editor-collapsed="false"]:not([data-editor-constrained="true"]) {
    overflow-anchor: none;
  }

  [data-lp-workspace][data-editor-collapsed="false"]:not([data-editor-constrained="true"]) [data-editor-layout] {
    height: var(--editor-available-height);
    align-items: stretch;
  }

  [data-lp-workspace][data-editor-collapsed="false"]:not([data-editor-constrained="true"]) :is([data-editor-preview], [data-editor-panel]) {
    height: 100%;
    min-height: 0;
    max-height: 100%;
    overflow: hidden;
    scrollbar-gutter: auto;
  }

  [data-lp-workspace][data-editor-collapsed="false"]:not([data-editor-constrained="true"]) [data-editor-panel] {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    padding-bottom: 0;
  }

  [data-lp-workspace][data-editor-collapsed="false"]:not([data-editor-constrained="true"]) .v2-editor-panel-head {
    position: relative;
    min-height: 52px;
    padding-block: 4px;
  }

  [data-lp-workspace][data-editor-collapsed="false"]:not([data-editor-constrained="true"]) .lp-editor-scroll {
    min-width: 0;
    min-height: 0;
    margin-inline: -4px;
    padding: 0 4px 12px;
    overflow: hidden auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-gutter: stable;
  }

  [data-lp-workspace][data-editor-collapsed="false"]:not([data-editor-constrained="true"]) :is(.v2-stage, .lp-studio) {
    height: 100%;
    min-height: 0;
  }

  [data-lp-workspace][data-editor-collapsed="false"]:not([data-editor-constrained="true"]) .v2-stage {
    padding: 0;
  }

  [data-lp-workspace][data-editor-collapsed="false"]:not([data-editor-constrained="true"]) .lp-studio {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 8px;
    padding: clamp(10px, 2vw, 22px);
  }

  [data-lp-workspace][data-editor-collapsed="false"]:not([data-editor-constrained="true"]) .lp-composition {
    container-type: size;
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
    padding: 0;
  }

  [data-lp-workspace][data-editor-collapsed="false"]:not([data-editor-constrained="true"]) .lp-device {
    width: min(100%, 840px, calc(100cqh * var(--lp-shell-ratio)));
  }

  [data-lp-workspace][data-editor-collapsed="false"]:not([data-editor-constrained="true"]) .lp-stage-note {
    display: none;
  }

  [data-lp-workspace][data-editor-collapsed="false"]:not([data-editor-constrained="true"]) .lp-transport {
    width: min(100%, 680px);
  }
}

@media (max-width: 959px) and (min-height: 450px) {
  [data-lp-workspace][data-editor-collapsed="false"]:not([data-editor-constrained="true"]) [data-editor-layout] {
    grid-template-rows: clamp(166px, calc(var(--editor-available-height) * .46), 328px) minmax(0, 1fr);
  }

  [data-lp-workspace][data-editor-collapsed="false"]:not([data-editor-constrained="true"]) .v2-toolbar {
    justify-content: flex-end;
    padding-block: 6px;
  }

  [data-lp-workspace][data-editor-collapsed="false"]:not([data-editor-constrained="true"]) .v2-toolbar-label {
    display: none;
  }

  [data-lp-workspace][data-editor-collapsed="false"]:not([data-editor-constrained="true"]) .lp-studio {
    gap: 4px;
    padding: 7px 9px;
  }

  [data-lp-workspace][data-editor-collapsed="false"]:not([data-editor-constrained="true"]) .lp-stage-head {
    padding-bottom: 4px;
    font-size: 10px;
  }

  [data-lp-workspace][data-editor-collapsed="false"]:not([data-editor-constrained="true"]) .lp-transport {
    padding: 0 3px;
    gap: 3px 5px;
  }
}

html[data-view="thumbnail"] .lp-device {
  width: min(100%, 730px);
}

html[data-view="thumbnail"] :is(.lp-stage-note .v2-button, .lp-transport, .lp-orbit-reset) {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .lp-studio *, .lp-studio *::before, .lp-studio *::after {
    animation: none !important;
    transition: none !important;
  }
}
