:root {
  color-scheme: dark;
  --bg: #080808;
  --panel: rgba(13, 14, 16, 0.96);
  --line: rgba(255, 255, 255, 0.14);
  --text: #f7f7f4;
  --muted: #a8adb7;
  --amd: #ed1c24;
  --cyan: #39d0ff;
}

* { box-sizing: border-box; }

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
}

body {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  font-family: "Space Grotesk", system-ui, sans-serif;
  color: var(--text);
}

a { color: inherit; text-decoration: none; }
a:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

.viewer-bar {
  position: relative;
  z-index: 5;
  border-top: 3px solid var(--amd);
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(100deg, rgba(237, 28, 36, 0.14), transparent 36%),
    rgba(7, 7, 8, 0.96);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.viewer-inner {
  min-width: 0;
  min-height: 58px;
  padding: 7px 12px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.viewer-brand {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  flex: 0 1 auto;
}

.viewer-brand img {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border: 1px solid rgba(237, 28, 36, 0.34);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  object-fit: contain;
}

.viewer-brand strong,
.viewer-brand span { display: block; line-height: 1.02; white-space: nowrap; }
.viewer-brand strong { font-size: 0.76rem; text-transform: uppercase; }
.viewer-brand span {
  margin-top: 4px;
  color: var(--muted);
  font: 500 0.64rem/1 "IBM Plex Mono", monospace;
}

.viewer-nav {
  min-width: 0;
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: none;
}

.viewer-nav::-webkit-scrollbar { display: none; }

.viewer-nav a {
  flex: 0 0 auto;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  font: 700 0.66rem/1 "IBM Plex Mono", monospace;
  letter-spacing: 0.035em;
  text-transform: uppercase;
  white-space: nowrap;
}

.viewer-nav a:hover,
.viewer-nav a[aria-current="page"] {
  border-color: rgba(57, 208, 255, 0.45);
  background: rgba(57, 208, 255, 0.1);
  color: #fff;
}

.viewer-nav .original {
  border-color: rgba(237, 28, 36, 0.34);
  color: #ffc4c6;
}

.frame-shell { min-width: 0; min-height: 0; background: #fff; }

iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #080808;
}

@media (max-width: 760px) {
  .viewer-inner { min-height: 54px; padding: 6px 8px; gap: 8px; }
  .viewer-brand img { width: 31px; height: 31px; }
  .viewer-brand .viewer-copy { display: none; }
  .viewer-nav { margin-left: 0; justify-content: flex-start; }
  .viewer-nav a { padding: 8px 9px; }
}

@media (max-width: 390px) {
  .viewer-brand img { width: 29px; height: 29px; }
  .viewer-inner { gap: 6px; }
}
