/* GPT-2 page */
.gpt-text { width: 100%; max-width: 900px; background: var(--panel); color: var(--text); border: 1px solid var(--line);
  border-radius: 8px; padding: 10px 12px; font: 15px/1.5 ui-monospace, "SF Mono", Menlo, monospace; resize: vertical; }
.gpt-text:focus { outline: none; border-color: var(--accent); }
.tok-strip { display: flex; flex-wrap: wrap; gap: 3px; margin: 12px 0; max-width: 1000px; }
.tok-strip.small .tok { font-size: 11px; padding: 1px 4px; }
.tok { font: 13px/1.5 ui-monospace, "SF Mono", Menlo, monospace; padding: 1px 5px; border-radius: 4px; white-space: pre;
  background: #2a2d36; color: var(--text); cursor: default; border: 1px solid transparent; }
.tok.c0 { background: #3a2f4f; } .tok.c1 { background: #2f4540; } .tok.c2 { background: #4a3a2a; } .tok.c3 { background: #2c3a52; }
.tok.word { background: #4a3a2a; color: #ffd9a8; }
.tok.byte, .tok.fragment { background: #22252c; color: var(--muted); }
.tok.mojibake { background: #3a2f4f; }
.prob .tok { cursor: pointer; }
.prob .tok.first { background: #22252c; color: var(--muted); }
.tok.sel { border-color: #fff; box-shadow: 0 0 0 1px #fff; }
.tok-inline { font-family: ui-monospace, Menlo, monospace; color: var(--accent); text-transform: none; letter-spacing: 0; }

.vocab-layout { display: grid; grid-template-columns: 560px 1fr; gap: 28px; align-items: start; margin: 18px 0; }
#dist-hist { width: 100%; border-radius: 8px; }
.residue-list { max-width: 80ch; padding-left: 20px; }
.residue-list li { margin: 6px 0; }

.prompt-row { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.prompt-row .gpt-text { flex: 1 1 520px; }
.prompt-controls { display: flex; flex-direction: column; gap: 8px; font-size: 14px; color: var(--muted); }
.prompt-controls input { width: 64px; background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 5px; padding: 3px 6px; }
.forward-layout { display: grid; grid-template-columns: 1fr 340px; gap: 28px; margin-top: 10px; }
.next-dist { list-style: none; padding: 0; margin: 0; font: 13px ui-monospace, Menlo, monospace; }
.next-dist li, .attn-item { position: relative; display: flex; justify-content: space-between; padding: 3px 8px; margin: 2px 0;
  background: var(--panel); border-radius: 4px; overflow: hidden; }
.next-dist .bar, .attn-item .bar { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(244, 164, 58, .28); }
.next-dist .label, .next-dist .p, .attn-item .label, .attn-item .p { position: relative; white-space: pre; }
.next-dist li.actual { outline: 1px solid var(--accent); }

.layer-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 22px 0 8px; }
.layer-tabs button.active { border-color: var(--accent); color: var(--accent); }
.lens-grid { overflow-x: auto; font: 12px ui-monospace, Menlo, monospace; padding-bottom: 8px; }
.lens-row { display: flex; gap: 2px; margin-bottom: 2px; }
.lens-label { flex: none; width: 70px; color: var(--muted); text-align: right; padding-right: 8px; line-height: 22px; }
.lens-cell { flex: none; width: 82px; height: 22px; line-height: 22px; overflow: hidden; text-overflow: ellipsis; white-space: pre;
  padding: 0 4px; border-radius: 3px; }
.lens-cell.hit { outline: 1px solid #fff; outline-offset: -1px; }
.lens-row.head .lens-cell { background: transparent; color: var(--accent); }
.attn-wrap { display: flex; gap: 24px; align-items: flex-start; flex-wrap: wrap; margin-top: 10px; }
#attn-canvas { width: 512px; height: 512px; image-rendering: pixelated; border-radius: 6px; background: #0e0f12; }
.attn-row { min-width: 280px; font: 13px ui-monospace, Menlo, monospace; }
#tab-attn select { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 5px; padding: 3px 6px; }

#mem-buttons button.active { border-color: var(--accent); color: var(--accent); }
.mem-table { border-collapse: collapse; margin: 18px 0; font-size: 14px; }
.mem-table th, .mem-table td { text-align: left; padding: 5px 14px 5px 0; border-bottom: 1px solid var(--line); }
.mem-table th { color: var(--muted); font-weight: normal; }
.mbar { display: inline-block; height: 8px; background: var(--accent); border-radius: 2px; margin-right: 8px; vertical-align: middle; }
.uncond blockquote { margin: 8px 0; padding: 8px 14px; background: var(--panel); border-left: 3px solid var(--accent);
  border-radius: 4px; font-size: 14px; max-width: 900px; }
.uncond .seed { display: inline-block; min-width: 80px; color: var(--muted); font: 12px ui-monospace, Menlo, monospace; }
footer { padding: 40px 0 60px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); }
@media (max-width: 900px) { .vocab-layout, .forward-layout { grid-template-columns: 1fr; } }
