:root {
  color-scheme: dark;
  --bg: #111318;
  --ink: #f4f0e8;
  --muted: #a8adb7;
  --line: rgba(255, 255, 255, 0.12);
  --panel: rgba(16, 18, 22, 0.74);
  --accent: #57d68d;
  --hot: #f7c66a;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: #111318;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button {
  font: inherit;
}

.shell {
  min-height: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
}

.stage {
  min-height: 100vh;
  display: grid;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0)),
    #14171c;
}

model-viewer {
  width: 100%;
  height: 100vh;
  background: transparent;
  --poster-color: transparent;
}

.panel {
  min-height: 100vh;
  padding: 18px;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 14px;
  background: var(--panel);
  border-left: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.heading {
  display: grid;
  gap: 8px;
}

h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1.1;
  letter-spacing: 0;
}

.caption {
  min-height: 24px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.controls {
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  align-items: center;
  gap: 10px;
}

.controls button {
  width: 48px;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
  cursor: pointer;
}

.controls button:hover,
.tile:hover {
  border-color: rgba(255, 255, 255, 0.36);
}

.counter {
  text-align: center;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.grid {
  min-height: 0;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 8px;
  padding-right: 4px;
}

.tile {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  padding: 8px 10px;
  font-size: 13px;
}

.tile[aria-current="true"] {
  border-color: var(--accent);
  background: rgba(87, 214, 141, 0.13);
}

@media (max-width: 800px) {
  .shell {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 62vh) auto;
  }

  .stage,
  model-viewer {
    min-height: 0;
    height: 62vh;
  }

  .panel {
    min-height: 38vh;
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: 220px;
  }
}
