:root {
  --bg: #0a1013;
  --panel: #0f181d;
  --line: #20404a;
  --ink: #b8ffd7;
  --muted: #7dc7a7;
  --accent: #34ff95;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
header { width: min(1200px, 94vw); margin: 0 auto; display: flex; justify-content: space-between; padding: 12px 0; color: var(--muted); }
header a { color: inherit; text-decoration: none; }
main { width: min(1200px, 94vw); margin: 0 auto 22px; display: grid; grid-template-columns: 1.35fr .9fr; gap: 12px; }
.terminal-panel, .info-panel { border: 1px solid var(--line); background: var(--panel); min-height: 78vh; }
#terminal { height: 78vh; padding: 6px; }
.info-panel { padding: 14px; display: grid; grid-template-rows: auto auto auto minmax(220px, 1fr) auto; gap: 10px; overflow: auto; }
.info-panel h1 { margin: 0; font-size: 1.1rem; color: var(--accent); }
.info-panel p { margin: 0; color: var(--muted); }
.quick { display: flex; gap: 6px; flex-wrap: wrap; }
.quick button { border: 1px solid var(--line); background: #122129; color: var(--ink); height: 30px; padding: 0 10px; cursor: pointer; font: inherit; }
.quick button:hover { border-color: var(--accent); }
.list-wrap {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  gap: 8px;
  align-items: stretch;
  min-height: 0;
}
.scroll-cue {
  display: grid;
  grid-template-rows: auto 1fr auto;
  align-items: center;
  justify-items: center;
  color: var(--accent);
  font-size: .84rem;
  line-height: 1;
  user-select: none;
}
.scroll-cue-line {
  width: 1px;
  height: 100%;
  background: linear-gradient(180deg, rgba(52, 255, 149, 0.18), rgba(52, 255, 149, 0.95), rgba(52, 255, 149, 0.18));
  box-shadow: 0 0 8px rgba(52, 255, 149, 0.3);
}
.click-list { display: grid; gap: 8px; max-height: 40vh; overflow: auto; padding-right: 2px; }
.click-list h3 { margin: 6px 0 2px; color: var(--accent); font-size: .8rem; }
.click-item { border: 1px solid var(--line); background: #111f25; padding: 10px; cursor: pointer; }
.click-item:hover { border-color: var(--accent); }
.click-item strong { display: block; color: #e6ffe8; font-size: .9rem; margin-bottom: 2px; }
.click-item small { color: var(--muted); font-size: .76rem; line-height: 1.35; display: block; }
.photo-wrap h2 { margin: 0; font-size: .9rem; color: var(--accent); }
.photo-panel { margin-top: 8px; border: 1px solid var(--line); background: #0f171c; padding: 8px; min-height: 238px; }
.photo-panel.empty::before { content: "No media loaded"; color: var(--muted); font-size: .82rem; }
.media-stage {
  height: 170px;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  background: #0c1418;
  overflow: hidden;
}
.media-stage img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}
.media-controls {
  margin-top: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.media-controls button {
  border: 1px solid var(--line);
  background: #122129;
  color: var(--ink);
  height: 28px;
  padding: 0 10px;
  cursor: pointer;
  font: inherit;
}
.media-count {
  color: var(--muted);
  font-size: .75rem;
}
.thumb-strip {
  margin-top: 8px;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 2px;
  scrollbar-width: thin;
}
.thumb-strip::-webkit-scrollbar { height: 6px; }
.thumb-strip::-webkit-scrollbar-thumb { background: #28515f; }
.thumb {
  border: 1px solid var(--line);
  background: #0f1a20;
  min-width: 74px;
  width: 74px;
  height: 56px;
  flex: 0 0 auto;
  padding: 0;
  cursor: pointer;
}
.thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #0d171c;
}
.thumb.active {
  border-color: var(--accent);
}
.media-modal {
  width: min(92vw, 1080px);
  border: 1px solid var(--line);
  background: #0f171d;
  color: var(--ink);
  padding: 12px;
}
.media-modal::backdrop {
  background: rgba(0, 0, 0, 0.82);
}
.media-modal-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.media-modal-head button,
.media-close {
  border: 1px solid var(--line);
  background: #122129;
  color: var(--ink);
  height: 30px;
  padding: 0 10px;
  font: inherit;
  cursor: pointer;
}
#mediaCaption {
  text-align: center;
  color: var(--muted);
  font-size: .78rem;
}
.media-modal-stage {
  height: min(72vh, 780px);
  border: 1px solid var(--line);
  background: #0c1418;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.media-modal-stage img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}
.media-close {
  margin-top: 10px;
}
@media (max-width: 960px) {
  main { grid-template-columns: 1fr; }
  .terminal-panel, .info-panel, #terminal { min-height: 45vh; height: 45vh; }
  .click-list { max-height: 22vh; }
  .photo-panel { min-height: 200px; }
  .media-stage { height: 120px; }
}
