:root {
  --bg-0: #07080b;
  --bg-1: #11141a;
  --bg-2: #1a1f2a;
  --ink-0: #f4f6fb;
  --ink-1: #d8deea;
  --ink-2: #9ba7be;
  --line: rgba(255, 255, 255, 0.1);
  --panel: rgba(10, 14, 20, 0.92);
  --panel-2: rgba(18, 24, 35, 0.94);
  --accent: #4de2c8;
  --accent-2: #ff6bb8;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.34);
  --radius: 14px;
  --radius-sm: 10px;
  --drawer-w: min(440px, calc(100vw - 16px));
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 20% 10%, #121828 0%, #090b11 45%, #050608 100%);
  color: var(--ink-0);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, sans-serif;
}

button,
input,
select,
summary {
  font: inherit;
  color: inherit;
}

button,
input,
select {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

button {
  padding: 10px 12px;
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease, transform 120ms ease;
}

button:hover {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(32, 40, 56, 0.95);
}

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

button.primary {
  background: linear-gradient(180deg, rgba(77, 226, 200, 0.22), rgba(77, 226, 200, 0.11));
  border-color: rgba(77, 226, 200, 0.5);
}

input[type="text"],
input[type="number"],
select {
  width: 100%;
  padding: 9px 10px;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
  background: transparent;
}

input[type="color"] {
  width: 100%;
  min-height: 40px;
  padding: 2px;
}

.app-shell {
  position: fixed;
  inset: 0;
  overflow: hidden;
}

.top-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 36;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: max(8px, env(safe-area-inset-top)) 10px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background:
    linear-gradient(180deg, rgba(20, 23, 30, 0.94), rgba(12, 14, 19, 0.94)),
    radial-gradient(circle at 90% -40%, rgba(255, 107, 184, 0.14), transparent 45%);
}

.top-bar:not(.is-open) {
  display: none;
}

.bar-left,
.bar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.bar-right {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.status-wrap {
  min-width: 0;
}

.status-title {
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.03em;
}

.status-text {
  color: var(--ink-2);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: min(48vw, 520px);
}

.chip {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 12px;
  color: var(--ink-1);
}

.icon-btn {
  border-radius: 999px;
  padding: 9px 12px;
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.15);
  white-space: nowrap;
}

.icon-btn.primary {
  background: rgba(77, 226, 200, 0.14);
}

.stage-shell {
  position: absolute;
  inset: 0;
  min-height: 0;
}

#stage-canvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: grab;
  background: #050709;
}

#stage-canvas.is-dragging {
  cursor: grabbing;
}

.boot-loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  background: linear-gradient(90deg, #fd49cd 0%, #fc6acd 50%, #ff00f7 100%);
  opacity: 1;
  visibility: visible;
  transition: opacity 180ms ease, visibility 180ms ease;
  overflow: hidden;
}

.boot-loading-overlay.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.boot-loading-flash {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.98);
  opacity: 0;
  pointer-events: none;
  animation: boot-loading-flash 520ms ease-out 1;
}

.boot-loading-stack {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 0;
}

.boot-loading-overlay img {
  --loading-overlay-shift-y: 6%;
  width: min(34vmin, 220px);
  height: auto;
  object-fit: contain;
  object-position: center center;
  image-rendering: auto;
  transform-origin: 50% 50%;
  transform: translate3d(0, var(--loading-overlay-shift-y, 0%), 0) scale(2.334);
  transition: transform 150ms linear;
  user-select: none;
  -webkit-user-drag: none;
}

@keyframes boot-loading-flash {
  0% {
    opacity: 0.96;
  }

  100% {
    opacity: 0;
  }
}

.objkt-hover-card {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 26;
  min-width: 170px;
  max-width: min(320px, calc(100vw - 24px));
  pointer-events: none;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  background:
    linear-gradient(180deg, rgba(255, 248, 253, 0.16), rgba(255, 226, 243, 0.11) 56%, rgba(255, 191, 229, 0.08)),
    radial-gradient(circle at 26% 14%, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0) 48%);
  box-shadow:
    0 16px 28px rgba(31, 10, 28, 0.16),
    0 0 22px rgba(255, 215, 239, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
  padding: 14px 16px;
  transform: translate(-50%, calc(-100% - 16px));
  overflow: hidden;
  isolation: isolate;
  backdrop-filter: blur(14px) saturate(1.06) brightness(1.02);
  -webkit-backdrop-filter: blur(14px) saturate(1.06) brightness(1.02);
}

.objkt-hover-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0) 54%),
    radial-gradient(circle at 22% 10%, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0) 42%);
  pointer-events: none;
  z-index: 0;
}

.objkt-hover-card::after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 19px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  pointer-events: none;
  z-index: 0;
}

.objkt-hover-card > * {
  position: relative;
  z-index: 1;
}

.objkt-bubble-label {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.34);
  color: rgba(82, 54, 76, 0.92);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.objkt-hover-name {
  font-weight: 700;
  font-size: 14px;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.96);
  word-break: break-word;
}

