:root {
  color-scheme: dark;
  --bg: #0f1115;
  --panel: #1d1f22;
  --panel-2: #151719;
  --panel-3: #24272b;
  --line: #343941;
  --line-soft: rgba(255, 255, 255, 0.08);
  --text: #f4f7fb;
  --muted: #9aa6b2;
  --blue: #0787d8;
  --blue-2: #0b6f9f;
  --green: #05b879;
  --orange: #f05a2a;
  --purple: #8758ff;
  --grid: rgba(160, 173, 188, 0.18);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 1180px;
  min-height: 100vh;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.studio-shell {
  height: 100vh;
  display: grid;
  grid-template-columns: 300px minmax(620px, 1fr) 334px;
  background: #121416;
}

.left-panel,
.right-panel {
  min-height: 100vh;
  overflow: auto;
  background: var(--panel);
  border-color: var(--line);
}

.left-panel {
  border-right: 1px solid var(--line);
}

.right-panel {
  border-left: 1px solid var(--line);
  padding: 16px;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 16px;
  border-bottom: 1px solid var(--line);
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--blue), #00c2a8);
  color: white;
  font-weight: 900;
}

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

h1 {
  font-size: 1.08rem;
  line-height: 1.1;
}

.brand-block p,
.topbar p,
.help-text,
.metric-box span {
  color: var(--muted);
  font-size: 0.82rem;
}

.panel-section {
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

label,
.section-title-row span:first-child {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

input[type="text"],
input[type="file"],
.select-input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #151719;
  color: var(--text);
  padding: 0 12px;
}

input[type="file"] {
  padding: 10px 12px;
}

.select-input {
  appearance: none;
  margin-bottom: 12px;
  background:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%) calc(100% - 18px) 19px / 6px 6px no-repeat,
    linear-gradient(135deg, var(--muted) 50%, transparent 50%) calc(100% - 13px) 19px / 6px 6px no-repeat,
    #151719;
}

.help-text {
  margin-top: 8px;
  line-height: 1.45;
}

.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border-radius: 999px;
  background: #16865d;
  color: white;
  padding: 0 10px;
  font-size: 0.72rem;
  font-weight: 900;
}

.segmented,
.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #151719;
  padding: 4px;
}

.tabs {
  grid-template-columns: repeat(3, 1fr);
  margin: 10px 0 14px;
}

.segment,
.tab {
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font-weight: 800;
}

.segment.active,
.tab.active {
  background: var(--blue);
}

.button-stack {
  display: grid;
  gap: 10px;
}

.mini-button {
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #151719;
  color: var(--text);
  padding: 0 10px;
  font-size: 0.76rem;
  font-weight: 850;
}

.primary-button,
.secondary-button,
.toolbar button {
  min-height: 42px;
  border: 0;
  border-radius: 7px;
  color: white;
  padding: 0 14px;
  font-weight: 900;
}

.primary-button {
  background: var(--green);
}

.secondary-button {
  background: var(--blue);
}

.upload-progress {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #151719;
  padding: 10px;
}

.upload-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.78rem;
}

.upload-progress-head span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-progress-head strong {
  color: var(--text);
}

.upload-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #050608;
}

.upload-bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--green));
  transition: width 120ms ease;
}

.assets-section input {
  margin-bottom: 10px;
}

.asset-filter-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 12px;
}

.asset-filter {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #151719;
  color: var(--muted);
  font-weight: 850;
}

.asset-filter.active {
  border-color: transparent;
  background: var(--blue);
  color: white;
}

.assets-list {
  display: grid;
  gap: 8px;
  max-height: 240px;
  overflow: auto;
  padding-right: 3px;
}

.asset-card {
  display: grid;
  grid-template-columns: 46px 1fr;
  align-items: center;
  gap: 10px;
  min-height: 62px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #151719;
  color: var(--text);
  padding: 8px;
  text-align: left;
}

.asset-card:hover,
.asset-card.active {
  border-color: var(--blue);
  background: #172638;
}

.asset-thumb {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 6px;
  background: linear-gradient(135deg, #0d8f70, #1666a5);
  color: white;
  font-size: 0.76rem;
  font-weight: 900;
}

.asset-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.asset-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.86rem;
  font-weight: 850;
}

.asset-meta {
  color: var(--muted);
  font-size: 0.76rem;
}

.assets-empty {
  border: 1px dashed var(--line);
  border-radius: 7px;
  color: var(--muted);
  padding: 14px;
  text-align: center;
  font-size: 0.84rem;
}

.workspace {
  min-width: 0;
  display: grid;
  grid-template-rows: 70px 1fr;
  background: #101214;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-2);
}

.topbar h2 {
  font-size: 1.02rem;
}

.toolbar {
  display: flex;
  gap: 8px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #202327;
}

.toolbar button {
  background: var(--blue-2);
}

.toolbar button:nth-child(3) {
  background: var(--orange);
}

.viewer-stage {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 48%, rgba(255, 255, 255, 0.08), transparent 18rem),
    linear-gradient(#121416, #090a0b);
}

.viewer-canvas-host {
  position: absolute;
  inset: 0;
  cursor: grab;
}

.viewer-canvas-host:active {
  cursor: grabbing;
}

.viewer-canvas-host canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.viewer-placeholder {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 330px;
  height: 170px;
  display: grid;
  place-content: center;
  gap: 4px;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  background: rgba(25, 27, 30, 0.78);
  color: white;
  text-align: center;
  pointer-events: none;
  transition: opacity 160ms ease;
}

.viewer-placeholder.is-hidden {
  opacity: 0;
}

.viewer-placeholder strong {
  font-size: 1rem;
}

.viewer-placeholder span {
  color: var(--muted);
  font-size: 0.78rem;
}

.view-gizmo {
  position: absolute;
  right: 28px;
  top: 26px;
  width: 72px;
  height: 72px;
}

.view-gizmo::before,
.view-gizmo::after {
  content: "";
  position: absolute;
  left: 34px;
  top: 8px;
  width: 4px;
  height: 54px;
  border-radius: 999px;
  background: #2f80ff;
}

.view-gizmo::after {
  width: 54px;
  height: 4px;
  left: 9px;
  top: 34px;
  background: #ff3c3c;
}

.gizmo-dot {
  position: absolute;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  z-index: 2;
}

.gizmo-y {
  left: 29px;
  top: 0;
  background: #0ad26f;
}

.gizmo-x {
  right: 0;
  top: 29px;
  background: #ff3c3c;
}

.gizmo-z {
  left: 29px;
  bottom: 0;
  background: #2f80ff;
}

.info-card {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.info-card h3 {
  margin-bottom: 12px;
  font-size: 1.04rem;
}

.metric-box {
  display: grid;
  gap: 4px;
  margin-bottom: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #151719;
  padding: 12px;
}

.metric-box strong {
  font-size: 0.9rem;
}

.slider-row,
.check-row {
  display: grid;
  grid-template-columns: 42px 1fr 34px;
  align-items: center;
  gap: 10px;
  margin: 12px 0;
}

.slider-row span,
.check-row span {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.slider-row input[type="range"] {
  accent-color: var(--blue);
}

.check-row {
  grid-template-columns: 1fr auto;
}

.check-row input {
  width: 22px;
  height: 22px;
  accent-color: var(--blue);
}
