:root{
  --ink:#173246;
  --ink-2:#28485a;
  --muted:#667f8c;
  --line:#c7d8df;
  --line-strong:#9fb9c5;
  --paper:#fbfdfe;
  --mist:#edf5f7;
  --blue:#086aa8;
  --teal:#087b72;
  --teal-soft:#dff2ef;
  --blue-soft:#e1f0f8;
  --wood:#76543a;
  --wood-light:#a98262;
  --brass:#a77a2a;
  --brass-light:#d6b363;
  --danger:#9b3a34;
  --shadow:0 18px 50px rgba(30,61,76,.14);
  font-family:Inter,ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  color:var(--ink);
  background:var(--mist);
}
*{box-sizing:border-box}
html,body{margin:0;min-height:100%;overflow-x:hidden;background:var(--mist)}
body{height:100dvh;overflow:hidden}
button,input,textarea{font:inherit}
button{cursor:pointer;color:inherit}
a{color:var(--blue)}
[hidden]{display:none!important}
.skip{position:fixed;z-index:999;left:12px;top:-80px;padding:11px 15px;border-radius:10px;background:#fff;color:#000;box-shadow:var(--shadow)}
.skip:focus{top:12px}

.site-bar{
  position:fixed;z-index:100;top:0;left:0;right:0;height:68px;
  display:flex;align-items:center;gap:11px;
  padding:8px max(14px,env(safe-area-inset-right)) 8px max(14px,env(safe-area-inset-left));
  background:rgba(250,253,254,.92);border-bottom:1px solid rgba(169,194,204,.78);
  backdrop-filter:blur(18px) saturate(1.15)
}
.anchor-brand{display:flex;align-items:center;min-width:0}
.anchor-brand img{display:block;width:auto;height:46px;max-width:150px;object-fit:contain}
.agent-id{display:flex;flex-direction:column;min-width:0}
.agent-id strong{font-size:.96rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.agent-id span{font-size:.69rem;color:var(--muted);letter-spacing:.035em;white-space:nowrap}
.connection{margin-left:auto;display:flex;align-items:center;gap:7px;font-size:.76rem;color:var(--muted);white-space:nowrap}
.connection i{width:9px;height:9px;border-radius:50%;background:#a9b8be;box-shadow:0 0 0 4px rgba(115,142,151,.09)}
.connection.online i{background:var(--teal);box-shadow:0 0 0 4px rgba(8,123,114,.12)}
.connection.error i{background:var(--danger)}
.site-actions{display:flex;gap:6px}
.round-action,.close-action{
  display:grid;place-items:center;border:1px solid rgba(168,193,203,.82);background:rgba(255,255,255,.82);color:var(--ink);
  box-shadow:0 5px 14px rgba(37,65,77,.06)
}
.round-action{width:48px;height:48px;border-radius:50%;font-size:.87rem}
.round-action[aria-pressed="true"],.round-action[aria-expanded="true"]{background:var(--blue-soft);border-color:#83b8d0;color:#074d75}
.close-action{width:42px;height:42px;border-radius:50%;font-size:1.4rem}

.dock{
  position:relative;height:100dvh;min-height:540px;overflow:hidden;padding-top:68px;
  background:linear-gradient(180deg,#dbeaf0 0%,#eff6f8 46%,#d8e5e9 100%);
  isolation:isolate
}
.world{
  --rx:0deg;--ry:0deg;
  position:absolute;z-index:2;top:68px;left:0;right:0;bottom:142px;overflow:hidden;
  perspective:1300px;transform-style:preserve-3d;
  transition:right .32s ease,filter .25s ease,opacity .25s ease
}
.dock.workbench-open .world{right:min(410px,35vw)}
.environment{position:absolute;inset:0;z-index:-3;overflow:hidden;pointer-events:none;background:radial-gradient(circle at 62% 31%,rgba(255,255,255,.92) 0 9%,rgba(255,255,255,.48) 24%,transparent 47%),linear-gradient(180deg,#dfeef3,#f5f9fa 60%,#d2e0e5)}
.glass-roof{position:absolute;left:13%;right:13%;top:-10%;height:32%;border-radius:0 0 50% 50%;border:2px solid rgba(112,149,164,.2);background:repeating-linear-gradient(90deg,transparent 0 13%,rgba(71,107,120,.08) 13% 13.5%,transparent 13.5% 26%);transform:perspective(900px) rotateX(63deg)}
.window-wall{position:absolute;left:3%;right:3%;top:5%;height:55%;display:grid;grid-template-columns:repeat(4,1fr);gap:6%;padding:0 2%}
.window-wall i{display:block;border:8px solid rgba(72,108,121,.17);border-bottom-width:15px;background:linear-gradient(180deg,rgba(203,232,243,.58),rgba(255,255,255,.15));box-shadow:inset 0 0 0 2px rgba(255,255,255,.42)}
.left-cabinet,.right-cabinet{position:absolute;top:12%;width:15%;height:50%;border:4px solid rgba(92,111,118,.22);border-radius:9px;background:rgba(255,255,255,.22);box-shadow:inset 0 0 0 8px rgba(255,255,255,.12)}
.left-cabinet{left:2.5%;transform:perspective(650px) rotateY(8deg)}
.right-cabinet{right:2.5%;transform:perspective(650px) rotateY(-8deg)}
.left-cabinet:before,.right-cabinet:before,.left-cabinet:after,.right-cabinet:after{content:"";position:absolute;left:8%;right:8%;height:4px;background:rgba(70,95,104,.17)}
.left-cabinet:before,.right-cabinet:before{top:33%}.left-cabinet:after,.right-cabinet:after{top:66%}
.left-cabinet b,.right-cabinet b{position:absolute;bottom:3%;width:14%;height:24%;border-radius:3px;background:linear-gradient(90deg,#496f80,#bcd2da)}
.left-cabinet b:nth-child(1){left:14%;height:30%}.left-cabinet b:nth-child(2){left:33%;background:linear-gradient(90deg,#77523d,#c79b75)}.left-cabinet b:nth-child(3){left:53%;height:28%}
.right-cabinet b:nth-child(1){right:13%;height:29%;background:linear-gradient(90deg,#8e6a3e,#d3b47d)}.right-cabinet b:nth-child(2){right:32%;height:22%}.right-cabinet b:nth-child(3){right:52%;height:33%;background:linear-gradient(90deg,#3e6e6a,#a7cfca)}
.brass-line{position:absolute;top:0;bottom:16%;width:8px;background:linear-gradient(90deg,#806326,#d7b561,#806326);opacity:.19;box-shadow:0 0 0 1px rgba(73,53,20,.08)}
.line-a{left:25%;transform:rotate(4deg)}.line-b{right:24%;transform:rotate(-4deg)}
.floor-plane{position:absolute;left:-8%;right:-8%;bottom:-27%;height:58%;transform-origin:center bottom;transform:perspective(800px) rotateX(68deg);border-radius:48% 48% 0 0;background:linear-gradient(180deg,rgba(91,121,132,.07),rgba(45,72,83,.16)),repeating-linear-gradient(90deg,rgba(52,79,91,.11) 0 2px,transparent 2px 78px);border-top:2px solid rgba(89,116,127,.13)}
.floor-plane span{position:absolute;inset:0;background:repeating-linear-gradient(0deg,rgba(52,79,91,.10) 0 2px,transparent 2px 58px);mask-image:linear-gradient(180deg,transparent,black 24%,black)}
.perch-rail{position:absolute;left:35%;right:24%;bottom:16%;height:10px;border-radius:10px;background:linear-gradient(180deg,#6b4b36,#a47d5e 45%,#5f4331);box-shadow:0 8px 14px rgba(46,62,67,.12)}
.tea-cup{position:absolute;left:61%;bottom:19%;width:36px;height:24px;border-radius:6px 6px 15px 15px;border:3px solid rgba(75,106,118,.38);background:rgba(255,255,255,.52);transform:rotate(-3deg)}
.tea-cup:after{content:"";position:absolute;right:-14px;top:4px;width:12px;height:11px;border:3px solid rgba(75,106,118,.38);border-left:0;border-radius:0 8px 8px 0}
.room-mark{position:absolute;left:50%;top:7%;transform:translateX(-50%);display:flex;flex-direction:column;align-items:center;color:rgba(22,54,69,.20);font-weight:800;letter-spacing:.16em}.room-mark span{font-size:clamp(1rem,1.7vw,1.65rem)}.room-mark small{font-size:.52rem;letter-spacing:.22em}
.world-name{position:absolute;left:18px;top:18px;z-index:5;display:flex;flex-direction:column;color:rgba(29,65,81,.55);pointer-events:none}.world-name span{font-size:.65rem;font-weight:850;letter-spacing:.17em}.world-name small{margin-top:3px;font-size:.58rem;letter-spacing:.08em;color:rgba(74,101,113,.52)}
.scene-note{position:absolute;left:50%;bottom:15px;transform:translateX(-50%);font-size:.6rem;color:rgba(60,84,95,.55);letter-spacing:.035em;white-space:nowrap}

.dialogue{
  position:absolute;z-index:30;left:5.2%;top:9%;width:min(43vw,570px);max-height:41%;overflow:auto;
  padding:16px 17px 15px;border:1px solid rgba(159,187,198,.86);border-radius:22px;
  background:rgba(252,254,255,.93);box-shadow:0 18px 44px rgba(38,67,80,.13);backdrop-filter:blur(16px);
  scrollbar-gutter:stable
}
.dialogue:after{content:"";position:absolute;right:-9px;top:58%;width:18px;height:18px;background:inherit;border-top:1px solid rgba(159,187,198,.86);border-right:1px solid rgba(159,187,198,.86);transform:rotate(45deg)}
.dialogue-head{display:flex;align-items:center;gap:9px;margin-bottom:9px}
.speaker-mark{width:32px;height:32px;border-radius:50%;display:grid;place-items:center;background:var(--teal-soft);border:1px solid #a9d6d1;color:#075f59;font-weight:900}
.dialogue-head div{display:flex;flex-direction:column}.dialogue-head strong{font-size:.77rem;letter-spacing:.025em}.dialogue-head small{font-size:.64rem;color:var(--teal);font-weight:750}
.answer-text{font-size:clamp(.9rem,1.15vw,1.02rem);line-height:1.56;white-space:pre-wrap;overflow-wrap:anywhere}
.answer-text strong{color:#0d405b}.answer-text a{overflow-wrap:anywhere}
.destination-card{margin-top:11px;padding:10px 12px;border:1px solid #b8d5df;border-radius:14px;background:#f0f8fb}
.destination-card strong{display:block;font-size:.8rem}.destination-card p{margin:3px 0 7px;font-size:.72rem;color:var(--muted);line-height:1.4}.destination-card a{display:inline-flex;min-height:34px;align-items:center;padding:5px 10px;border-radius:999px;background:var(--blue);color:#fff;text-decoration:none;font-size:.72rem;font-weight:750}
.source-chips{margin-top:10px;display:flex;gap:6px;flex-wrap:wrap}
.source-chips button{min-height:32px;padding:5px 9px;border:1px solid #c8d9df;border-radius:999px;background:#fff;color:#315d72;font-size:.69rem}

.avatar-zone{position:absolute;z-index:14;left:64%;bottom:0;width:min(42vw,520px);height:min(74vh,650px);transform:translateX(-50%);display:flex;flex-direction:column;align-items:center;justify-content:flex-end;pointer-events:none}
.avatar-rig{position:relative;display:block;width:100%;height:88%;min-height:300px;padding:0;border:0;background:transparent;appearance:none;transform-origin:50% 88%;filter:drop-shadow(0 24px 26px rgba(25,49,59,.18));transition:transform .28s ease,filter .22s ease;pointer-events:auto;cursor:pointer}
.avatar-rig:focus-visible{outline:3px solid #3f94be;outline-offset:4px;border-radius:36%}
.avatar-rig:hover:not(.webgl-ready){filter:drop-shadow(0 27px 29px rgba(25,49,59,.21))}
.avatar-rig.idle-nod:not(.webgl-ready){animation:kacklesIdleNod .85s ease-in-out both}
.avatar-rig.idle-tip:not(.webgl-ready){animation:kacklesIdleTip 1.05s ease-in-out both}
@keyframes kacklesIdleNod{0%,100%{transform:none}42%{transform:rotate(-.7deg) translateY(3px)}70%{transform:rotate(.35deg) translateY(-1px)}}
@keyframes kacklesIdleTip{0%,100%{transform:none}38%{transform:rotate(1.3deg) translateY(-2px)}68%{transform:rotate(-.4deg) translateY(1px)}}
.avatar-base,.avatar-mouth{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;object-position:center bottom;user-select:none;-webkit-user-drag:none}
.avatar-mouth{opacity:0;transform-origin:49% 31%}
.avatar-shadow{position:absolute;left:24%;right:20%;bottom:5%;height:6%;border-radius:50%;background:rgba(31,51,59,.18);filter:blur(13px)}
.kackles-canvas{position:absolute;z-index:5;inset:0;width:100%;height:100%;display:block;pointer-events:none;filter:drop-shadow(0 20px 20px rgba(12,31,40,.20))}
.avatar-rig.webgl-ready .avatar-base,.avatar-rig.webgl-ready .avatar-mouth{opacity:0}
.avatar-rig.webgl-ready{filter:none}
.voice-rings{position:absolute;right:3%;top:28%;width:86px;height:86px;opacity:0}.voice-rings i{position:absolute;inset:50%;border:2px solid rgba(8,106,168,.27);border-radius:50%}
.agent-plaque{pointer-events:auto;z-index:7;margin-top:-12px;display:flex;align-items:center;gap:7px;padding:7px 11px;border:1px solid rgba(173,196,205,.85);border-radius:999px;background:rgba(255,255,255,.86);backdrop-filter:blur(12px);font-size:.68rem;color:var(--muted);box-shadow:0 7px 18px rgba(38,62,72,.08)}
.agent-plaque i{width:7px;height:7px;border-radius:50%;background:var(--teal)}

.station-field{position:absolute;inset:0;z-index:19;pointer-events:none}
.station{position:absolute;width:122px;min-height:118px;border:0;background:transparent;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;gap:4px;pointer-events:auto;transition:transform .18s ease,filter .18s ease,opacity .18s ease}
.station:hover,.station:focus-visible{transform:translateY(-6px) scale(1.025);filter:drop-shadow(0 12px 16px rgba(35,62,72,.16));z-index:25}
.station:focus-visible{outline:3px solid #48a1ce;outline-offset:3px;border-radius:18px}
.station.active .station-copy{background:var(--teal-soft);border-color:#8bc8c1;color:#075c56}
.station-copy{display:flex;flex-direction:column;align-items:center;min-width:78px;padding:5px 8px;border:1px solid rgba(174,197,206,.86);border-radius:11px;background:rgba(255,255,255,.90);box-shadow:0 6px 15px rgba(41,64,74,.08)}
.station-copy b{font-size:.68rem}.station-copy small{font-size:.6rem;color:var(--muted)}
.station-art{position:relative;display:block;width:92px;height:82px}
.station-find{left:18%;bottom:5%}.station-understand{left:5%;top:27%}.station-support{right:4%;bottom:8%}.station-verify{right:5%;top:26%}
.chart-art{width:96px;height:55px;margin-bottom:9px;border:3px solid #4e6d7c;border-radius:7px;background:#f2ecd6;transform:perspective(260px) rotateX(55deg) rotateZ(-4deg);box-shadow:0 11px 0 #76543a,0 16px 17px rgba(38,59,67,.12)}
.chart-art i{position:absolute;border:2px solid rgba(57,105,108,.46);border-radius:50%}.chart-art i:nth-child(1){left:14px;top:13px;width:29px;height:19px}.chart-art i:nth-child(2){left:39px;top:17px;width:40px;height:20px;transform:rotate(-35deg)}.chart-art i:nth-child(3){left:47px;top:7px;width:2px;height:39px;border:0;background:rgba(123,86,46,.45)}
.library-art{display:flex;align-items:flex-end;justify-content:center;gap:4px;padding:5px 11px}.library-art i{width:17px;border:2px solid #456477;border-radius:4px 4px 2px 2px;background:linear-gradient(90deg,#4f7a8c,#c4dbe2)}.library-art i:nth-child(1){height:57px}.library-art i:nth-child(2){height:72px;background:linear-gradient(90deg,#7a573e,#d1aa85);transform:rotate(-4deg)}.library-art i:nth-child(3){height:64px;background:linear-gradient(90deg,#356d68,#a8d0ca);transform:rotate(3deg)}.library-art i:nth-child(4){height:48px;background:linear-gradient(90deg,#6e526a,#c7aec2)}
.lantern-art{width:58px;height:68px;margin:3px auto 6px;border:6px solid #6b5139;border-radius:13px 13px 18px 18px;background:radial-gradient(circle,#fffad3 0 12%,#f7d56c 22%,#b67c2b 58%,#7a542b 100%);box-shadow:0 0 22px rgba(224,177,72,.38)}.lantern-art:before{content:"";position:absolute;left:13px;right:13px;top:-18px;height:20px;border:5px solid #6b5139;border-bottom:0;border-radius:12px 12px 0 0}.lantern-art i{position:absolute;left:-10px;right:-10px;bottom:-11px;height:9px;border-radius:8px;background:#684b33}
.ledger-art{width:74px;height:70px;margin:3px auto 5px;border:3px solid #4a6571;border-radius:6px;background:linear-gradient(90deg,#e8dfc8,#faf7ec 12%,#f2ead5 88%,#d9ceb1);box-shadow:8px 7px 0 #7b5d45}.ledger-art:before{content:"SOURCE";position:absolute;left:11px;top:11px;font-size:.48rem;font-weight:900;letter-spacing:.11em;color:#426472}.ledger-art i{position:absolute;left:12px;right:9px;height:2px;background:#77909a}.ledger-art i:nth-child(1){top:31px}.ledger-art i:nth-child(2){top:40px}.ledger-art i:nth-child(3){top:49px}

.conversation-console{position:absolute;z-index:45;left:50%;bottom:max(6px,env(safe-area-inset-bottom));width:min(790px,calc(100% - 22px));transform:translateX(-50%);display:flex;flex-direction:column;gap:6px}
.compass-bar{align-self:center;display:flex;gap:5px;padding:4px;border:1px solid rgba(166,190,200,.84);border-radius:999px;background:rgba(250,253,254,.88);backdrop-filter:blur(14px);box-shadow:0 8px 20px rgba(37,62,73,.08)}
.compass-bar button{min-height:34px;padding:5px 10px;border:0;border-radius:999px;background:transparent;font-size:.68rem;font-weight:720;color:#446574;display:flex;align-items:center;gap:5px}
.compass-bar button.active{background:#19394e;color:#fff}
.compass-bar button span{font-size:.8rem}
.last-user{align-self:flex-end;max-width:70%;padding:5px 9px;border-radius:12px 12px 3px 12px;background:rgba(24,50,75,.9);color:#fff;font-size:.67rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.suggestions{display:flex;justify-content:center;gap:6px;min-height:30px;overflow:hidden}
.suggestions button{min-height:30px;padding:4px 9px;border:1px solid rgba(174,198,208,.85);border-radius:999px;background:rgba(255,255,255,.89);color:#31566a;font-size:.68rem;white-space:nowrap;max-width:31%;overflow:hidden;text-overflow:ellipsis}
.composer{display:grid;grid-template-columns:50px minmax(0,1fr) 50px;gap:5px;align-items:end;padding:6px;border:1px solid rgba(161,188,199,.86);border-radius:22px;background:rgba(253,254,255,.95);box-shadow:0 14px 34px rgba(34,58,69,.14);backdrop-filter:blur(16px)}
.composer textarea{display:block;width:100%;min-height:46px;max-height:120px;resize:none;border:0;outline:0;background:transparent;color:var(--ink);padding:11px 8px 8px;line-height:1.35;overflow:auto}
.composer textarea::placeholder{color:#7b909a}
.composer-button,.send-button{width:48px;height:48px;border:0;border-radius:50%;display:grid;place-items:center}
.composer-button{background:#eef5f7;color:#254c5f}.send-button{background:var(--blue);color:#fff;font-size:1.35rem;font-weight:800}
.composer-button:disabled,.send-button:disabled{opacity:.48;cursor:default}
.console-foot{display:flex;justify-content:space-between;align-items:center;padding:0 7px;font-size:.59rem;color:#6f8792}.console-foot button{border:0;background:transparent;color:#4c7183;padding:2px 4px}

.workbench{position:absolute;z-index:55;top:80px;right:12px;bottom:146px;width:min(385px,33vw);overflow:hidden;border:1px solid rgba(156,184,195,.9);border-radius:22px;background:rgba(251,253,254,.96);box-shadow:0 22px 50px rgba(29,55,67,.18);backdrop-filter:blur(18px);display:flex;flex-direction:column}
.workbench-head{display:flex;justify-content:space-between;align-items:center;padding:13px 14px 10px;border-bottom:1px solid #d3e0e5}.workbench-head small{display:block;color:var(--teal);font-size:.62rem;font-weight:800;letter-spacing:.08em;text-transform:uppercase}.workbench-head h2{margin:2px 0 0;font-size:1rem}
.workbench-tabs{display:flex;gap:3px;padding:7px 8px;border-bottom:1px solid #dce6ea;overflow-x:auto}.workbench-tabs button{flex:0 0 auto;min-height:32px;padding:4px 8px;border:0;border-radius:999px;background:transparent;font-size:.67rem;color:#516e7b}.workbench-tabs button.active{background:var(--teal-soft);color:#075d57;font-weight:760}
.workbench-body{flex:1;overflow:auto;padding:13px 13px 30px}
.workbench-body>p:first-child{margin-top:0}
.search-line{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:6px}.search-line input{width:100%;min-width:0;border:1px solid #b9cdd6;border-radius:12px;padding:9px 10px;background:#fff;color:var(--ink)}.search-line button,.result-actions button,.result-actions a,.workbench-body>button{border:1px solid #a9c4cf;border-radius:11px;background:#f5fafb;color:#214e64;padding:7px 10px;text-decoration:none;font-size:.72rem}
.search-hints{display:flex;flex-wrap:wrap;gap:5px;margin:9px 0}.search-hints button{border:1px solid #cfdee4;border-radius:999px;background:#fff;padding:5px 8px;font-size:.65rem;color:#496b79}
.result,.source-card,.memory-note{padding:11px 0;border-bottom:1px solid #dbe5e9}.result h3,.source-card h3{margin:0 0 3px;font-size:.8rem}.result small,.source-card small{color:var(--muted);font-size:.63rem}.result p,.source-card p,.memory-note{font-size:.72rem;line-height:1.48;color:#385868}.result-actions{display:flex;gap:6px;flex-wrap:wrap;margin-top:7px}.result-actions a{display:inline-flex;align-items:center}
.transcript{display:flex;flex-direction:column;gap:12px}.turn{max-width:94%;line-height:1.5;font-size:.75rem}.turn.user{align-self:flex-end;padding:9px 10px;border-radius:14px 14px 4px 14px;background:#19394e;color:#fff}.turn.assistant{align-self:flex-start}.turn.assistant .speaker{display:block;margin-bottom:3px;color:var(--teal);font-size:.61rem;font-weight:850;letter-spacing:.07em;text-transform:uppercase}.turn.system{align-self:stretch;padding:9px 10px;border:1px solid #d7e3e7;border-radius:12px;background:#f0f5f7;color:#526f7c}.turn.error{border-color:#e3bbb5;background:#fff3f1;color:#7f352f}
.access-row{display:flex;align-items:center;justify-content:space-between;gap:15px;padding:10px 0;border-bottom:1px solid #dfe8eb;font-size:.73rem}.switch{display:flex;align-items:center;justify-content:flex-start;width:48px;height:28px;padding:2px;border:0;border-radius:999px;background:#b5c4ca}.switch[aria-pressed="true"]{justify-content:flex-end;background:var(--teal)}.switch:after{content:"";width:24px;height:24px;border-radius:50%;background:#fff;box-shadow:0 1px 5px rgba(0,0,0,.18)}
.inline-error{padding:9px 10px;border:1px solid #ddafa9;border-radius:10px;background:#fff5f3;color:#7d302a;font-size:.72rem}

/* The Vivarium responds to the task without changing the page structure. */
.environment{transition:background .55s ease,transform .25s ease,filter .35s ease}
body[data-guide-mode="find"] .environment{background:radial-gradient(circle at 25% 70%,rgba(102,180,213,.17),transparent 24%),radial-gradient(circle at 62% 31%,rgba(255,255,255,.92) 0 9%,rgba(255,255,255,.48) 24%,transparent 47%),linear-gradient(180deg,#dfeef3,#f5f9fa 60%,#d2e0e5)}
body[data-guide-mode="understand"] .environment{background:radial-gradient(circle at 12% 35%,rgba(87,164,154,.13),transparent 23%),radial-gradient(circle at 62% 31%,rgba(255,255,255,.92) 0 9%,rgba(255,255,255,.48) 24%,transparent 47%),linear-gradient(180deg,#dfeef3,#f5f9fa 60%,#d2e0e5)}
body[data-guide-mode="support"] .environment{background:radial-gradient(circle at 88% 72%,rgba(214,179,99,.18),transparent 24%),radial-gradient(circle at 62% 31%,rgba(255,255,255,.92) 0 9%,rgba(255,255,255,.48) 24%,transparent 47%),linear-gradient(180deg,#e5eff2,#f8faf9 60%,#d8e4e7)}
body[data-guide-mode="verify"] .environment{background:radial-gradient(circle at 88% 32%,rgba(51,112,139,.15),transparent 22%),radial-gradient(circle at 62% 31%,rgba(255,255,255,.92) 0 9%,rgba(255,255,255,.48) 24%,transparent 47%),linear-gradient(180deg,#dcebf1,#f4f8f9 60%,#d1e0e5)}
.station.mode-flash .station-art{animation:stationArrive .72s cubic-bezier(.2,.8,.2,1) both}
.station.mode-flash .station-copy{animation:stationLabel .72s ease both}
body[data-guide-mode="support"] .station-support .lantern-art{filter:drop-shadow(0 0 9px rgba(214,179,99,.38))}
body[data-guide-mode="verify"] .station-verify .ledger-art{filter:drop-shadow(0 5px 7px rgba(44,91,112,.18))}
body[data-guide-mode="understand"] .station-understand .library-art{filter:drop-shadow(0 5px 7px rgba(30,104,98,.16))}
body[data-guide-mode="find"] .station-find .chart-art{filter:drop-shadow(0 5px 7px rgba(8,106,168,.16))}
.avatar-rig:not(.webgl-ready){animation:kacklesSettle 1.05s cubic-bezier(.2,.8,.25,1) both}
body[data-agent-state="idle"] .avatar-rig:not(.webgl-ready){animation:kacklesSettle 1.05s cubic-bezier(.2,.8,.25,1) both}
body[data-agent-state="thinking"] .avatar-rig:not(.webgl-ready){animation:kacklesThink 1.35s ease-in-out infinite alternate}
body[data-agent-state="searching"] .avatar-rig:not(.webgl-ready){animation:kacklesSearch .9s ease-in-out infinite alternate}
body[data-agent-state="listening"] .avatar-rig:not(.webgl-ready){animation:kacklesListen .8s ease-out both}
@keyframes stationArrive{0%{transform:translateY(2px) scale(.94);opacity:.72}55%{transform:translateY(-7px) scale(1.055)}100%{transform:none;opacity:1}}
@keyframes stationLabel{0%{box-shadow:0 0 0 rgba(8,123,114,0)}45%{box-shadow:0 0 0 7px rgba(8,123,114,.09)}100%{box-shadow:0 6px 15px rgba(41,64,74,.08)}}
@keyframes kacklesSettle{0%{transform:translateY(8px) scale(.985);filter:brightness(.98)}65%{transform:translateY(-2px) scale(1.003)}100%{transform:none;filter:none}}
@keyframes kacklesThink{0%{transform:rotate(-1.1deg) translateY(1px)}100%{transform:rotate(-2.1deg) translateY(-2px)}}
@keyframes kacklesSearch{0%{transform:rotate(.7deg) translateX(-2px)}100%{transform:rotate(1.8deg) translateX(5px)}}
@keyframes kacklesListen{0%{transform:rotate(0) translateY(0) scale(1)}100%{transform:rotate(-1.8deg) translateY(-4px) scale(1.012)}}

body[data-agent-state="speaking"] .avatar-rig:not(.webgl-ready){animation:kacklesSpeakBody 2s ease-in-out infinite}
body[data-agent-state="speaking"] .avatar-mouth{opacity:1;animation:kacklesMouth .22s steps(2,end) infinite}
body[data-agent-state="speaking"] .voice-rings{opacity:1}
body[data-agent-state="speaking"] .voice-rings i{animation:ring 1.65s ease-out infinite}
body[data-agent-state="speaking"] .voice-rings i:nth-child(2){animation-delay:.36s}body[data-agent-state="speaking"] .voice-rings i:nth-child(3){animation-delay:.72s}
body[data-guide-mode="find"] .station-find .station-copy,body[data-guide-mode="understand"] .station-understand .station-copy,body[data-guide-mode="support"] .station-support .station-copy,body[data-guide-mode="verify"] .station-verify .station-copy{background:var(--teal-soft);border-color:#85c4bd;color:#075d57}
@keyframes kacklesSpeakBody{0%,100%{transform:rotate(0) translateY(0)}40%{transform:rotate(-.5deg) translateY(-2px)}75%{transform:rotate(.45deg) translateY(1px)}}
@keyframes kacklesMouth{0%,100%{transform:translateY(0)}50%{transform:translateY(4px) rotate(.7deg)}}
@keyframes ring{0%{inset:50%;opacity:.46}100%{inset:-18%;opacity:0}}

body.large-text{font-size:20px}.large-text .answer-text{font-size:1.05rem}
body.extra-space{line-height:1.8;letter-spacing:.02em}
body.high-contrast{--ink:#000;--ink-2:#111;--muted:#222;--blue:#004d85;--teal:#005f59;--line:#76858c}.high-contrast .environment{filter:contrast(1.15)}
.reading-ruler:after{content:"";position:fixed;pointer-events:none;z-index:999;left:0;right:0;top:var(--ruler-y,50%);height:34px;border-top:2px solid rgba(0,80,130,.38);border-bottom:2px solid rgba(0,80,130,.38);background:rgba(0,80,130,.05)}
body.low-overwhelm .glass-roof,body.low-overwhelm .window-wall,body.low-overwhelm .brass-line,body.low-overwhelm .floor-plane span,body.low-overwhelm .tea-cup,body.low-overwhelm .scene-note{display:none}
body.low-overwhelm .environment{background:#f5f9fa}.low-overwhelm .station{opacity:.55}.low-overwhelm .station:focus,.low-overwhelm .station:hover{opacity:1}.low-overwhelm .kackles-canvas{filter:none}

@media(max-width:1100px){
  .dialogue{left:3%;width:min(45vw,510px)}
  .avatar-zone{left:65%;width:min(43vw,480px)}
  .station-find{left:13%}.station-understand{left:2%}.station-support{right:1%}.station-verify{right:2%}
  .dock.workbench-open .world{right:min(370px,38vw)}
  .workbench{width:min(360px,37vw)}
}
@media(max-width:860px){
  .world{bottom:151px}
  .dock.workbench-open .world{right:0;filter:blur(1px);opacity:.35;pointer-events:none}
  .workbench{left:50%;right:auto;top:80px;bottom:154px;width:min(620px,calc(100% - 22px));transform:translateX(-50%)}
  .dialogue{left:50%;top:3%;width:min(88vw,620px);max-height:31%;transform:translateX(-50%)}.dialogue:after{display:none}
  .avatar-zone{left:50%;bottom:-1%;width:min(56vw,500px);height:64vh}
  .station{width:95px;min-height:95px}.station-art{transform:scale(.78)}.station-find{left:12%;bottom:3%}.station-understand{left:2%;top:35%}.station-support{right:2%;bottom:5%}.station-verify{right:2%;top:35%}
  .world-name{display:none}.scene-note{display:none}
}
@media(max-width:680px){
  .site-bar{height:60px;padding-top:max(5px,env(safe-area-inset-top));gap:7px}.anchor-brand img{height:39px;max-width:105px}.agent-id strong{font-size:.82rem}.agent-id span,.connection span{display:none}.round-action{width:44px;height:44px}.connection{margin-left:auto}
  .dock{padding-top:60px}.world{top:60px;bottom:168px}.workbench{top:67px;bottom:173px;border-radius:16px;width:calc(100% - 14px)}
  .workbench-tabs{gap:2px}.workbench-tabs button{padding:4px 7px;font-size:.63rem}
  .dialogue{top:6px;width:calc(100% - 16px);max-height:28%;padding:11px 12px;border-radius:16px}.dialogue-head{margin-bottom:6px}.answer-text{font-size:.84rem;line-height:1.48}
  .avatar-zone{width:min(76vw,430px);height:57vh;bottom:2%}.avatar-rig{min-height:240px;height:86%}.agent-plaque{font-size:.62rem}
  .station{width:72px;min-height:75px}.station-art{width:66px;height:58px;transform:scale(.65);transform-origin:center bottom}.station-copy{min-width:64px;padding:4px 6px}.station-copy b{font-size:.6rem}.station-copy small{font-size:.53rem}
  .station-understand{left:0;top:37%}.station-verify{right:0;top:37%}.station-find{left:6%;bottom:7%}.station-support{right:6%;bottom:7%}
  .conversation-console{width:calc(100% - 12px);bottom:max(5px,env(safe-area-inset-bottom));gap:4px}.compass-bar{width:100%;justify-content:space-between;border-radius:16px}.compass-bar button{flex:1;justify-content:center;min-width:0;padding:5px 4px;font-size:.62rem}.suggestions{justify-content:flex-start;overflow:hidden}.suggestions button{max-width:none;flex:0 0 auto;font-size:.62rem}.composer{grid-template-columns:44px minmax(0,1fr) 44px;border-radius:18px}.composer-button,.send-button{width:44px;height:44px}.composer textarea{min-height:42px;padding-top:9px}.console-foot span{display:none}.console-foot{justify-content:flex-end}
}
@media(max-width:430px){
  .anchor-brand img{max-width:78px}.agent-id{max-width:95px}.agent-id strong{font-size:.72rem}.connection{display:none}.site-actions{margin-left:auto}
  .dialogue{max-height:26%;}.dialogue-head .speaker-mark{width:27px;height:27px}.dialogue-head strong{font-size:.7rem}
  .avatar-zone{width:87vw;height:54vh}.station-understand,.station-verify{top:41%}.station-find,.station-support{bottom:9%}.station-copy small{display:none}
  .suggestions{display:none}.compass-bar button span{display:none}.console-foot{display:none}
  .world{bottom:133px}.workbench{bottom:139px}
}
@media(max-height:650px) and (min-width:681px){
  .site-bar{height:56px}.anchor-brand img{height:36px}.world{top:56px;bottom:112px}.workbench{top:64px;bottom:118px}.avatar-zone{height:62vh;width:min(38vw,410px)}.dialogue{top:2%;max-height:31%;padding:10px 12px}.station{transform:scale(.78)}.conversation-console{gap:3px}.suggestions{display:none}.console-foot{display:none}.composer textarea{min-height:40px}.compass-bar button{min-height:30px}
}
@media(max-width:680px) and (orientation:landscape){
  .site-bar{height:52px}.anchor-brand img{height:32px}.world{top:52px;bottom:82px}.dialogue{left:2%;top:5%;transform:none;width:51%;max-height:58%}.avatar-zone{left:73%;width:35vw;height:72vh}.station{display:none}.conversation-console{left:2%;bottom:4px;width:55%;transform:none}.compass-bar,.suggestions,.console-foot{display:none}.composer textarea{min-height:38px}.workbench{top:58px;bottom:88px}
}
@media(prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important;scroll-behavior:auto!important}.kackles-canvas{filter:none}.avatar-mouth,.voice-rings{display:none!important}}

.dialogue{--dialogue-w:min(43vw,570px);--dialogue-h:41%;width:var(--dialogue-w);max-height:var(--dialogue-h);min-width:300px;min-height:142px;transform-origin:left top;transition:width .2s ease,max-height .2s ease,box-shadow .2s ease}
.dialogue.dialogue-compact{--dialogue-w:min(36vw,470px);--dialogue-h:31%}
.dialogue.dialogue-expanded{--dialogue-w:min(56vw,760px);--dialogue-h:58%}
.dialogue.dialogue-custom{transition:box-shadow .2s ease}
.dialogue.is-resizing{box-shadow:0 20px 52px rgba(38,67,80,.18),0 0 0 2px rgba(8,123,114,.12)}
.dialogue-head{position:sticky;top:-16px;z-index:2;margin:-1px -1px 9px;padding:1px 1px 7px;background:linear-gradient(180deg,rgba(252,254,255,.98) 0%,rgba(252,254,255,.92) 74%,rgba(252,254,255,0) 100%)}
.dialogue-identity{min-width:0;flex:1}
.dialogue-tools{margin-left:auto;display:flex;align-items:center;gap:4px}
.dialogue-tools button{display:grid;place-items:center;width:31px;height:31px;border:1px solid rgba(174,197,206,.9);border-radius:50%;background:rgba(255,255,255,.85);color:#3c6274;font-size:.82rem;box-shadow:0 3px 9px rgba(35,59,70,.06)}
.dialogue-tools button:hover{background:#f2f8fa;border-color:#9fc6d4}
.dialogue-resizer{position:absolute;z-index:4;right:5px;bottom:5px;width:18px;height:18px;cursor:nwse-resize;opacity:.52;touch-action:none}
.dialogue-resizer:before,.dialogue-resizer:after{content:"";position:absolute;right:1px;bottom:1px;border-right:2px solid #6e929f;border-bottom:2px solid #6e929f;border-radius:1px}
.dialogue-resizer:before{width:13px;height:13px}.dialogue-resizer:after{width:7px;height:7px}
.dialogue-resizer:focus-visible{outline:2px solid #3f94be;outline-offset:2px;border-radius:4px;opacity:1}
.kackles-aside{position:absolute;z-index:16;right:3%;bottom:13%;max-width:210px;padding:8px 10px;border:1px solid rgba(163,188,198,.88);border-radius:14px 14px 4px 14px;background:rgba(253,254,255,.94);box-shadow:0 10px 25px rgba(34,57,67,.12);backdrop-filter:blur(12px);font-size:.68rem;line-height:1.42;color:#365667;pointer-events:none;animation:kacklesAsideIn .24s ease-out both}
.kackles-aside:after{content:"";position:absolute;right:-6px;bottom:7px;width:12px;height:12px;background:inherit;border-top:1px solid rgba(163,188,198,.88);border-right:1px solid rgba(163,188,198,.88);transform:rotate(45deg)}
@keyframes kacklesAsideIn{from{opacity:0;transform:translateY(5px) scale(.98)}to{opacity:1;transform:none}}
.kackles-canvas{filter:drop-shadow(0 25px 24px rgba(11,28,36,.23)) saturate(1.04);transition:filter .3s ease}
.avatar-rig.webgl-ready:hover .kackles-canvas{filter:drop-shadow(0 27px 25px rgba(11,28,36,.25)) saturate(1.07)}
.avatar-shadow{background:radial-gradient(ellipse,rgba(27,45,53,.24),rgba(27,45,53,.08) 54%,transparent 72%);filter:blur(10px);height:8%;bottom:3%}
.agent-plaque{box-shadow:0 8px 19px rgba(38,62,72,.09),inset 0 1px 0 rgba(255,255,255,.7)}

@media(max-width:1100px){
  .dialogue{--dialogue-w:min(45vw,510px)}
  .dialogue.dialogue-compact{--dialogue-w:min(39vw,440px)}
  .dialogue.dialogue-expanded{--dialogue-w:min(58vw,680px)}
}
@media(max-width:860px){
  .dialogue,.dialogue.dialogue-compact,.dialogue.dialogue-expanded{--dialogue-w:min(88vw,620px);min-width:0}
  .dialogue.dialogue-compact{--dialogue-h:22%}.dialogue.dialogue-expanded{--dialogue-h:44%}
  .dialogue-resizer{cursor:ns-resize}
  .kackles-aside{right:7%;bottom:12%;max-width:180px}
}
@media(max-width:680px){
  .dialogue,.dialogue.dialogue-compact,.dialogue.dialogue-expanded{--dialogue-w:calc(100% - 16px)}
  .dialogue{--dialogue-h:28%}.dialogue.dialogue-compact{--dialogue-h:20%}.dialogue.dialogue-expanded{--dialogue-h:42%}
  .dialogue-head{top:-11px;margin:-1px -1px 6px;padding-bottom:5px}
  .dialogue-tools button{width:28px;height:28px}
  .dialogue-resizer{right:4px;bottom:4px}
  .kackles-aside{right:4%;bottom:15%;max-width:158px;font-size:.62rem;padding:7px 8px}
}
@media(max-width:430px){
  .dialogue{--dialogue-h:26%}.dialogue.dialogue-compact{--dialogue-h:18%}.dialogue.dialogue-expanded{--dialogue-h:39%}
  .kackles-aside{bottom:17%;max-width:145px}
}
@media(max-width:680px) and (orientation:landscape){
  .dialogue,.dialogue.dialogue-compact,.dialogue.dialogue-expanded{--dialogue-w:51%;--dialogue-h:58%}
  .dialogue.dialogue-compact{--dialogue-h:42%}.dialogue.dialogue-expanded{--dialogue-h:72%}
}
body.reduce-motion .kackles-aside,body.low-overwhelm .kackles-aside{display:none!important}
@media(prefers-reduced-motion:reduce){.kackles-aside{display:none!important}}

.avatar-rig.webgl-ready{cursor:grab;touch-action:pan-y}.avatar-rig.webgl-ready:active{cursor:grabbing}


/* Clean Kackles interaction layout: the room is scenery; Kackles and conversation are the interface. */
.dock{
  display:grid;
  grid-template-rows:minmax(0,1fr) auto;
  padding-top:68px;
}
.world{
  position:relative;
  z-index:2;
  top:auto;left:auto;right:auto;bottom:auto;
  grid-row:1;
  min-height:0;
  width:100%;
  overflow:hidden;
  transition:filter .25s ease,opacity .25s ease;
}
.dock.workbench-open .world{right:auto}
.station-field,.compass-bar{display:none!important}
.avatar-zone{
  left:50%;
  width:min(48vw,560px);
  height:min(76vh,660px);
}
.conversation-console{
  position:relative;
  z-index:45;
  left:auto;bottom:auto;
  grid-row:2;
  transform:none;
  width:min(900px,calc(100% - 24px));
  margin:0 auto max(8px,env(safe-area-inset-bottom));
  padding-top:4px;
  gap:5px;
}
.dialogue,
.dialogue.dialogue-compact,
.dialogue.dialogue-expanded,
.dialogue.dialogue-custom{
  position:relative;
  left:auto;top:auto;
  width:100%!important;
  min-width:0;
  min-height:0;
  max-height:22vh;
  padding:11px 14px 12px;
  border-radius:18px 18px 12px 12px;
  overflow:auto;
  box-shadow:0 10px 24px rgba(38,67,80,.10);
  background:rgba(252,254,255,.96);
}
.dialogue.dialogue-compact{max-height:12vh}
.dialogue.dialogue-expanded{max-height:38vh}
.dialogue.dialogue-custom{max-height:none}
.dialogue:after{display:none}
.dialogue-head{position:sticky;top:-11px;margin:-1px -1px 6px;padding:1px 1px 6px}
.dialogue-resizer{right:6px;bottom:5px;cursor:ns-resize}
.suggestions{display:none!important}
.last-user{display:none!important}
.composer{box-shadow:0 9px 22px rgba(34,58,69,.11)}
.console-foot{padding:0 9px 1px}
.avatar-hint{
  position:absolute;z-index:17;left:50%;bottom:12%;transform:translateX(-50%);
  padding:7px 10px;border:1px solid rgba(163,188,198,.78);border-radius:999px;
  background:rgba(253,254,255,.90);backdrop-filter:blur(10px);
  color:#4a6978;font-size:.64rem;white-space:nowrap;pointer-events:none;
  animation:kacklesAsideIn .22s ease-out both;
}
.avatar-rig{touch-action:manipulation}
.avatar-rig.is-attentive{filter:drop-shadow(0 27px 28px rgba(25,49,59,.21))}
.world-name{opacity:.78}

@media(max-width:860px){
  .avatar-zone{left:50%;width:min(62vw,500px);height:min(68vh,560px)}
  .dialogue,.dialogue.dialogue-compact,.dialogue.dialogue-expanded,.dialogue.dialogue-custom{width:100%!important;max-height:20vh}
  .dialogue.dialogue-compact{max-height:10vh}.dialogue.dialogue-expanded{max-height:34vh}
  .workbench{top:76px;right:8px;bottom:8px;width:min(430px,calc(100% - 16px))}
}
@media(max-width:680px){
  .site-bar{height:62px}
  .dock{padding-top:62px;min-height:0}
  .avatar-zone{width:min(82vw,470px);height:min(58vh,500px)}
  .world-name{left:10px;top:10px}
  .conversation-console{width:calc(100% - 12px);margin-bottom:max(5px,env(safe-area-inset-bottom));gap:4px}
  .dialogue,.dialogue.dialogue-compact,.dialogue.dialogue-expanded,.dialogue.dialogue-custom{max-height:18vh;padding:9px 11px 10px;border-radius:15px 15px 10px 10px}
  .dialogue.dialogue-compact{max-height:9vh}.dialogue.dialogue-expanded{max-height:31vh}
  .dialogue-head{top:-9px}
  .console-foot span{display:none}
  .console-foot{justify-content:flex-end}
  .agent-plaque{margin-top:-8px}
  .avatar-hint{bottom:14%;font-size:.61rem}
}
@media(max-width:430px){
  .avatar-zone{width:min(88vw,430px);height:min(54vh,460px)}
  .dialogue,.dialogue.dialogue-compact,.dialogue.dialogue-expanded,.dialogue.dialogue-custom{max-height:16vh}
  .dialogue.dialogue-expanded{max-height:28vh}
  .composer{grid-template-columns:44px minmax(0,1fr) 44px;padding:5px}
  .composer-button,.send-button{width:42px;height:42px}
}
@media(max-height:650px) and (min-width:681px){
  .avatar-zone{height:min(60vh,470px)}
  .dialogue{max-height:17vh}.dialogue.dialogue-expanded{max-height:30vh}
}
.access-group{margin:14px 0 18px;padding-top:10px;border-top:1px solid rgba(31,74,82,.14)}
.access-group h3{margin:0 0 10px;font-size:1rem}
.access-field{display:grid;grid-template-columns:minmax(120px,1fr) minmax(130px,1.3fr);align-items:center;gap:12px;margin:9px 0}
.access-field select,.access-field input[type="range"]{width:100%}
.access-field select{min-height:38px;border:1px solid rgba(31,74,82,.2);border-radius:10px;background:#fff;padding:6px 8px}
.access-group>button{margin-top:8px}
@media(max-width:620px){.access-field{grid-template-columns:1fr}.access-group{margin-top:10px}}

.search-filters,.search-hints{display:flex;flex-wrap:wrap;gap:7px;margin:10px 0}.search-filters button,.search-hints button{min-height:44px;border:1px solid var(--line);border-radius:999px;background:#fff;padding:8px 12px}.search-filters button.active{background:var(--blue-soft);border-color:#83b8d0;color:#074d75;font-weight:750}.dialogue-tools{display:flex;gap:5px}.dialogue-tools button{min-width:44px;min-height:44px;border:1px solid var(--line);border-radius:50%;background:#fff}.saved-card p{white-space:pre-wrap;max-height:16em;overflow:auto}.result-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:10px}.result-actions button,.result-actions a{min-height:42px;display:inline-flex;align-items:center;border:1px solid var(--line);border-radius:10px;background:#fff;padding:8px 10px;text-decoration:none}.workbench-tabs{overflow-x:auto;scrollbar-width:thin}.workbench-tabs button{min-height:44px;white-space:nowrap}
