:root {
  color-scheme: dark;
  --bg: #07090e;
  --panel: rgba(15, 19, 28, 0.9);
  --panel-strong: #111620;
  --panel-soft: #151b26;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: #f3f6f8;
  --muted: #8993a5;
  --muted-2: #9aa5b8;
  --cyan: #46dcd3;
  --cyan-strong: #77f3e9;
  --cyan-dim: rgba(70, 220, 211, 0.12);
  --lime: #c8ef66;
  --amber: #ffb454;
  --red: #ff667e;
  --violet: #9f8dff;
  --radius: 16px;
  --mono: "SFMono-Regular", "Cascadia Code", "Roboto Mono", Consolas, monospace;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

[hidden] {
  display: none !important;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
}

body {
  overflow: hidden;
  background:
    radial-gradient(circle at 68% 7%, rgba(52, 121, 130, 0.13), transparent 31%),
    radial-gradient(circle at 8% 92%, rgba(112, 88, 187, 0.1), transparent 28%),
    #080a0f;
}

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

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

.ambient {
  position: fixed;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  filter: blur(100px);
  pointer-events: none;
  opacity: 0.09;
}

.ambient-one {
  top: -240px;
  right: 17%;
  background: var(--cyan);
}

.ambient-two {
  bottom: -300px;
  left: 4%;
  background: var(--violet);
}

.app-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: 60px calc(100vh - 60px);
  min-height: 100vh;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(315px, 1fr) auto;
  align-items: center;
  gap: 24px;
  height: 60px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 11, 16, 0.82);
  backdrop-filter: blur(24px);
}

.brand-block,
.replay-title-block,
.panel-heading,
.section-title-row,
.top-actions,
.view-actions,
.header-stats,
.playback-controls,
.transport {
  display: flex;
  align-items: center;
}

.brand-block {
  gap: 13px;
}

.brand-mark {
  position: relative;
  width: 36px;
  height: 36px;
  transform: rotate(-4deg);
}

.brand-mark span {
  position: absolute;
  display: block;
  width: 14px;
  height: 14px;
  border: 2px solid var(--cyan);
  background: rgba(70, 220, 211, 0.1);
  box-shadow: inset 0 0 8px rgba(70, 220, 211, 0.18);
}

.brand-mark span:nth-child(1) { left: 0; bottom: 0; }
.brand-mark span:nth-child(2) { left: 10px; bottom: 7px; }
.brand-mark span:nth-child(3) { left: 20px; bottom: 14px; }
.brand-mark span:nth-child(4) { width: 7px; height: 7px; left: 30px; bottom: 24px; border-color: var(--lime); }
.brand-mark span:nth-child(5) { width: 4px; height: 4px; left: 34px; bottom: 32px; border: 0; background: var(--lime); box-shadow: 0 0 8px var(--lime); }

.eyebrow {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  line-height: 1.4;
}

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

h1 {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 2px;
  font-size: 21px;
  font-weight: 720;
  letter-spacing: -0.035em;
}

h2 {
  margin-top: 3px;
  font-size: 18px;
  letter-spacing: -0.025em;
}

h3 {
  margin-top: 3px;
  font-size: 15px;
  letter-spacing: -0.015em;
}

.mode-tag {
  padding: 3px 7px 2px;
  border: 1px solid rgba(200, 239, 102, 0.24);
  border-radius: 5px;
  background: rgba(200, 239, 102, 0.08);
  color: var(--lime);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
}

.header-stats {
  display: none;
  justify-content: center;
  gap: 1px;
  border: 1px solid var(--line);
  border-radius: 11px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.02);
}

.header-stat {
  min-width: 105px;
  padding: 8px 15px 7px;
  border-right: 1px solid var(--line);
}

.header-stat:last-child {
  border: 0;
}

.header-stat.wide {
  min-width: 145px;
}