.objkt-hover-owner-row {
  margin-top: 6px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.9);
  word-break: break-word;
}

.objkt-modal {
  position: absolute;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
}

.objkt-modal[hidden] {
  display: none;
}

.objkt-modal-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 108, 210, 0.18), rgba(255, 108, 210, 0) 52%),
    rgba(42, 10, 34, 0.36);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.objkt-modal-panel {
  position: relative;
  z-index: 1;
  width: min(840px, calc(100vw - 28px));
  max-height: calc(100vh - 32px);
  overflow: auto;
  border-radius: 34px;
  border: 1.5px solid rgba(255, 255, 255, 0.7);
  background:
    linear-gradient(180deg, rgba(255, 245, 252, 0.28), rgba(255, 191, 231, 0.24)),
    radial-gradient(circle at 24% 14%, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0) 46%),
    linear-gradient(135deg, rgba(255, 192, 233, 0.34), rgba(255, 223, 246, 0.2));
  box-shadow:
    0 28px 44px rgba(31, 10, 28, 0.18),
    0 0 42px rgba(255, 214, 238, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.42);
  padding: 24px 26px 24px;
  color: rgba(255, 255, 255, 0.96);
}

.objkt-modal-panel .icon-btn {
  min-width: 38px;
  min-height: 38px;
  padding: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.44);
  color: rgba(255, 255, 255, 0.96);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.objkt-modal-panel .icon-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.54);
}

.objkt-modal-content {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(240px, 0.88fr);
  gap: 22px;
  align-items: stretch;
}

.objkt-modal-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 2px 0;
}

.objkt-modal-media {
  margin: 0;
  min-width: 0;
  align-self: stretch;
  aspect-ratio: 1 / 1;
  border-radius: 26px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.42);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 200, 232, 0.14)),
    radial-gradient(circle at 40% 10%, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0) 48%);
  display: grid;
  place-items: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.objkt-modal-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.08);
}

.objkt-modal-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.08);
}

.objkt-modal-grid {
  margin: 0;
  display: grid;
  gap: 12px;
}

.objkt-modal-row {
  margin: 0;
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 14px;
  align-items: start;
  font-size: 13px;
}

.objkt-modal-row dt {
  color: rgba(255, 255, 255, 0.8);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 10px;
  font-weight: 700;
}

.objkt-modal-row dd {
  margin: 0;
  color: rgba(255, 255, 255, 0.98);
  font-size: 14px;
  font-weight: 600;
  word-break: break-word;
}

.objkt-modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: auto;
}

.objkt-modal-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 8px 14px;
  border-radius: 14px;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.96);
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.48);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 191, 229, 0.18));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.objkt-modal-link:hover {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.24), rgba(255, 191, 229, 0.24));
  filter: brightness(1.03);
}

.world-utility-bar {
  position: absolute;
  left: 50%;
  bottom: 16px;
  z-index: 35;
  display: flex;
  align-items: center;
  gap: 10px;
  transform: translateX(-50%);
}

.world-utility-btn {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.52);
  background:
    linear-gradient(180deg, rgba(255, 245, 252, 0.24), rgba(255, 191, 229, 0.16)),
    radial-gradient(circle at 32% 18%, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0) 52%);
  box-shadow:
    0 10px 18px rgba(44, 10, 32, 0.18),
    0 0 18px rgba(255, 221, 240, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.26);
  color: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
}

.world-utility-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.68);
}

.world-utility-btn.is-active {
  background:
    linear-gradient(180deg, rgba(255, 251, 254, 0.34), rgba(255, 196, 232, 0.26)),
    radial-gradient(circle at 32% 18%, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0) 52%);
  border-color: rgba(255, 255, 255, 0.74);
}

.world-utility-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.world-utility-btn .speech-icon-dots {
  display: none;
}

.world-utility-btn.is-compact-icon .speech-icon-bubble {
  display: none;
}

.world-utility-btn.is-compact-icon .speech-icon-dots {
  display: block;
}

.world-utility-btn .speech-icon-dots circle {
  fill: currentColor;
  stroke: none;
}

.world-utility-btn .icon-muted {
  opacity: 0;
}

.world-utility-btn.is-muted .icon-wave {
  opacity: 0.16;
}

.world-utility-btn.is-muted .icon-muted {
  opacity: 1;
}

@media (max-width: 760px) {
  .objkt-modal-content {
    grid-template-columns: 1fr;
  }

  .objkt-modal-media {
    max-width: min(100%, 360px);
    justify-self: center;
  }

  .objkt-modal-copy {
    padding-top: 0;
  }

  .objkt-modal-actions {
    flex-wrap: wrap;
  }
}

.stage-controls {
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: flex;
  gap: 8px;
  z-index: 20;
}

