.intro h1 { font-size: clamp(44px, min(4.8vw, 8.4vh), 84px); font-weight: 300; line-height: 1; letter-spacing: -.045em; margin: 10px 0 14px; }
.lede { color: var(--ink-2); font-size: 14.5px; line-height: 1.65; margin: 0; max-width: 32ch; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }

.manuscript { display: flex; flex-direction: column; min-height: 120px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px 12px; }
.manuscript-body { flex: 1; min-height: 0; overflow-y: auto; margin: 8px -6px 0 0; padding: 6px 6px 10px 0; font-size: 14.5px; line-height: 1.75; color: var(--ink-2); scrollbar-width: thin; scrollbar-color: var(--line-2) transparent;
  mask-image: linear-gradient(to bottom, transparent, #000 12px, #000 calc(100% - 18px), transparent); }
.manuscript-body p { margin: 0 0 14px; }
.para-label { display: block; font-size: 11.5px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.sentence { cursor: pointer; border-radius: 6px; padding: 1px 2px; transition: color .2s, background-color .2s; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.sentence sup { display: none; }
.sentence:hover, .sentence:focus-visible, .sentence.is-hot { color: var(--ink); background: color-mix(in srgb, var(--c) 14%, transparent); outline: none; }
.sentence.is-selected { color: var(--ink); background: color-mix(in srgb, var(--c) 9%, transparent); }
.sentence.is-new { animation: arrive 1.2s var(--ease); }
@keyframes arrive { from { background: color-mix(in srgb, var(--accent) 28%, transparent); } }
.manuscript-empty { color: var(--muted); }
.caret { display: inline-block; width: 2px; height: 1.1em; background: var(--accent); border-radius: 1px; vertical-align: -3px; margin-left: 1px; animation: breathe 1s ease-in-out infinite; }
.typing { color: var(--ink); }
.panel-foot { margin: 0; padding-top: 8px; font-size: 12px; color: var(--muted); }
.replay-button { font-size: 12.5px; padding: 5px 12px; border-radius: 999px; background: rgba(var(--ink-rgb), .05); }
.replay-button:hover { background: rgba(var(--ink-rgb), .09); }
.replay-button[aria-pressed="true"] { color: #fff; background: var(--accent); }

.legend .categories { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.category-row { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 500; color: var(--ink-2); background: var(--surface); box-shadow: var(--shadow); transition: color .2s, background .2s; }
.category-row:hover, .category-row.active { color: var(--ink); background: var(--surface-solid); }
.category-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.category-total { color: var(--muted); font-size: 11.5px; }
.map-caption { margin: 0; display: flex; gap: 14px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.map-tools { display: flex; gap: 2px; padding: 4px; background: var(--surface); border-radius: 999px; box-shadow: var(--shadow); }

.inspector { display: flex; flex-direction: column; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px 14px; overflow-y: auto; scrollbar-width: thin; }
.inspector-id { font-size: 12px; color: var(--muted); }
#selected-origin { color: var(--accent); font-weight: 600; }
.inspector blockquote { margin: 12px 0 12px; font-size: clamp(17px, 1.3vw, 21px); font-weight: 400; line-height: 1.4; letter-spacing: -.01em; color: var(--ink); overflow-wrap: anywhere; }
.category-badge { align-self: flex-start; display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; color: var(--ink); padding: 5px 11px 5px 9px; border-radius: 999px; background: color-mix(in srgb, var(--c, var(--muted)) 14%, transparent); }
.category-badge::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--muted)); }
.sub-head { display: flex; justify-content: space-between; margin: 18px 0 8px; }
.sub-head span { color: var(--muted); font-weight: 400; }
.affinities { display: grid; gap: 6px; }
.affinity-row { display: grid; grid-template-columns: 88px 1fr 34px; align-items: center; gap: 10px; font-size: 12.5px; color: var(--ink-2); }
.affinity-row.is-top { color: var(--ink); font-weight: 600; }
.affinity-bar { height: 5px; border-radius: 3px; background: rgba(var(--ink-rgb), .06); overflow: hidden; }
.affinity-bar span { display: block; height: 100%; border-radius: 3px; background: var(--c); transform-origin: left; transform: scaleX(var(--s)); transition: transform .7s var(--ease); }
.affinity-value { text-align: right; color: var(--muted); font-size: 12px; }
.affinity-row.is-top .affinity-value { color: var(--ink); }
.neighbors { display: grid; gap: 2px; }
.neighbor { display: grid; grid-template-columns: 1fr 34px; gap: 10px; text-align: left; padding: 8px 10px 8px 0; border-radius: 10px; font-size: 13px; line-height: 1.45; color: var(--ink-2); transition: background .2s; }
.neighbor:hover { color: var(--ink); background: rgba(var(--ink-rgb), .04); }
.neighbor-text { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; padding-left: 12px; position: relative; }
.neighbor-text::before { content: ''; position: absolute; left: 0; top: .55em; width: 6px; height: 6px; border-radius: 50%; background: var(--c); }
.neighbor .similarity { font-size: 12px; color: var(--muted); text-align: right; }
.quiet { font-size: 13px; color: var(--muted); margin: 0; }

.constellation-labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.constellation-labels > div { position: absolute; left: 0; top: 0; white-space: nowrap; will-change: transform; }
.constellation-label { font-size: 12px; font-weight: 600; color: var(--label); margin: -30px 0 0 -50px; width: 100px; text-align: center; }
.constellation-selected-label, .constellation-hover-label { max-width: 250px; white-space: normal !important; margin: -14px 0 0 16px; padding: 7px 11px; font-size: 13px; line-height: 1.4; color: var(--ink); background: var(--surface-solid); border-radius: 10px; box-shadow: 0 6px 20px rgba(var(--shadow-rgb), .1); }
.constellation-hover-label { z-index: 2; box-shadow: 0 6px 20px rgba(var(--shadow-rgb), .12), inset 3px 0 0 var(--accent); }
.constellation-probe-label { font-size: 12px; font-weight: 600; color: var(--accent); margin: -28px 0 0 14px; }
.constellation-svg .svg-link { stroke: rgba(var(--ink-rgb), .12); }
.constellation-svg .svg-link.is-selected { stroke: rgba(var(--ink-rgb), .45); }
.constellation-svg .svg-link.is-hot { stroke: var(--accent); }
.constellation-svg circle[data-id] { cursor: pointer; }
.constellation-svg circle.is-selected { stroke: var(--ink); stroke-width: 2; }
.constellation-svg circle.is-hot { stroke: var(--accent); stroke-width: 2; }
.constellation-svg .svg-probe { fill: color-mix(in srgb, var(--accent) 25%, transparent); stroke: var(--accent); stroke-width: 1.5; }
.constellation-svg .svg-probe-link { stroke: var(--accent); stroke-dasharray: 4 3; }
.map-tools { align-items: center; }
.axes-button { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px 0 12px; border-radius: 999px; font-size: 12.5px; font-weight: 500; color: var(--ink-2); transition: color .2s, background .2s; }
.axes-button:hover { color: var(--ink); background: rgba(var(--ink-rgb), .05); }
.axes-button i { width: 26px; height: 15px; border-radius: 999px; background: rgba(var(--ink-rgb), .14); position: relative; transition: background .25s; }
.axes-button i::after { content: ''; position: absolute; top: 2px; left: 2px; width: 11px; height: 11px; border-radius: 50%; background: var(--ink); transition: transform .3s var(--ease); }
.axes-button[aria-pressed="true"] { color: var(--ink); }
.axes-button[aria-pressed="true"] i { background: var(--accent); }
.axes-button[aria-pressed="true"] i::after { transform: translateX(11px); background: #fff; }
.edit-themes { color: var(--muted); box-shadow: none; background: transparent; border: 1px dashed var(--line-2); }
.edit-themes .icon { width: 13px; height: 13px; }
.edit-themes:hover { color: var(--ink); }
.themes-modal { width: min(720px, calc(100vw - 32px)); display: none; flex-direction: column; }
.themes-modal[open] { display: flex; }
.themes-intro { margin: 0 0 14px; }
.themes-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; overflow-y: auto; min-height: 0; flex: 1; padding: 2px; scrollbar-width: thin; }
.theme-card { border-radius: 14px; padding: 10px 12px 12px; background: rgba(var(--ink-rgb), .035); box-shadow: inset 3px 0 0 var(--c); }
.theme-card-head { display: flex; align-items: center; gap: 8px; }
.swatch { width: 18px; height: 18px; border-radius: 50%; background: var(--c); flex-shrink: 0; box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 25%, transparent); }
.theme-name { flex: 1; min-width: 0; border: 0; background: none; font: 600 14px var(--font); color: var(--ink); padding: 6px 2px; border-radius: 6px; }
.theme-name:focus { outline: none; background: rgba(var(--ink-rgb), .05); }
.theme-count { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.theme-card .tool-button { width: 28px; height: 28px; font-size: 18px; }
.theme-examples { width: 100%; resize: vertical; margin-top: 6px; border: 0; border-radius: 10px; padding: 8px 10px; background: rgba(var(--ink-rgb), .045); font: 400 13px/1.55 var(--font); color: var(--ink-2); min-height: 92px; }
.theme-examples:focus { outline: none; color: var(--ink); box-shadow: 0 0 0 2px color-mix(in srgb, var(--c) 45%, transparent); }
.add-theme { margin-top: 10px; color: var(--accent); align-self: flex-start; }
.themes-status { min-height: 20px; margin: 8px 0 0; font-size: 12.5px; color: var(--muted); }
.themes-status.error { color: #e0654b; }
.themes-actions { display: flex; align-items: center; gap: 18px; margin-top: 10px; }
.themes-actions span { flex: 1; }