.header-stat span,
.frame-readout span,
.speed-control > span {
  display: block;
  margin-bottom: 2px;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.header-stat strong {
  display: block;
  overflow: hidden;
  max-width: 150px;
  color: var(--cyan-strong);
  font-family: var(--mono);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.icon-button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  font-family: var(--mono);
  font-weight: 700;
  transition: 160ms ease;
}

.icon-button:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.icon-button svg {
  width: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.workspace {
  --left-panel-width: 320px;
  --right-panel-width: 360px;
  display: grid;
  grid-template-columns: var(--left-panel-width) 12px minmax(560px, 1fr) 12px var(--right-panel-width);
  gap: 0;
  min-height: 0;
  padding: 12px;
}

.layout-resizer {
  position: relative;
  z-index: 12;
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
  outline: 0;
  touch-action: none;
}

.layout-resizer::before {
  content: "";
  display: block;
  border-radius: 999px;
  background: rgba(137, 147, 165, 0.28);
  transition: width 120ms ease, height 120ms ease, background 120ms ease, box-shadow 120ms ease;
}

.layout-resizer.vertical {
  cursor: col-resize;
}

.layout-resizer.vertical::before {
  width: 2px;
  height: 42px;
}

.layout-resizer.horizontal {
  cursor: row-resize;
}

.layout-resizer.horizontal::before {
  position: absolute;
  width: 116px;
  height: 1px;
}

.layout-resizer.horizontal > span {
  position: relative;
  z-index: 1;
  padding: 2px 8px;
  border: 1px solid rgba(70, 220, 211, 0.16);
  border-radius: 999px;
  background: #0d121a;
  color: rgba(137, 147, 165, 0.7);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  pointer-events: none;
  transition: 120ms ease;
}

.layout-resizer:hover::before,
.layout-resizer:focus-visible::before,
.layout-resizer.active::before {
  background: var(--cyan);
  box-shadow: 0 0 10px rgba(70, 220, 211, 0.42);
}

.layout-resizer.vertical:hover::before,
.layout-resizer.vertical:focus-visible::before,
.layout-resizer.vertical.active::before {
  width: 3px;
}

.layout-resizer.horizontal:hover::before,
.layout-resizer.horizontal:focus-visible::before,
.layout-resizer.horizontal.active::before {
  height: 2px;
}

.layout-resizer.horizontal:hover > span,
.layout-resizer.horizontal:focus-visible > span,
.layout-resizer.horizontal.active > span {
  border-color: rgba(70, 220, 211, 0.52);
  color: var(--cyan);
  box-shadow: 0 0 12px rgba(70, 220, 211, 0.14);
}

body.resizing-layout {
  user-select: none;
}

body.resizing-layout.resize-columns,
body.resizing-layout.resize-columns * {
  cursor: col-resize !important;
}

body.resizing-layout.resize-rows,
body.resizing-layout.resize-rows * {
  cursor: row-resize !important;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(18px);
}

.replay-panel,
.inspector-panel {
  min-height: 0;
  padding: 17px;
}

.replay-panel {
  display: flex;
  flex-direction: column;
}

.panel-heading,
.section-title-row {
  justify-content: space-between;
}

.count-pill {
  min-width: 32px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  text-align: center;
}

.search-box {
  position: relative;
  display: block;
  margin-top: 17px;
}

.search-box svg {
  position: absolute;
  top: 50%;
  left: 11px;
  width: 15px;
  transform: translateY(-50%);
  fill: none;
  stroke: var(--muted-2);
  stroke-width: 1.8;
}

.search-box input,
.select-wrap select,
.speed-control select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(5, 8, 12, 0.55);
  color: var(--text);
}

.search-box input {
  height: 39px;
  padding: 0 12px 0 34px;
  font-family: var(--mono);
  font-size: 11px;
}

.search-box input::placeholder {
  color: var(--muted-2);
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.filter-chip {
  height: 27px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  transition: 150ms ease;
}

.filter-chip:hover,
.filter-chip.active {
  border-color: rgba(70, 220, 211, 0.24);
  background: var(--cyan-dim);
  color: var(--cyan-strong);
}

.select-wrap {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 9px;
  margin-top: 11px;
}

.select-wrap span {
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.09em;
}

.select-wrap select {
  height: 31px;
  padding: 0 8px;
  font-size: 10px;
}

.tag-builder {
  margin-top: 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(5, 8, 12, 0.34);
}

.tag-builder summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 34px;
  padding: 0 10px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.tag-builder summary::-webkit-details-marker { display: none; }

.tag-builder summary::before {
  margin-right: 7px;
  color: var(--cyan);
  content: "▸";
  transition: transform 140ms ease;
}

.tag-builder[open] summary::before { transform: rotate(90deg); }

.tag-builder summary > span { flex: 1; }

.tag-builder summary strong {
  min-width: 20px;
  padding: 2px 5px;
  border-radius: 999px;
  background: var(--cyan-dim);
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 10px;
  text-align: center;
}

.tag-builder-body {
  padding: 0 8px 8px;
  border-top: 1px solid var(--line);
}

.rule-toolbar,
.add-rule-row,
.analytics-index > div {
  display: flex;
  align-items: center;
  gap: 6px;
}

.rule-toolbar {
  justify-content: space-between;
  padding: 7px 0;
}

.rule-toolbar label {
  display: flex;
  align-items: center;
  gap: 6px;
}

.rule-toolbar label > span {
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .07em;
}

.rule-toolbar select,
.add-rule-row select,
.tag-rule select,
.tag-rule input {
  height: 27px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(4, 7, 11, .78);
  color: var(--text);
  font-size: 10px;
}

.rule-toolbar select { width: 105px; padding: 0 6px; }

.tiny-button,
.add-rule-button,
.tag-rule-remove {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255,255,255,.025);
  color: var(--muted);
  font-size: 10px;
}

.tiny-button { height: 27px; padding: 0 8px; }

.tiny-button:hover,
.add-rule-button:hover {
  border-color: rgba(70,220,211,.3);
  color: var(--cyan);
}

.tag-rules {
  display: grid;
  gap: 5px;
  max-height: 142px;
  overflow: auto;
  scrollbar-width: thin;
}

.tag-rule {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 86px 35px 35px 25px;
  gap: 4px;
  align-items: center;
  padding: 5px;
  border: 1px solid rgba(70,220,211,.12);
  border-radius: 8px;
  background: rgba(70,220,211,.035);
}

.tag-rule-name {
  overflow: hidden;
  color: #dce6e9;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tag-rule select { width: 86px; padding: 0 4px; }

.tag-rule input {
  width: 35px;
  padding: 0 3px;
  font-family: var(--mono);
  text-align: center;
}

.tag-rule input:disabled { opacity: .25; }

.tag-rule input.invalid { border-color: var(--red); }

.tag-rule-remove {
  display: grid;
  place-items: center;
  width: 25px;
  height: 27px;
  padding: 0;
  color: var(--muted-2);
}

.tag-rule-remove:hover { color: var(--red); }

.add-rule-row { margin-top: 6px; }
.add-rule-row select { flex: 1; padding: 0 6px; }

.replay-range-filters {
  display: grid;
  gap: 5px;
  margin-top: 7px;
  padding-top: 7px;
  border-top: 1px solid var(--line);
}

.shift-filter-row,
.metric-range-row {
  display: grid;
  grid-template-columns: minmax(62px, 1fr) 74px 74px;
  align-items: center;
  gap: 5px;
}

.shift-filter-row { grid-template-columns: minmax(62px, 1fr) 153px; }

.shift-filter-row > span,
.metric-range-row > span {
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
}

.shift-filter-row select,
.metric-range-row input {
  width: 100%;
  height: 27px;
  min-width: 0;
  padding: 0 6px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(4, 7, 11, .78);
  color: var(--text);
  font-family: var(--mono);
  font-size: 10px;
}

.metric-range-row input.invalid { border-color: var(--red); }
.add-rule-button { height: 27px; padding: 0 8px; white-space: nowrap; }
.add-rule-button:disabled { cursor: default; opacity: .35; }

.analytics-index { margin-top: 8px; }

.analytics-index > div {
  justify-content: space-between;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 10px;
}

.analytics-index strong { color: var(--muted); font-weight: 700; }

.analytics-index > i {
  display: block;
  height: 3px;
  margin-top: 5px;
  overflow: hidden;
  border-radius: 2px;
  background: rgba(255,255,255,.06);
}

.analytics-index > i > span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--cyan);
  box-shadow: 0 0 8px rgba(70,220,211,.6);
  transition: width 180ms ease;
}

