:root {
  --bg: #070a0f;
  --panel: rgba(15, 23, 42, 0.94);
  --panel-border: rgba(255, 255, 255, 0.12);
  --text: #f8fafc;
  --muted: #94a3b8;
  --accent: #7dd3fc;
  --accent-strong: #38bdf8;
  --ok: #22c55e;
  --warn: #f97316;
  --bar-height: 82px;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.viewer-shell {
  position: relative;
  width: 100vw;
  height: 100vh;
  background:
    radial-gradient(circle at 18% 18%, rgba(56, 189, 248, 0.08), transparent 28%),
    linear-gradient(135deg, #070a0f 0%, #111827 100%);
}

.viewer-stage {
  position: absolute;
  inset: 0 0 var(--bar-height) 0;
  overflow: hidden;
}

#viewerCanvas {
  display: block;
  width: 100%;
  height: 100%;
  background: #05070b;
}

.viewer-overlay {
  position: fixed;
  z-index: 20;
  border: 1px solid var(--panel-border);
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(12px);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.28);
}

.top-left {
  top: 14px;
  left: 14px;
  max-width: min(520px, calc(100vw - 120px));
  padding: 10px 13px;
  border-radius: 14px;
}

.top-right {
  top: 14px;
  right: 14px;
  padding: 8px;
  border-radius: 999px;
}

.brand {
  font-size: 18px;
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.subtle {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.18);
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.status-pill.ok {
  background: rgba(34, 197, 94, 0.18);
  color: #bbf7d0;
}

.status-pill.warn {
  background: rgba(249, 115, 22, 0.18);
  color: #fed7aa;
}

.bottom-bar {
  position: fixed;
  z-index: 30;
  left: 0;
  right: 0;
  bottom: 0;
  min-height: var(--bar-height);
  padding: 12px 14px;
  display: grid;
  grid-template-columns: auto minmax(280px, 460px) auto 1fr;
  gap: 12px;
  align-items: center;
  border-top: 1px solid var(--panel-border);
  background: var(--panel);
  backdrop-filter: blur(18px);
  box-shadow: 0 -14px 40px rgba(0, 0, 0, 0.36);
}

.bar-group {
  min-width: 0;
}

.file-group,
.view-group {
  display: flex;
  gap: 8px;
  align-items: center;
}

.recent-group {
  display: grid;
  grid-template-columns: 58px 1fr 88px;
  gap: 8px;
  align-items: center;
}

.recent-group label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.primary-button,
.ghost-button {
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 13px;
  border: 1px solid var(--panel-border);
  padding: 0 14px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.primary-button {
  color: #e0f2fe;
  background: rgba(14, 165, 233, 0.22);
  border-color: rgba(125, 211, 252, 0.45);
}

.ghost-button {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.primary-button:hover,
.ghost-button:hover {
  border-color: var(--accent);
}

select {
  width: 100%;
  height: 42px;
  border-radius: 13px;
  border: 1px solid var(--panel-border);
  padding: 0 12px;
  background: rgba(15, 23, 42, 0.95);
  color: var(--text);
  outline: none;
}

.viewer-info {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 920px) {
  :root {
    --bar-height: 132px;
  }

  .bottom-bar {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .recent-group {
    grid-column: 1 / -1;
  }

  .info-group {
    grid-column: 1 / -1;
  }
}

@media (max-width: 620px) {
  :root {
    --bar-height: 176px;
  }

  .bottom-bar {
    grid-template-columns: 1fr;
  }

  .file-group,
  .view-group {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
  }

  .file-group {
    grid-template-columns: 1fr;
  }

  .recent-group {
    grid-template-columns: 1fr;
  }

  .primary-button,
  .ghost-button,
  select {
    height: 38px;
  }

  .viewer-info {
    white-space: normal;
  }
}