:root { --serif: "Instrument Serif", Georgia, serif; --sans: "Inter Tight", system-ui, "Segoe UI", Arial, sans-serif; --ink: #17131f; --ink2: #5d5768; --paper: #f3f0ea; --card: #fffdf9; --line: rgba(23,19,31,.12); --vio: #6a2bff; --mag: #ff2e88; --org: #ff8a1f; --amb: #ffc533; --soft: #e9e4db; }
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; color: var(--ink); font: 400 15px/1.5 var(--sans); -webkit-font-smoothing: antialiased; background: var(--paper); overflow: hidden; }
button, input { font: inherit; color: inherit; }
a { color: inherit; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.stage { position: fixed; inset: 0; overflow: hidden;
  background: radial-gradient(38% 30% at 50% 62%, rgba(255,46,136,.16), transparent 70%), radial-gradient(30% 26% at 62% 56%, rgba(255,138,31,.16), transparent 70%), radial-gradient(34% 30% at 38% 52%, rgba(106,43,255,.13), transparent 70%), radial-gradient(120% 90% at 50% 40%, #faf8f3 0%, #ece8e0 100%); }
#gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: pointer; touch-action: manipulation; }

nav { position: absolute; z-index: 4; left: 0; right: 0; top: 0; display: flex; align-items: center; gap: 22px; padding: 18px 26px; pointer-events: none; }
nav > * { pointer-events: auto; }
.brand { font: 400 30px/1 var(--serif); letter-spacing: -.01em; display: flex; align-items: center; gap: 8px; text-decoration: none; }
.brand i { width: 12px; height: 12px; border-radius: 50%; background: conic-gradient(var(--vio), var(--mag), var(--org), var(--amb), var(--vio)); }
nav .sp { flex: 1; pointer-events: none; }
nav button.lk { background: none; border: 0; padding: 4px 0; cursor: pointer; color: var(--ink2); font-size: 14px; }
nav button.lk:hover { color: var(--ink); }
.pill { border: 1px solid var(--ink); background: none; border-radius: 999px; padding: 8px 18px; cursor: pointer; font-weight: 500; font-size: 14px; }
.pill:hover { background: var(--ink); color: #fff; }

.bubble { position: absolute; z-index: 3; left: calc(50% + min(21vh, 210px)); top: 16%; width: min(330px, 32vw); background: var(--card); border-radius: 18px 18px 18px 4px; padding: 16px 18px; box-shadow: 0 18px 50px -18px rgba(40,20,70,.35), 0 0 0 1px var(--line); font-size: 15.5px; line-height: 1.45; min-height: 58px; }
.bubble em { font: italic 400 1.2em/1 var(--serif); }
.bubble b { font-weight: 600; }
.bubble .cur { display: inline-block; width: 8px; height: 1em; background: var(--ink); vertical-align: -2px; margin-left: 2px; animation: bl 1s steps(1) infinite; }
@keyframes bl { 50% { opacity: 0; } }
@keyframes up { from { opacity: 0; transform: translateY(10px); } }

.read { position: absolute; z-index: 3; left: 26px; top: 86px; width: min(350px, 30vw); max-height: calc(100vh - 200px); overflow: auto; background: var(--card); border-radius: 20px; padding: 18px; box-shadow: 0 24px 60px -24px rgba(40,20,70,.4), 0 0 0 1px var(--line); display: none; }
.read.on { display: block; animation: up .35s ease both; }
.head { display: flex; gap: 12px; align-items: center; }
.head img, .head .ph { width: 46px; height: 46px; border-radius: 12px; object-fit: cover; background: var(--soft); flex: none; }
.head h2 { margin: 0; font: 400 26px/1.05 var(--serif); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.head p { margin: 2px 0 0; font-size: 12.5px; color: var(--ink2); }
.x { margin-left: auto; align-self: flex-start; width: 30px; height: 30px; border-radius: 50%; border: 0; background: var(--soft); cursor: pointer; font-size: 15px; line-height: 1; flex: none; }
.bar { display: flex; height: 12px; border-radius: 999px; overflow: hidden; margin: 16px 0 8px; background: var(--soft); }
.bar i:nth-child(1) { background: var(--vio); } .bar i:nth-child(2) { background: var(--mag); }
.key { display: flex; gap: 12px; font-size: 12px; color: var(--ink2); flex-wrap: wrap; }
.key b { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; }
dl { display: grid; grid-template-columns: 1fr auto; gap: 7px 12px; margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13.5px; }
dt { color: var(--ink2); } dd { margin: 0; text-align: right; font-weight: 500; font-variant-numeric: tabular-nums; }
.sec { margin: 14px 0 6px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--ink2); }
.who { list-style: none; margin: 0; padding: 0; font-size: 13px; font-variant-numeric: tabular-nums; }
.who li { display: grid; grid-template-columns: 1fr 60px 44px; gap: 8px; align-items: center; padding: 3px 0; }
.who code { font: 400 12.5px ui-monospace, Consolas, monospace; color: var(--ink2); }
.who code u { text-decoration: none; color: var(--mag); font-family: var(--sans); font-weight: 600; margin-left: 6px; font-size: 11px; }
.who span { height: 6px; border-radius: 3px; background: var(--soft); overflow: hidden; }
.who span i { display: block; height: 100%; background: var(--mag); border-radius: 3px; }
.who b { text-align: right; font-weight: 500; }
.acts { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.acts button, .acts a { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 7px 14px; font-size: 13px; font-weight: 500; cursor: pointer; text-decoration: none; }
.acts button:hover, .acts a:hover { border-color: var(--ink); }
.src { margin: 12px 0 0; font-size: 11.5px; color: var(--ink2); }

.dock { position: absolute; z-index: 4; left: 50%; bottom: 26px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 10px; width: min(700px, calc(100vw - 28px)); pointer-events: none; }
.dock > * { pointer-events: auto; }
.tray { width: 100%; background: var(--card); border-radius: 22px; padding: 12px; box-shadow: 0 24px 60px -24px rgba(40,20,70,.4), 0 0 0 1px var(--line); display: none; }
.tray.on { display: block; animation: up .25s ease both; }
.ask { display: flex; gap: 8px; }
.ask input, .ca { flex: 1; min-width: 0; height: 46px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-size: 14.5px; }
.ask input:focus { outline: 2px solid var(--vio); outline-offset: 1px; }
.ca { display: flex; align-items: center; font: 400 13px ui-monospace, Consolas, monospace; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.go { height: 46px; padding: 0 22px; border: 0; border-radius: 999px; background: var(--ink); color: #fff; font-weight: 600; cursor: pointer; white-space: nowrap; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 999px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-size: 13.5px; font-weight: 500; }
.chip:hover { border-color: var(--ink); }
.chip img, .chip .ph { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; background: var(--soft); }
.chip small { color: var(--ink2); font-weight: 400; }
.text { padding: 6px 8px; font-size: 14px; color: var(--ink2); max-height: 42vh; overflow: auto; }
.text h2 { margin: 0 0 6px; font: 400 24px/1.1 var(--serif); color: var(--ink); }
.text p { margin: 0 0 8px; } .text b { color: var(--ink); }
.text textarea { width: 100%; margin-top: 6px; font: 12px ui-monospace, Consolas, monospace; }
.tools { display: flex; gap: 2px; background: var(--card); border-radius: 999px; padding: 6px; box-shadow: 0 18px 44px -18px rgba(40,20,70,.4), 0 0 0 1px var(--line); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.tools::-webkit-scrollbar { display: none; }
.tools button { border: 0; background: none; padding: 9px 16px; border-radius: 999px; cursor: pointer; font-size: 14px; white-space: nowrap; }
.tools button:hover { background: #efeae2; }
.tools button.on { background: var(--ink); color: #fff; }
.foot { position: absolute; z-index: 2; left: 26px; bottom: 30px; margin: 0; font-size: 11.5px; color: var(--ink2); max-width: 220px; line-height: 1.4; }

@media (max-width: 900px) {
  nav { padding: 14px; } nav .lk { display: none; }
  .bubble { left: 14px; right: 14px; top: 66px; width: auto; border-radius: 18px; font-size: 15px; }
  .read { left: 14px; right: 14px; top: auto; bottom: 74px; width: auto; max-height: min(62vh, calc(100vh - 230px)); }
  .dock { bottom: 14px; }
  .tools button { padding: 9px 12px; font-size: 13.5px; }
  .foot { display: none; }
}
@media (prefers-reduced-motion: reduce) { .read.on, .tray.on { animation: none; } }