.replay-list {
  flex: 1;
  min-height: 0;
  margin: 13px -7px -7px;
  padding: 0 7px 9px;
  overflow: auto;
  scrollbar-color: rgba(255, 255, 255, 0.14) transparent;
  scrollbar-width: thin;
}

.replay-row {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 9px;
  width: 100%;
  margin-bottom: 5px;
  padding: 11px 11px 10px;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.022);
  text-align: left;
  transition: 150ms ease;
}

.replay-row::before {
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 0;
  width: 2px;
  border-radius: 2px;
  background: transparent;
  content: "";
}

.replay-row:hover {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.045);
}

.replay-row.active {
  border-color: rgba(70, 220, 211, 0.2);
  background: linear-gradient(90deg, rgba(70, 220, 211, 0.11), rgba(70, 220, 211, 0.025));
}

.replay-row.active::before {
  background: var(--cyan);
  box-shadow: 0 0 10px rgba(70, 220, 211, 0.55);
}

.replay-id {
  color: #dfe5e9;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
}

.replay-time {
  color: var(--text);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
}

.replay-row.active .replay-time {
  color: var(--cyan-strong);
}

.replay-date-small {
  color: var(--muted-2);
  font-size: 10px;
}

.replay-badges {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  color: var(--muted-2);
  font-size: 10px;
}

.replay-badges .star { color: var(--amber); }
.replay-badges .verified { color: var(--cyan); }
.replay-badges .pb { color: var(--lime); font-family: var(--mono); font-size: 10px; }

.replay-analytics {
  display: flex;
  grid-column: 1 / -1;
  flex-wrap: wrap;
  gap: 3px;
  min-height: 13px;
}

.analytics-tag,
.sort-metric {
  padding: 2px 4px;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 4px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  line-height: 1;
}

.analytics-tag.speed { color: var(--lime); }
.analytics-tag.telly { color: var(--violet); }
.analytics-tag.flat { color: var(--amber); }
.analytics-tag.god { color: #73e6b1; }
.sort-metric { margin-left: auto; color: var(--cyan); }
.analytics-pending { color: var(--muted-2); font-family: var(--mono); font-size: 10px; }

.list-empty {
  padding: 30px 10px;
  color: var(--muted);
  text-align: center;
}

.load-more {
  width: 100%;
  min-height: 34px;
  margin-top: 5px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.018);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
}

.load-more:hover {
  border-color: rgba(70, 220, 211, 0.28);
  color: var(--cyan);
}

.viewer-column {
  display: block;
  min-width: 0;
  min-height: 0;
}

.viewer-card {
  display: grid;
  grid-template-rows: 54px minmax(260px, 1fr) 104px;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.viewer-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 15px;
  border-bottom: 1px solid var(--line);
}

.replay-title-block {
  gap: 9px;
}

.live-dot {
  width: 7px;
  height: 7px;
  border: 2px solid rgba(70, 220, 211, 0.26);
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 10px rgba(70, 220, 211, 0.7);
}

.replay-label,
.replay-date {
  display: block;
}

