:root {
  --bg: #1B1714;
  --text: #F4EDE1;
  --muted: #B8AE9F;
  --alert: #FF6B5E;
  --panel: #2A2420;
  --border: #4A3F35;
  --font: "Rubik", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#titles {
  flex: none;
  position: relative;
  height: 44px;
  overflow: hidden;
  background: var(--bg);
}
#titles-track { position: absolute; inset: 0 auto 0 0; }
#clock {
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  display: flex;
  align-items: center;
  padding: 0 16px 0 24px;
  background: linear-gradient(90deg, transparent, var(--bg) 20%);
  color: var(--muted);
  font-size: 14px;
}
#clock a { color: var(--text); font-weight: 600; text-decoration: none; }
#clock a:hover { text-decoration: underline; }
.col-title {
  position: absolute;
  top: 0;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 19px;
  font-weight: 600;
  cursor: grab;
  user-select: none;
  touch-action: none;
  background-size: 100% 100%;
  image-rendering: pixelated;
  text-shadow: 0 1px 0 #000, 0 0 6px rgba(0, 0, 0, 0.8);
}
#titles-track.dragging .col-title { cursor: grabbing; }
.badge {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: var(--alert);
  color: #fff;
  font-size: 13px;
  line-height: 20px;
  text-align: center;
}
#scroller {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: flex;
  align-items: flex-start;
}
#scroller.fits { justify-content: center; }
/* Always show the horizontal scrollbar (macOS hides overlay scrollbars by default). */
@supports (-moz-appearance: none) { #scroller { scrollbar-color: #6B5A48 #241F1B; } }
#scroller::-webkit-scrollbar { height: 12px; width: 12px; }
#scroller::-webkit-scrollbar-track { background: #241F1B; }
#scroller::-webkit-scrollbar-thumb { background: #6B5A48; border: 2px solid #241F1B; }
#scroller::-webkit-scrollbar-thumb:hover { background: #8A745C; }
#scene { display: block; flex: none; image-rendering: pixelated; touch-action: pan-x pan-y; }
#scene[hidden], #titles[hidden] { display: none; }
#pop {
  position: fixed;
  z-index: 10;
  width: min(320px, calc(100vw - 16px));
  background: var(--panel);
  border: 2px solid var(--border);
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.45;
}
#pop p { margin: 8px 0 12px; }
#pop .close {
  position: absolute;
  top: 4px;
  right: 6px;
  width: 28px;
  height: 28px;
  border: 0;
  background: none;
  color: var(--muted);
  font: 22px/1 var(--font);
  cursor: pointer;
}
#pop .close:hover { color: var(--text); }
.pop-title { padding-right: 24px; }
.pop-title { font-size: 16px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.pop-sub { color: var(--muted); margin-top: 4px; }
.btn {
  display: inline-block;
  margin-top: 4px;
  padding: 6px 12px;
  border: 2px solid var(--border);
  color: var(--text);
  text-decoration: none;
}
.btn:hover { background: #3A322B; }
.btn.primary { background: #D97757; border-color: #D97757; color: #fff; }
#pop textarea {
  width: 100%;
  margin: 0 0 8px;
  padding: 8px;
  background: var(--bg);
  border: 2px solid var(--border);
  color: var(--text);
  font: 14px/1.4 var(--font);
  resize: vertical;
}
#pop textarea:focus { outline: none; border-color: var(--muted); }
#pop button.btn { font: inherit; cursor: pointer; background: none; }
#pop button.btn.primary { background: #D97757; }
#pop button.btn:disabled { opacity: 0.5; cursor: default; }
.pop-msg { color: var(--alert); margin-top: 6px; }
#clock .who { margin-left: 4px; }
#clock button { background: none; border: 0; color: var(--muted); font: inherit; cursor: pointer; padding: 0 0 0 10px; text-decoration: underline; }
#clock button:hover { color: var(--text); }

/* No funnels yet: how to connect an agent. */
.connect { margin: 48px auto; max-width: 620px; padding: 0 20px; line-height: 1.55; }
.connect h1 { font-size: 30px; margin: 0 0 8px; }
.connect p { color: var(--muted); margin: 0 0 14px; }
.connect h2 { font-size: 17px; margin: 22px 0 6px; }
.connect code, .connect pre {
  font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace;
  background: var(--panel);
  border: 2px solid var(--border);
}
.connect code { padding: 1px 6px; }
.connect pre { padding: 10px 12px; overflow-x: auto; white-space: pre-wrap; overflow-wrap: anywhere; margin: 0 0 8px; }
.connect a { color: #F2C14E; }

/* Site header, the same as on the landing page. */
.sitebar {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  /* The same width as the header on the landing page, as tall as its button. */
  padding: 0 max(20px, calc((100% - 1000px) / 2));
}
.sitebar .logo { font-weight: 700; font-size: 20px; text-decoration: none; color: var(--text); }
.sitebar .logo span { color: #F2C14E; }
.sitebar .links { display: flex; align-items: center; gap: 20px; font-size: 15px; }
.sitebar .links a { color: var(--muted); text-decoration: none; white-space: nowrap; }
.sitebar .links a:hover, .sitebar .links a.here { color: var(--text); }
.sitebar .links a.signin { white-space: nowrap; background: #F2C14E; color: #1B1714; font-weight: 600; padding: 6px 16px; line-height: 22px; border: 2px solid #F2C14E; }
.sitebar .links a.signin:hover { background: #FFD866; border-color: #FFD866; }
@media (max-width: 560px) { .sitebar .links { gap: 14px; } .sitebar .links .wide { display: none; } .sitebar .links a.signin { padding: 4px 12px; } }
.sitebar .links a.gh { display: flex; }
.sitebar .logo { display: inline-flex; align-items: center; }
.sitebar .logo .mark { image-rendering: pixelated; margin-right: 8px; }
.copybox { position: relative; margin: 0 0 8px; }
.copybox pre { margin: 0; padding-right: 48px; }
.copybox .copy {
  position: absolute; top: 6px; right: 6px; display: flex; padding: 5px;
  background: var(--panel); border: 2px solid var(--border); color: var(--muted); cursor: pointer;
}
.copybox .copy:hover { border-color: var(--muted); color: var(--text); }
