:root {
  --bg-0: #07090d;
  --bg-1: #131822;
  --ink: #e8eaf0;
  --ink-dim: #8a93a6;
  --ink-faint: #545b6a;
  --c64-blue: #4040a0;
  --c64-blue-light: #7c80d6;
  --led: #ff5b3a;
  --bezel-0: #15181d;
  --bezel-1: #2a2f37;
  --bezel-2: #1d2127;
  --bezel-edge: #050608;
  --line: rgba(255, 255, 255, 0.05);
  --accent: #f0a040;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 50% -10%, rgba(124, 128, 214, 0.08) 0%, transparent 55%),
    radial-gradient(ellipse at 50% 120%, rgba(240, 160, 64, 0.04) 0%, transparent 55%),
    linear-gradient(180deg, var(--bg-1) 0%, var(--bg-0) 80%);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  overflow-x: hidden;
}

.topbar {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  padding: 0.85rem 1.25rem;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 9, 13, 0.6);
  backdrop-filter: blur(6px);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar .brand {
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.topbar .brand:hover { color: var(--c64-blue-light); }
.topbar .sep { color: var(--ink-faint); }
.topbar .title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  background: linear-gradient(180deg, #ffffff 0%, #b0b6c5 100%);
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
}
.topbar-actions {
  display: flex;
  gap: 0.4rem;
  margin-left: auto;
}
.topbar-link {
  color: var(--ink-dim);
  text-decoration: none;
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.4rem 0.75rem;
  border-radius: 5px;
  background: transparent;
  font-family: inherit;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.topbar-link:hover {
  color: var(--c64-blue-light);
  border-color: var(--c64-blue-light);
}

.hamburger {
  display: none;
  margin-left: auto;
  width: 32px;
  height: 32px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  padding: 0;
  cursor: pointer;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  transition: border-color 0.15s ease;
}
.hamburger:hover { border-color: var(--c64-blue-light); }
.hamburger span {
  display: block;
  width: 16px;
  height: 2px;
  background: var(--ink-dim);
  border-radius: 1px;
  transition: transform 0.2s ease, opacity 0.2s ease, background 0.15s ease;
}
.hamburger:hover span { background: var(--c64-blue-light); }
.hamburger.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 700px) {
  .hamburger { display: flex; }
  .topbar-actions {
    position: absolute;
    top: calc(100% + 1px);
    right: 0.5rem;
    flex-direction: column;
    background: linear-gradient(180deg, #14181f 0%, #0c0f14 100%);
    border: 1px solid var(--line);
    border-radius: 0 0 8px 8px;
    padding: 0.4rem;
    min-width: 220px;
    margin-left: 0;
    box-shadow: 0 12px 24px -10px rgba(0, 0, 0, 0.6);
    display: none;
    z-index: 9;
  }
  .topbar-actions.open { display: flex; }
  .topbar-actions .topbar-link {
    margin: 0;
    border-color: transparent;
    text-align: left;
    width: 100%;
  }
  .topbar-actions .topbar-link:hover {
    background: rgba(124, 128, 214, 0.08);
    border-color: rgba(124, 128, 214, 0.2);
  }
}

.stage {
  max-width: 1500px;
  margin: 0 auto;
  padding: 1rem 1.25rem 3rem;
}

.hero-line {
  text-align: center;
  font-size: 0.92rem;
  color: var(--ink-dim);
  margin: 0 0 1rem;
  font-style: italic;
  letter-spacing: 0.005em;
}

.cockpit {
  display: grid;
  grid-template-columns: minmax(0, 720px) minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}
@media (max-width: 1100px) {
  .cockpit { grid-template-columns: 1fr; }
}

.monitor {
  margin: 0 auto;
  max-width: 720px;
  width: 100%;
}

.bezel {
  position: relative;
  border-radius: 18px;
  padding: 26px;
  background:
    radial-gradient(ellipse at 30% 0%, rgba(255, 255, 255, 0.04), transparent 60%),
    linear-gradient(180deg, var(--bezel-1) 0%, var(--bezel-2) 50%, var(--bezel-0) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    inset 0 -1px 0 rgba(0, 0, 0, 0.5),
    inset 0 0 0 1px rgba(255, 255, 255, 0.02),
    0 30px 60px -20px rgba(0, 0, 0, 0.7),
    0 8px 16px rgba(0, 0, 0, 0.5);
}

.screw {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 35%, #4a4f57 0%, #1a1c20 70%, #0a0b0e 100%);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.1),
    0 1px 1px rgba(0, 0, 0, 0.5);
}
.screw::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(45deg, transparent 47%, rgba(0, 0, 0, 0.5) 47%, rgba(0, 0, 0, 0.5) 53%, transparent 53%);
  border-radius: 50%;
}
.screw-tl { top: 10px; left: 10px; }
.screw-tr { top: 10px; right: 10px; }
.screw-bl { bottom: 10px; left: 10px; }
.screw-br { bottom: 10px; right: 10px; }

.screen {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 6px;
  overflow: hidden;
  background: #000;
  box-shadow:
    inset 0 0 0 2px var(--bezel-edge),
    inset 0 0 0 5px #0d0f12,
    inset 0 0 80px rgba(0, 0, 0, 0.95),
    0 0 0 1px rgba(255, 255, 255, 0.02);
}

.screen .game {
  position: absolute !important;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  margin: 0;
  display: block;
  border: 0;
  background: #000;
  image-rendering: optimizeSpeed;
  image-rendering: -moz-crisp-edges;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: pixelated;
  -ms-interpolation-mode: nearest-neighbor;
  outline: none;
}

.scanlines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(0, 0, 0, 0) 0,
      rgba(0, 0, 0, 0) 2px,
      rgba(0, 0, 0, 0.22) 3px
    );
  mix-blend-mode: multiply;
  opacity: 0.85;
}

.glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow:
    inset 0 0 90px rgba(124, 128, 214, 0.12),
    inset 0 0 30px rgba(124, 128, 214, 0.08);
}

.vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, 0.55) 100%);
}

.chassis {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 14px 28px 0;
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  color: var(--ink-faint);
  text-transform: uppercase;
}
.led {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--led);
  box-shadow:
    0 0 5px var(--led),
    0 0 14px rgba(255, 91, 58, 0.45),
    inset 0 0 2px rgba(255, 255, 255, 0.4);
}
.brandmark {
  margin-left: auto;
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: var(--ink-dim);
}

.drive-area {
  margin: 0;
  max-width: 100%;
}

.shelf-wrap {
  margin-bottom: 1rem;
}
.shelf-label {
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 0.5rem;
  padding-left: 0.25rem;
}
.shelf {
  display: flex;
  gap: 0.85rem;
  overflow-x: auto;
  padding: 0.5rem 0.25rem 0.85rem;
  scrollbar-width: thin;
}
.shelf::-webkit-scrollbar { height: 6px; }
.shelf::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 3px; }

.disk {
  position: relative;
  flex: 0 0 auto;
  width: 72px;
  height: 76px;
  border-radius: 4px 4px 4px 4px;
  background:
    linear-gradient(135deg, #2a2f37 0%, #1a1d22 100%);
  border: 1px solid rgba(0, 0, 0, 0.5);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 6px 12px -6px rgba(0, 0, 0, 0.6);
  cursor: pointer;
  padding: 0;
  font-family: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.disk:hover { transform: translateY(-2px); }
.disk.mounted {
  outline: 2px solid var(--c64-blue-light);
  outline-offset: 2px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 0 12px -2px rgba(124, 128, 214, 0.4);
}
.disk-shutter {
  position: absolute;
  top: 7px; left: 16px; right: 16px;
  height: 14px;
  background: linear-gradient(180deg, #5a5f67 0%, #3a3f47 100%);
  border-radius: 2px;
  border-top: 1px solid #6a6f77;
  box-shadow: inset 0 -1px 0 rgba(0,0,0,0.4);
}
.disk-label {
  position: absolute;
  bottom: 6px;
  left: 6px;
  right: 6px;
  height: 28px;
  background: linear-gradient(180deg, #d8dbe3 0%, #b8bcc6 100%);
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}
.disk-text {
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 8px;
  font-weight: 700;
  color: #1a1d22;
  text-align: center;
  letter-spacing: 0.04em;
  line-height: 1.1;
  text-transform: uppercase;
  word-break: break-word;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}
.disk-delete {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #14171c;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--ink-dim);
  font-size: 0.85rem;
  line-height: 16px;
  text-align: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease, color 0.15s ease;
}
.disk:hover .disk-delete { opacity: 1; }
.disk-delete:hover { color: var(--led); }

.disk-add {
  background: transparent;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-faint);
}
.disk-add:hover {
  border-color: var(--c64-blue-light);
  color: var(--c64-blue-light);
}
.disk-plus {
  font-size: 1.6rem;
  font-weight: 300;
}

.drive-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.85rem;
}

.drive-1541 {
  background: linear-gradient(180deg, #20242c 0%, #14171c 100%);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0;
  overflow: hidden;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 12px 24px -10px rgba(0, 0, 0, 0.6);
}
.drive-top {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.7rem 0.95rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.4);
  background: linear-gradient(180deg, #2a2f37 0%, #1d2127 100%);
}
.drive-led {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2a2f37;
  box-shadow: inset 0 0 2px rgba(0, 0, 0, 0.7);
  transition: background 0.1s ease, box-shadow 0.1s ease;
}
.drive-led.on {
  background: #56e07a;
  box-shadow:
    0 0 8px #56e07a,
    0 0 16px rgba(86, 224, 122, 0.5),
    inset 0 0 2px rgba(255, 255, 255, 0.5);
}
.drive-name {
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-weight: 700;
  letter-spacing: 0.16em;
  font-size: 0.8rem;
  color: var(--ink);
}
.drive-spindle {
  margin-left: auto;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 35%, #6a6f77 0%, #2a2f37 70%, #14171c 100%);
  box-shadow: inset 0 0 2px rgba(0, 0, 0, 0.6);
}

.drive-window {
  background: var(--c64-blue);
  color: #c8caff;
  font-family: "SF Mono", Menlo, Consolas, monospace;
  padding: 0.7rem 0.85rem 0.85rem;
  min-height: 200px;
}
.dir-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding-bottom: 0.5rem;
  margin-bottom: 0.5rem;
  border-bottom: 1px dashed rgba(200, 202, 255, 0.25);
}
.dir-disk-name {
  font-weight: 700;
  color: #ffffff;
}
.dir-blocks-free {
  color: rgba(200, 202, 255, 0.85);
}

.directory {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.78rem;
}
.dir-empty {
  padding: 0.5rem 0;
  color: rgba(200, 202, 255, 0.55);
  font-style: italic;
  letter-spacing: 0.04em;
}
.dir-entry {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.28rem 0.25rem;
  border-radius: 3px;
  transition: background 0.1s ease;
}
.dir-entry:hover { background: rgba(255, 255, 255, 0.06); }
.dir-blocks {
  color: rgba(200, 202, 255, 0.85);
  width: 3.2ch;
  text-align: right;
}
.dir-name {
  flex: 1;
  color: #ffffff;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dir-type {
  color: rgba(200, 202, 255, 0.85);
  letter-spacing: 0.06em;
}
.dir-actions {
  display: inline-flex;
  gap: 0.3rem;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.dir-entry:hover .dir-actions { opacity: 1; }
.dir-actions button {
  background: transparent;
  border: 1px solid rgba(200, 202, 255, 0.35);
  color: #ffffff;
  font-family: inherit;
  font-size: 0.7rem;
  padding: 0.18rem 0.45rem;
  border-radius: 3px;
  cursor: pointer;
  letter-spacing: 0.04em;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.dir-actions button:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.7);
}
.dir-del:hover { color: #ffb8a8 !important; border-color: rgba(255, 184, 168, 0.7) !important; }

.editor-pane {
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #20242c 0%, #14171c 100%);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 12px 24px -10px rgba(0, 0, 0, 0.6);
}
.editor-bar {
  display: flex;
  gap: 0.5rem;
  padding: 0.7rem 0.85rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.4);
  background: linear-gradient(180deg, #2a2f37 0%, #1d2127 100%);
}
.filename-input {
  flex: 1;
  min-width: 0;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--ink);
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.78rem;
  padding: 0.4rem 0.55rem;
  border-radius: 4px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  outline: none;
}
.filename-input:focus { border-color: var(--c64-blue-light); }
.btn-pill {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--ink);
  font-family: inherit;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.4rem 0.7rem;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.btn-pill:hover {
  color: var(--c64-blue-light);
  border-color: var(--c64-blue-light);
}
.btn-pill-primary {
  border-color: var(--c64-blue-light);
  color: var(--c64-blue-light);
}
.btn-pill-primary:hover {
  background: var(--c64-blue-light);
  color: #0c0f14;
}

.editor {
  flex: 1;
  width: 100%;
  min-height: 200px;
  border: 0;
  background: var(--c64-blue);
  color: #c8caff;
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.82rem;
  line-height: 1.45;
  padding: 0.7rem 0.85rem;
  resize: vertical;
  outline: none;
  letter-spacing: 0.01em;
}
.editor::placeholder { color: rgba(200, 202, 255, 0.45); }

.editor-hint {
  margin: 0;
  padding: 0.55rem 0.85rem;
  font-size: 0.72rem;
  color: var(--ink-dim);
  background: rgba(0, 0, 0, 0.3);
  border-top: 1px solid rgba(0, 0, 0, 0.4);
  line-height: 1.5;
}
.kbd {
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.68rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.05rem 0.35rem;
  border-radius: 3px;
  color: var(--ink);
}

@media (max-width: 880px) {
  .drive-grid { grid-template-columns: 1fr; }
  .editor { min-height: 160px; }
}

.legal {
  text-align: center;
  font-size: 0.7rem;
  color: var(--ink-faint);
  padding: 0.9rem 1rem 1.1rem;
  letter-spacing: 0.05em;
}
.legal p { margin: 0; }
.legal a { color: var(--ink-dim); text-decoration: none; border-bottom: 1px dotted var(--ink-faint); }
.legal a:hover { color: var(--c64-blue-light); border-color: var(--c64-blue-light); }

@media (max-width: 600px) {
  .stage { padding: 1rem 1rem 3rem; }
  .bezel { padding: 18px; border-radius: 14px; }
  .screw-tl, .screw-tr, .screw-bl, .screw-br { width: 6px; height: 6px; }
  .chassis { padding: 12px 18px 0; font-size: 0.62rem; }
  .drive-shell { padding: 0.8rem 0.9rem; gap: 0.7rem; }
  .drive-action { padding: 0.45rem 0.75rem; font-size: 0.7rem; }
  .topbar .title { font-size: 0.92rem; }
  .manual-panel { width: 92vw; min-width: 0; }
}

.manual-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 50;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.manual-backdrop.open { opacity: 1; }

.manual-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 50vw;
  min-width: 380px;
  background: linear-gradient(180deg, #14181f 0%, #0c0f14 100%);
  border-left: 1px solid var(--line);
  box-shadow: -30px 0 60px -20px rgba(0, 0, 0, 0.7);
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.22, 0.61, 0.36, 1);
  z-index: 51;
  display: flex;
  flex-direction: column;
}
.manual-panel.open { transform: translateX(0); }

.manual-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 9, 13, 0.5);
}
.manual-title {
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink);
}
.manual-action {
  margin-left: auto;
  color: var(--ink-dim);
  text-decoration: none;
  font-size: 1rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: color 0.15s ease, border-color 0.15s ease;
}
.manual-action:hover {
  color: var(--c64-blue-light);
  border-color: var(--c64-blue-light);
}
.manual-close {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--ink-dim);
  width: 32px;
  height: 32px;
  border-radius: 4px;
  font-size: 1.1rem;
  cursor: pointer;
  font-family: inherit;
  line-height: 1;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.manual-close:hover {
  color: var(--c64-blue-light);
  border-color: var(--c64-blue-light);
}