.replay-label {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.replay-date {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.view-actions {
  gap: 6px;
}

.skin-picker {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 31px;
  padding: 3px 5px 3px 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(4, 7, 11, 0.52);
}

.skin-picker:focus-within {
  border-color: rgba(70, 220, 211, 0.36);
  box-shadow: 0 0 0 2px rgba(70, 220, 211, 0.07);
}

.skin-picker canvas {
  width: 23px;
  height: 23px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 5px;
  background: linear-gradient(145deg, #283743, #10161f);
  image-rendering: pixelated;
}

.skin-picker input {
  width: 96px;
  height: 23px;
  padding: 0 5px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-family: var(--mono);
  font-size: 10px;
}

.skin-picker input::placeholder {
  color: var(--muted-2);
}

.skin-picker button {
  height: 23px;
  padding: 0 7px;
  border: 1px solid rgba(70,220,211,.18);
  border-radius: 5px;
  background: rgba(70,220,211,.08);
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.skin-picker button:disabled {
  opacity: .45;
}

.skin-status {
  max-width: 64px;
  overflow: hidden;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.skin-picker[data-state="error"] {
  border-color: rgba(255,102,126,.4);
}

.skin-picker[data-state="error"] .skin-status {
  color: var(--red);
}

.tool-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--muted);
  font-size: 10px;
  transition: 150ms ease;
}

.tool-button:hover,
.tool-button.active {
  border-color: rgba(70, 220, 211, 0.22);
  background: rgba(70, 220, 211, 0.08);
  color: var(--text);
}

.tool-swatch {
  display: block;
  width: 13px;
  height: 2px;
}

.path-swatch {
  background: var(--cyan);
  box-shadow: 0 0 5px var(--cyan);
}

.look-ray-swatch {
  background: var(--lime);
  box-shadow: 0 0 5px var(--lime);
}

.shadow-swatch {
  display: block;
  width: 14px;
  height: 6px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(3, 5, 7, 0.92), rgba(98, 110, 120, 0.34) 58%, transparent 72%);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
}

@media (max-width: 1500px) {
  .replay-title-block {
    flex: 0 0 125px;
  }

  .view-actions {
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: thin;
  }

  .skin-picker input {
    width: 80px;
  }

  .skin-status {
    display: none;
  }

  .compact-view-toggle {
    flex: 0 0 38px;
    justify-content: center;
    width: 38px;
    padding: 0;
  }

  .compact-view-toggle .tool-label {
    display: none;
  }
}

.target-icon {
  color: var(--cyan);
  font-size: 13px;
}

.background-icon {
  width: 13px;
  height: 10px;
  border: 1px solid currentColor;
  border-radius: 2px;
  background:
    linear-gradient(145deg, transparent 49%, currentColor 50% 57%, transparent 58%),
    radial-gradient(circle at 72% 28%, currentColor 0 1px, transparent 1.5px);
  opacity: .8;
}

.canvas-wrap {
  position: relative;
  min-height: 0;
  overflow: hidden;
  background: #080b10;
  cursor: crosshair;
}

.canvas-wrap.camera-dragging {
  cursor: none;
}

.world-gpu-canvas,
#worldCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.world-gpu-canvas {
  pointer-events: none;
}

.scene-background,
.scene-background-base,
.scene-background-image,
.scene-background-video,
.scene-background-dim {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.scene-background {
  overflow: hidden;
}

.scene-background-base {
  background:
    radial-gradient(circle at 50% 44%, rgba(26, 48, 55, 0.55), rgba(8, 11, 16, 0.76) 48%, rgba(7, 9, 14, 0.98)),
    #080b10;
}

.scene-background-image {
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  transform-origin: center;
  will-change: filter, opacity, transform;
}

.scene-background-video {
  display: block;
  border: 0;
  object-fit: cover;
  transform-origin: center;
  will-change: filter, opacity, transform;
}

.scene-background-video:not([src]) {
  display: none;
}

.scene-background-dim {
  background: #02040a;
  opacity: 0;
}

.background-panel {
  position: absolute;
  z-index: 30;
  top: 12px;
  right: 12px;
  width: min(390px, calc(100% - 24px));
  max-height: calc(100% - 24px);
  padding: 14px;
  overflow: auto;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 13px;
  background: rgba(12, 16, 23, .94);
  box-shadow: 0 18px 55px rgba(0,0,0,.55), 0 0 0 1px rgba(70,220,211,.035) inset;
  color: var(--text);
  cursor: default;
  backdrop-filter: blur(24px) saturate(1.12);
  scrollbar-color: rgba(255,255,255,.16) transparent;
  scrollbar-width: thin;
}

.background-panel[hidden] {
  display: none;
}

.background-panel header,
.background-media-row,
.background-color-row {
  display: flex;
  align-items: center;
}

.background-panel header {
  justify-content: space-between;
  margin-bottom: 13px;
}

.background-panel header strong {
  display: block;
  margin-top: 2px;
  font-size: 16px;
}

.background-panel header button {
  width: 27px;
  height: 27px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255,255,255,.035);
  color: var(--muted);
  font-size: 18px;
}

.background-panel header button:hover {
  border-color: rgba(255,255,255,.2);
  color: var(--text);
}

.background-section-label {
  margin: 0 0 7px;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.background-presets {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-bottom: 11px;
}

.background-presets button {
  min-width: 0;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.018);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
}

.background-presets button:hover,
.background-presets button.active {
  border-color: rgba(70,220,211,.35);
  background: rgba(70,220,211,.07);
  color: var(--text);
}

.background-presets i {
  display: block;
  height: 28px;
  margin-bottom: 4px;
  border-radius: 5px;
  box-shadow: 0 0 0 1px rgba(255,255,255,.07) inset;
}

.preset-default {
  background: radial-gradient(circle at 50% 40%, #20343b, #080b10 70%);
}

.preset-void {
  background: radial-gradient(circle at center, #111525, #020307 72%);
}

.preset-sky {
  background: linear-gradient(#66aee1 0 55%, #d5e9f1 56%, #779254 58% 100%);
}

.preset-sunset {
  background: linear-gradient(#281d55, #d65f69 55%, #f4b56c 72%, #241a2c);
}

.preset-nether {
  background: radial-gradient(circle at 60% 35%, #8d3429, #32100f 48%, #090405 85%);
}

.background-settings-card {
  overflow: hidden;
  margin-bottom: 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255,255,255,.018);
}

.background-settings-card > label {
  display: grid;
  grid-template-columns: minmax(122px, 1fr) minmax(105px, 1.2fr) 42px;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 7px 9px;
  border-bottom: 1px solid var(--line);
}

.background-settings-card > label:last-child {
  border-bottom: 0;
}

.background-settings-card label > span strong,
.background-settings-card label > span small {
  display: block;
}

.background-settings-card label > span strong {
  color: #dce2e7;
  font-size: 10px;
}

.background-settings-card label > span small {
  margin-top: 2px;
  color: var(--muted-2);
  font-size: 10px;
  line-height: 1.25;
}

.background-settings-card select {
  grid-column: 2 / 4;
  height: 28px;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #121821;
  color: var(--muted);
  font-size: 10px;
}

.background-settings-card select:disabled {
  cursor: not-allowed;
  opacity: .42;
}

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

.background-settings-card output {
  color: var(--cyan-strong);
  font-family: var(--mono);
  font-size: 10px;
  text-align: right;
}

.background-settings-card > .background-color-row {
  display: flex;
  justify-content: space-between;
}

.background-color-row input {
  width: 44px;
  height: 28px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
}

.background-media-row {
  gap: 6px;
}

.background-media-row button,
.background-reset-button {
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255,255,255,.025);
  color: var(--muted);
  font-size: 10px;
}

.background-media-row .background-primary-button {
  flex: 1;
  border-color: rgba(70,220,211,.24);
  background: rgba(70,220,211,.08);
  color: var(--cyan-strong);
}

.background-media-row button:disabled {
  cursor: default;
  opacity: .38;
}

.background-media-name {
  overflow: hidden;
  margin: 6px 1px 9px;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.background-projection-hint {
  margin: -2px 1px 10px;
  padding: 8px 9px;
  border: 1px solid rgba(159,141,255,.2);
  border-radius: 7px;
  background: rgba(159,141,255,.07);
  color: #bbb2f3;
  font-size: 10px;
  line-height: 1.45;
}

.background-reset-button {
  width: 100%;
}

.background-reset-button:hover,
.background-media-row button:hover:not(:disabled) {
  border-color: rgba(255,255,255,.18);
  color: var(--text);
}

.canvas-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.018;
  background-image:
    linear-gradient(rgba(255,255,255,.5) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.5) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(circle at center, black, transparent 74%);
}

.freecam-crosshair {
  position: absolute;
  z-index: 4;
  top: 50%;
  left: 50%;
  width: 17px;
  height: 17px;
  transform: translate(-50%, -50%);
  opacity: 0.34;
  pointer-events: none;
}

.canvas-wrap.camera-dragging .freecam-crosshair {
  opacity: 0.9;
}

.freecam-crosshair i {
  position: absolute;
  top: 50%;
  left: 50%;
  display: block;
  border-radius: 1px;
  background: rgba(243, 246, 248, 0.9);
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.75);
  transform: translate(-50%, -50%);
}

.freecam-crosshair i:first-child { width: 17px; height: 1px; }
.freecam-crosshair i:last-child { width: 1px; height: 17px; }

.freecam-status {
  position: absolute;
  z-index: 4;
  top: 14px;
  left: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 9px;
  border: 1px solid rgba(70, 220, 211, 0.14);
  border-radius: 7px;
  background: rgba(7, 11, 16, 0.62);
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  pointer-events: none;
}

.freecam-status > i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 7px rgba(70, 220, 211, 0.75);
}

.freecam-status strong {
  padding-left: 6px;
  border-left: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.timer-overlay {
  position: absolute;
  z-index: 5;
  bottom: 38px;
  left: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: translateX(-50%);
  pointer-events: none;
}

.timer-overlay span {
  font-family: var(--mono);
  font-size: 25px;
  font-weight: 800;
  letter-spacing: -0.045em;
  text-shadow: 0 3px 14px #000;
}

.timer-overlay small {
  margin-top: 3px;
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.axis-legend {
  position: absolute;
  right: 14px;
  bottom: 13px;
  display: flex;
  gap: 5px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 800;
}

.axis-legend span {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: rgba(7, 9, 14, 0.7);
}

.axis-x { color: var(--red); }
.axis-y { color: var(--lime); }
.axis-z { color: var(--cyan); }

.canvas-hint {
  position: absolute;
  bottom: 12px;
  left: 14px;
  color: rgba(173, 183, 197, 0.35);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.05em;
  pointer-events: none;
}

.canvas-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transition: 180ms ease;
}

.canvas-empty.hidden {
  visibility: hidden;
  opacity: 0;
}

.canvas-empty strong {
  margin-top: 18px;
  font-size: 13px;
}

.canvas-empty span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
}

.loader-cube {
  position: relative;
  width: 38px;
  height: 28px;
}

.loader-cube i {
  position: absolute;
  width: 17px;
  height: 17px;
  border: 1px solid rgba(70, 220, 211, 0.5);
  background: rgba(70, 220, 211, 0.09);
  transform: rotate(45deg) skew(-7deg, -7deg);
}

.loader-cube i:nth-child(1) { left: 0; top: 12px; }
.loader-cube i:nth-child(2) { left: 12px; top: 6px; }
.loader-cube i:nth-child(3) { left: 24px; top: 0; border-color: var(--lime); }

.playback {
  position: relative;
  z-index: 2;
  padding: 10px 15px 12px;
  border-top: 1px solid var(--line);
  background: rgba(10, 13, 19, 0.88);
}

.playback:focus {
  outline: none;
  border-top-color: rgba(70, 220, 211, 0.34);
  box-shadow: inset 0 1px 0 rgba(70, 220, 211, 0.08);
}

.timeline-meta {
  position: relative;
  display: flex;
  justify-content: space-between;
  height: 14px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
}

.event-markers {
  position: absolute;
  right: 0;
  bottom: -14px;
  left: 0;
  height: 8px;
  pointer-events: none;
}

.event-marker {
  position: absolute;
  bottom: 0;
  width: 2px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 180, 84, 0.6);
  transform: translateX(-1px);
}

.timeline {
  width: 100%;
  height: 15px;
  margin: 0;
  appearance: none;
  background: transparent;
}

.timeline::-webkit-slider-runnable-track {
  height: 3px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--cyan) 0 var(--progress, 0%), rgba(255,255,255,.1) var(--progress, 0%) 100%);
}