.drawer {
  position: absolute;
  z-index: 30;
  top: 8px;
  left: 8px;
  width: var(--drawer-w);
  max-height: calc(100% - 16px);
  overflow: auto;
  background:
    linear-gradient(180deg, rgba(14, 18, 24, 0.98), rgba(10, 13, 18, 0.98)),
    radial-gradient(circle at 15% -10%, rgba(77, 226, 200, 0.12), transparent 55%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  box-shadow: var(--shadow);
  transform: translateX(calc(-100% - 14px));
  transition: transform 170ms ease;
  padding: 12px;
}

.drawer.is-open {
  transform: translateX(0);
}

.drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.drawer-head h1 {
  margin: 0;
  font-size: 16px;
}

.drawer-head p {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--ink-2);
}

.tab-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 10px;
}

.tab-btn {
  padding: 10px;
  text-align: center;
}

.tab-btn.active {
  border-color: rgba(77, 226, 200, 0.45);
  background: rgba(77, 226, 200, 0.12);
}

.panel-card {
  margin: 0 0 10px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
}

.panel-card > summary {
  cursor: pointer;
  list-style: none;
  font-weight: 700;
  margin: -2px 0 10px;
}

.panel-card > summary::-webkit-details-marker {
  display: none;
}

.subpanel {
  margin: 8px 0;
  padding: 8px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.015);
}

.subpanel > summary {
  cursor: pointer;
  list-style: none;
  font-weight: 600;
  font-size: 12px;
  color: var(--ink-1);
  margin: -2px 0 8px;
}

.subpanel > summary::-webkit-details-marker {
  display: none;
}

.field-grid {
  display: grid;
  gap: 10px;
}

.field-grid.two {
  grid-template-columns: 1fr;
}

.field-grid.three {
  grid-template-columns: 1fr;
}

.field-grid label,
.inline-num {
  display: grid;
  gap: 6px;
  color: var(--ink-1);
  font-size: 12px;
}

.range-with-number {
  display: grid;
  grid-template-columns: 1fr 84px;
  gap: 8px;
  align-items: center;
}

.range-number {
  width: 100%;
  padding: 8px 10px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.field-grid label > span,
.inline-num > span {
  color: var(--ink-2);
}

.btn-row {
  display: flex;
  gap: 8px;
}

.btn-row.wrap {
  flex-wrap: wrap;
}

.inline-num {
  grid-auto-flow: column;
  grid-template-columns: auto 88px;
  align-items: center;
  gap: 8px;
  padding: 0 2px;
}

.toggle-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin: 8px 0;
}

.toggle-row label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--ink-1);
}

.color-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 8px;
}

.panel-note {
  margin: 0 0 10px;
  color: var(--ink-2);
  font-size: 12px;
  line-height: 1.35;
}

.layer-motion-list {
  display: grid;
  gap: 8px;
}

.layer-motion-row {
  display: grid;
  gap: 8px;
  padding: 8px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.015);
}

.layer-motion-row.is-active {
  border-color: rgba(77, 226, 200, 0.28);
  background: rgba(77, 226, 200, 0.045);
}

.layer-motion-name {
  font-weight: 700;
  color: var(--ink-0);
  font-size: 12px;
  letter-spacing: 0.02em;
}

.layer-motion-row label {
  display: grid;
  gap: 6px;
  font-size: 12px;
}

.layer-motion-row label > span {
  color: var(--ink-2);
}

@media (min-width: 720px) {
  .boot-loading-overlay img {
    --loading-overlay-shift-y: -6%;
  }

  .field-grid.two {
    grid-template-columns: 1fr 1fr;
  }

  .field-grid.three {
    grid-template-columns: 1fr 1fr 1fr;
  }

  .layer-motion-row {
    grid-template-columns: minmax(0, 1.1fr) repeat(3, minmax(0, 1fr));
    align-items: end;
  }
}

.checklist-box {
  margin-top: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  padding: 8px;
}

.checklist-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.checklist-head .panel-note {
  margin: 0;
}

.checklist-list {
  display: grid;
  gap: 4px;
  max-height: 180px;
  overflow: auto;
  padding-right: 2px;
}

.checklist-item {
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 10px;
  padding: 6px 8px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.checklist-item.is-active {
  border-color: rgba(77, 226, 200, 0.55);
  background: rgba(77, 226, 200, 0.16);
}

.checklist-item.is-active .name {
  color: #bffbf1;
  font-weight: 700;
}

.checklist-item.is-next {
  border-color: rgba(253, 224, 71, 0.35);
  background: rgba(253, 224, 71, 0.08);
}

.checklist-item.is-next .name {
  color: #fff1b8;
}

.checklist-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
}

.checklist-item .name {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.checklist-empty {
  color: var(--ink-2);
  font-size: 12px;
  padding: 4px 2px;
}

@media (max-width: 719px) {
  .top-bar {
    align-items: flex-start;
    flex-direction: column;
  }

  .bar-right {
    width: 100%;
    justify-content: flex-start;
  }

  .status-text {
    max-width: 90vw;
  }

  .drawer {
    width: calc(100vw - 16px);
    max-height: calc(100% - 16px);
  }

  .range-with-number {
    grid-template-columns: 1fr 78px;
  }

  .stage-controls {
    right: 8px;
    bottom: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .drawer,
  button {
    transition: none;
  }
}