.manual-content {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.manual-frame {
  flex: 1;
  width: 100%;
  border: 0;
  background: #1a1a1a;
}

.manual-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  padding: 2rem;
  text-align: center;
  background: linear-gradient(180deg, #14181f 0%, #0c0f14 100%);
}
.manual-loading-title {
  font-size: 0.9rem;
  color: var(--ink);
  letter-spacing: 0.02em;
}
.manual-progress-track {
  width: min(360px, 80%);
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 3px;
  overflow: hidden;
}
.manual-progress-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--c64-blue) 0%, var(--c64-blue-light) 100%);
  transition: width 0.15s ease;
}
.manual-loading-meta {
  display: flex;
  gap: 0.55rem;
  font-size: 0.75rem;
  color: var(--ink-dim);
  font-family: "SF Mono", Menlo, Consolas, monospace;
  letter-spacing: 0.02em;
}
.manual-loading-dot { color: var(--ink-faint); }
.manual-loading-size { color: var(--ink-faint); }

.pdfjs-viewer {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #1a1a1a;
}
.pdfjs-viewer[hidden] { display: none; }
.pdfjs-toolbar {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.75rem;
  background: linear-gradient(180deg, #1d2127 0%, #14171c 100%);
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.pdfjs-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--ink-dim);
  font-family: inherit;
  font-size: 0.92rem;
  width: 28px;
  height: 28px;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0;
  transition: color 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}