.timeline::-webkit-slider-thumb {
  width: 12px;
  height: 12px;
  margin-top: -4.5px;
  appearance: none;
  border: 2px solid #081013;
  border-radius: 50%;
  background: var(--cyan-strong);
  box-shadow: 0 0 0 2px rgba(70, 220, 211, 0.2), 0 0 10px rgba(70, 220, 211, 0.45);
}

.timeline::-moz-range-track {
  height: 3px;
  border: 0;
  border-radius: 4px;
  background: rgba(255,255,255,.1);
}

.timeline::-moz-range-progress {
  height: 3px;
  background: var(--cyan);
}

.timeline::-moz-range-thumb {
  width: 10px;
  height: 10px;
  border: 2px solid #081013;
  border-radius: 50%;
  background: var(--cyan-strong);
}

.playback-controls {
  justify-content: space-between;
  margin-top: 6px;
}

.transport {
  gap: 4px;
}

.transport-button,
.play-button {
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
}

.transport-button {
  width: 32px;
  height: 32px;
  border-radius: 7px;
  font-family: var(--mono);
  font-weight: 700;
}

.play-button {
  width: 35px;
  height: 35px;
  margin: 0 3px;
  border-color: rgba(70, 220, 211, 0.22);
  border-radius: 50%;
  background: var(--cyan-dim);
  color: var(--cyan-strong);
}

