:root {
  color-scheme: light;
  --ink: #17202a;
  --muted: #607080;
  --line: #d7dee6;
  --panel: #ffffff;
  --wash: #f4f7fa;
  --accent: #0672ce;
  --accent-dark: #045ca6;
  --good: #0f7a42;
  --warn: #a15c00;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  color: var(--ink);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  background: var(--wash);
}

button,
select {
  font: inherit;
}

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

.topbar h1,
.viewerHeader h2,
.sidebarHeader h2,
.emptyState h2 {
  margin: 0;
  letter-spacing: 0;
}

.topbar h1 {
  font-size: 24px;
  line-height: 1.1;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.status {
  min-width: 170px;
  max-width: 48vw;
  padding: 8px 12px;
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

.status.good {
  color: var(--good);
}

.status.warn {
  color: var(--warn);
}

.shell {
  height: calc(100vh - 68px);
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
}

.sidebar {
  min-width: 0;
  background: var(--panel);
  border-right: 1px solid var(--line);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.sidebarHeader,
.viewerHeader {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.sidebarHeader h2,
.viewerHeader h2 {
  font-size: 18px;
}

.modelList {
  overflow: auto;
  padding: 8px;
}

.modelItem {
  width: 100%;
  display: grid;
  gap: 4px;
  padding: 10px 11px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.modelItem:hover,
.modelItem.active {
  border-color: #b8cee5;
  background: #eef6ff;
}

.modelName {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}

.modelMeta {
  color: var(--muted);
  font-size: 12px;
}

.viewerPanel {
  position: relative;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #dfe8f1;
}

.actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

button,
select {
  min-height: 36px;
  border: 1px solid #b9c5d1;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 0 12px;
}

button {
  cursor: pointer;
}

button:disabled,
select:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

#loadModel,
#translateModel {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

#loadModel:hover:not(:disabled),
#translateModel:hover:not(:disabled) {
  background: var(--accent-dark);
}

#viewableSelect {
  width: min(34vw, 360px);
}

#viewer {
  position: relative;
  flex: 1;
  min-height: 0;
}

.emptyState {
  position: absolute;
  inset: 68px 0 0 0;
  display: grid;
  place-content: center;
  gap: 8px;
  padding: 24px;
  color: #334353;
  text-align: center;
  pointer-events: none;
}

.emptyState.hidden {
  display: none;
}

.emptyState p {
  max-width: 560px;
  margin: 0 auto;
  color: var(--muted);
  line-height: 1.5;
}

@media (max-width: 820px) {
  .topbar {
    align-items: flex-start;
    height: auto;
    min-height: 76px;
    padding: 14px 16px;
  }

  .status {
    min-width: 0;
    max-width: 54vw;
    padding: 0;
  }

  .shell {
    height: calc(100vh - 76px);
    grid-template-columns: 1fr;
    grid-template-rows: 230px minmax(0, 1fr);
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .viewerHeader {
    align-items: stretch;
    flex-direction: column;
  }

  .actions {
    flex-wrap: wrap;
  }

  #viewableSelect {
    width: 100%;
  }
}