.pdfjs-btn:hover {
  color: var(--c64-blue-light);
  border-color: var(--c64-blue-light);
  background: rgba(124, 128, 214, 0.08);
}
.pdfjs-btn-text {
  width: auto;
  padding: 0 0.6rem;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.pdfjs-page-input {
  width: 3.6ch;
  padding: 0.25rem 0.4rem;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--ink);
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.78rem;
  border-radius: 4px;
  text-align: right;
  outline: none;
  -moz-appearance: textfield;
}
.pdfjs-page-input::-webkit-outer-spin-button,
.pdfjs-page-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.pdfjs-page-input:focus { border-color: var(--c64-blue-light); }
.pdfjs-page-total {
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.78rem;
  color: var(--ink-dim);
  letter-spacing: 0.04em;
}
.pdfjs-divider {
  width: 1px;
  height: 18px;
  background: rgba(255, 255, 255, 0.08);
  margin: 0 0.25rem;
}
.pdfjs-zoom {
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.74rem;
  color: var(--ink-dim);
  min-width: 3.5ch;
  text-align: center;
}
.pdfjs-canvas-wrap {
  flex: 1;
  overflow: auto;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 1rem;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(124, 128, 214, 0.04) 0%, transparent 60%),
    #0f1318;
}
.pdfjs-canvas-wrap canvas {
  display: block;
  background: #ffffff;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04),
    0 20px 40px -10px rgba(0, 0, 0, 0.6);
}