.play-button svg {
  width: 15px;
  fill: currentColor;
}

.play-button .pause-icon,
.play-button.playing .play-icon {
  display: none;
}

.play-button.playing .pause-icon {
  display: block;
}

.transport-button:hover,
.play-button:hover {
  border-color: rgba(70, 220, 211, 0.34);
  color: var(--text);
}

.frame-readout {
  min-width: 95px;
  margin-left: auto;
  text-align: right;
}

.frame-readout strong {
  font-family: var(--mono);
  font-size: 10px;
}

.speed-control {
  display: grid;
  grid-template-columns: auto 66px;
  align-items: center;
  gap: 7px;
  margin-left: 18px;
}

.speed-control > span {
  margin: 0;
}

.speed-control select {
  height: 32px;
  padding: 0 6px;
  font-family: var(--mono);
  font-size: 10px;
}

.telemetry-card,
.keys-card {
  padding: 0;
  overflow: visible;
}

.inspector-module {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.keystroke-profiles {
  display: flex;
  align-items: center;
  gap: 5px;
}

.keystroke-profiles label {
  display: grid;
  grid-template-columns: auto minmax(60px, auto);
  align-items: center;
  gap: 4px;
}

.keystroke-profiles label > span {
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.keystroke-profiles select {
  width: 72px;
  height: 24px;
  padding: 0 4px;
  border-color: rgba(255, 180, 84, 0.22);
  border-radius: 6px;
  background-color: rgba(255, 180, 84, 0.05);
  color: #ffd49d;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 800;
}

.keystroke-profiles label:last-child select {
  width: 67px;
}

.coordinate-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin-top: 13px;
}

.coordinate {
  position: relative;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.018);
}

.coordinate > span {
  display: block;
  margin-bottom: 3px;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.coordinate strong {
  display: block;
  overflow: hidden;
  font-family: var(--mono);
  font-size: 13px;
  text-overflow: ellipsis;
}

.coordinate.accent strong {
  color: var(--cyan-strong);
}

.coordinate small {
  position: absolute;
  right: 8px;
  bottom: 3px;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 10px;
}

kbd {
  display: inline-grid;
  place-items: center;
  min-width: 25px;
  min-height: 23px;
  padding: 3px 6px;
  border: 1px solid var(--line-strong);
  border-bottom-color: rgba(255,255,255,.22);
  border-radius: 5px;
  background: linear-gradient(#191f2a, #111620);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 800;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.42);
  transition: 90ms ease;
}


.keystroke-hud {
  position: absolute;
  z-index: 12;
  top: 8px;
  left: 8px;
  display: grid;
  grid-template-columns: repeat(3, 40px);
  grid-template-rows: 40px 40px 24px 17px;
  gap: 3px;
  width: 126px;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.keystroke-hud.dragging {
  cursor: grabbing;
}

.keystroke-hud .hud-key {
  box-sizing: border-box;
  width: 40px;
  height: 40px;
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: 1px solid rgba(226, 237, 255, 0.2);
  border-radius: 2px;
  background: rgba(27, 45, 72, 0.52);
  color: rgba(247, 250, 255, 0.94);
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 2px 7px rgba(0, 0, 0, 0.14);
  backdrop-filter: blur(5px) saturate(0.9);
  pointer-events: none;
  transition: color 65ms linear, background 65ms linear, border-color 65ms linear;
}

.keystroke-hud .hud-key.active {
  border-color: rgba(255, 255, 255, 0.9);
  background: rgba(244, 248, 255, 0.88);
  color: #182235;
  text-shadow: none;
  box-shadow: 0 0 10px rgba(222, 236, 255, 0.22);
}

.hud-key-w { grid-column: 2; grid-row: 1; }
.hud-key-a { grid-column: 1; grid-row: 2; }
.hud-key-s { grid-column: 2; grid-row: 2; }
.hud-key-d { grid-column: 3; grid-row: 2; }

.keystroke-hud .hud-key-shift,
.keystroke-hud .hud-key-space {
  grid-column: 1 / -1;
  width: 126px;
}

.keystroke-hud .hud-key-shift {
  grid-row: 3;
  height: 24px;
  font-size: 10px;
  letter-spacing: 0.12em;
}

.keystroke-hud .hud-key-space {
  grid-row: 4;
  height: 17px;
}

.hud-key-space i {
  display: block;
  width: 62px;
  height: 2px;
  border-radius: 1px;
  background: currentColor;
  opacity: 0.9;
}

.inspector-panel {
  overflow-y: auto;
  scrollbar-width: thin;
}

.inspector-section {
  margin-top: 21px;
}

.section-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.13em;
}

.item-card {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.018);
}

.item-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(70,220,211,.17), rgba(159,141,255,.1));
  color: var(--cyan-strong);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 800;
  box-shadow: inset 0 0 16px rgba(255,255,255,.03);
}

.item-card strong,
.item-card span {
  display: block;
}

.item-card strong {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-card span {
  margin-top: 4px;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 10px;
}

.item-card .glow-badge {
  display: none;
  margin: 0;
  padding: 3px 5px;
  border: 1px solid rgba(159,141,255,.25);
  border-radius: 5px;
  background: rgba(159,141,255,.1);
  color: #c5baff;
  font-size: 10px;
}

.item-card .glow-badge.visible {
  display: block;
}

.metrics-section {
  padding-top: 17px;
  border-top: 1px solid var(--line);
}

.metric-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 31px;
  border-bottom: 1px solid rgba(255,255,255,.045);
}

.metric-row span {
  color: var(--muted);
  font-size: 10px;
}

.metric-row strong {
  font-family: var(--mono);
  font-size: 10px;
}

.format-note {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  margin-top: 20px;
  padding: 11px;
  border: 1px solid rgba(70,220,211,.13);
  border-radius: 10px;
  background: rgba(70,220,211,.045);
}

.format-note-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(70,220,211,.22);
  border-radius: 50%;
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 800;
}

.format-note strong {
  font-size: 10px;
}

.format-note p {
  margin-top: 4px;
  color: var(--muted-2);
  font-size: 10px;
  line-height: 1.45;
}

.overlay {
  position: fixed;
  z-index: 20;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 30px;
  background: rgba(4, 6, 9, 0.76);
  backdrop-filter: blur(18px);
  visibility: visible;
  opacity: 1;
  transition: opacity 220ms ease;
}

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

.unlock-card {
  display: grid;
  grid-template-columns: 260px 430px;
  min-height: 480px;
  overflow: hidden;
  border-color: rgba(255,255,255,.12);
  box-shadow: 0 30px 100px rgba(0,0,0,.5);
}

.unlock-art {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    linear-gradient(150deg, rgba(70,220,211,.14), transparent 45%),
    linear-gradient(330deg, rgba(159,141,255,.13), transparent 50%),
    #0c1119;
}

.unlock-art::before {
  position: absolute;
  inset: -20%;
  background-image:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 28px 28px;
  transform: perspective(320px) rotateX(58deg) rotateZ(-25deg) scale(1.4);
  content: "";
}

.voxel-stack {
  position: relative;
  width: 150px;
  height: 200px;
  transform: rotate(-9deg);
}

.voxel-stack i {
  position: absolute;
  width: 52px;
  height: 52px;
  border: 2px solid rgba(119,243,233,.56);
  background: rgba(70,220,211,.09);
  box-shadow: inset 0 0 25px rgba(70,220,211,.08), 0 14px 35px rgba(0,0,0,.25);
  transform: rotate(45deg) skew(-8deg, -8deg);
}

.voxel-stack i:nth-child(1) { left: 2px; bottom: 3px; }
.voxel-stack i:nth-child(2) { left: 34px; bottom: 33px; }
.voxel-stack i:nth-child(3) { left: 66px; bottom: 63px; }
.voxel-stack i:nth-child(4) { left: 98px; bottom: 93px; border-color: rgba(200,239,102,.65); background: rgba(200,239,102,.09); }
.voxel-stack i:nth-child(5) { width: 25px; height: 25px; left: 127px; bottom: 132px; border-color: rgba(200,239,102,.65); }
.voxel-stack i:nth-child(6) { width: 11px; height: 11px; left: 151px; bottom: 161px; border-color: var(--lime); box-shadow: 0 0 14px rgba(200,239,102,.4); }

.unlock-content {
  padding: 43px 42px 36px;
}

.unlock-content h2 {
  margin-top: 9px;
  font-size: 27px;
  letter-spacing: -0.04em;
}

.unlock-content > p {
  margin-top: 13px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.65;
}

.archive-summary {
  display: grid;
  grid-template-columns: 1.7fr .7fr .7fr;
  gap: 1px;
  margin-top: 23px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--line);
}

.archive-summary div {
  min-width: 0;
  padding: 10px;
  background: #10151e;
}

.archive-summary span,
.archive-summary strong {
  display: block;
}

.archive-summary span {
  margin-bottom: 4px;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .08em;
}

.archive-summary strong {
  overflow: hidden;
  font-family: var(--mono);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.password-field {
  display: block;
  margin-top: 22px;
}

.password-field > span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 10px;
}

.password-field > div {
  position: relative;
}

.password-field input {
  width: 100%;
  height: 45px;
  padding: 0 45px 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: rgba(5,8,12,.66);
  font-family: var(--mono);
  font-size: 12px;
}

.password-field button {
  position: absolute;
  top: 0;
  right: 0;
  width: 43px;
  height: 45px;
  border: 0;
  background: transparent;
  filter: grayscale(1);
  opacity: .55;
}

.unlock-error {
  min-height: 17px;
  padding-top: 5px;
  color: var(--red);
  font-size: 10px;
}

.primary-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 44px;
  padding: 0 15px;
  border: 1px solid rgba(119,243,233,.42);
  border-radius: 9px;
  background: linear-gradient(90deg, rgba(70,220,211,.2), rgba(70,220,211,.1));
  color: var(--cyan-strong);
  font-size: 11px;
  font-weight: 700;
  transition: 150ms ease;
}

.primary-button:hover {
  background: linear-gradient(90deg, rgba(70,220,211,.27), rgba(70,220,211,.14));
  box-shadow: 0 0 25px rgba(70,220,211,.08);
}

.primary-button:disabled {
  cursor: wait;
  opacity: .55;
}

.primary-button i {
  font-size: 17px;
  font-style: normal;
}

.modal-overlay {
  z-index: 30;
}

.modal-card {
  position: relative;
  width: 420px;
  padding: 28px;
}

.modal-card h2 {
  margin-top: 7px;
  font-size: 24px;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255,255,255,.02);
  color: var(--muted);
  font-size: 18px;
}

.shortcut-list {
  margin-top: 22px;
}

.shortcut-list > div {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 45px;
  border-bottom: 1px solid var(--line);
}

.shortcut-list span {
  margin-left: auto;
  color: var(--muted);
  font-size: 10px;
}

.toast {
  position: fixed;
  z-index: 50;
  right: 20px;
  bottom: 20px;
  max-width: 360px;
  padding: 11px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: rgba(17,22,32,.96);
  color: var(--text);
  font-size: 10px;
  box-shadow: 0 15px 40px rgba(0,0,0,.35);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: 180ms ease;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-height: 800px) {
  .workspace { padding: 9px; }
  .coordinate-grid { margin-top: 8px; }
  .inspector-section { margin-top: 15px; }
  .format-note { margin-top: 14px; }
}

@media (min-width: 1700px) {
  .workspace { --left-panel-width: 310px; --right-panel-width: 400px; }
  .replay-panel, .inspector-panel { padding: 20px; }
}

@media (max-width: 1299px) {
  body {
    overflow-x: hidden;
    overflow-y: auto;
  }

  .app-shell {
    grid-template-rows: 60px auto;
  }

  .workspace {
    grid-template-columns: minmax(280px, 320px) minmax(0, 1fr);
    gap: 12px;
    min-height: auto;
  }

  .layout-resizer {
    display: none;
  }

  .replay-panel {
    grid-column: 1;
    height: 650px;
  }

  .viewer-column {
    grid-column: 2;
    height: 650px;
  }

  .inspector-panel {
    grid-column: 1 / -1;
    max-height: none;
    overflow: visible;
  }

  .viewer-toolbar {
    gap: 12px;
  }

  .view-actions {
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: thin;
  }

  .skin-picker,
  .tool-button {
    flex: 0 0 auto;
  }
}

@media (max-width: 700px) {
  .app-shell {
    display: block;
  }

  .topbar {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    padding: 0 10px;
  }

  .brand-block {
    min-width: 0;
  }

  .brand-mark {
    display: none;
  }

  h1 {
    font-size: 18px;
  }

  .workspace {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px;
  }

  .viewer-column {
    order: 1;
    width: 100%;
    height: auto;
  }

  .replay-panel {
    order: 2;
    width: 100%;
    height: min(760px, 86vh);
    min-height: 600px;
  }

  .inspector-panel {
    order: 3;
    width: 100%;
  }

  .viewer-card {
    grid-template-rows: auto minmax(380px, 56vh) auto;
    height: auto;
  }

  .viewer-toolbar {
    align-items: stretch;
    flex-direction: column;
    padding: 10px 12px;
  }

  .view-actions {
    width: 100%;
    padding-bottom: 3px;
  }

  .playback-controls {
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 8px;
  }

  .frame-readout {
    min-width: 70px;
  }

  .speed-control {
    margin-left: 0;
  }

  .background-panel {
    top: 8px;
    right: 8px;
    width: calc(100% - 16px);
    max-height: calc(100% - 16px);
  }

  .background-settings-card > label {
    grid-template-columns: minmax(105px, 1fr) minmax(90px, 1fr) 38px;
  }

  .input-title-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .modal-overlay,
  .overlay {
    padding: 12px;
  }

  .modal-card {
    width: min(100%, 420px);
    max-height: calc(100vh - 24px);
    padding: 24px 18px;
    overflow: auto;
  }
}

@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;
  }

  .ambient {
    display: none;
  }
}
