:root{
  --k-vh:100dvh;
  --k-vw:100vw;
  --k-header-h:68px;
  --k-console-max:clamp(150px,27svh,310px);
  --k-edge:max(6px,env(safe-area-inset-left));
}
html{width:100%;height:100%;max-width:100%;overflow:hidden}
body{width:100%;height:var(--k-vh);min-height:0;max-width:100%;overflow:hidden;overscroll-behavior:none}
.dock{
  width:100%;height:var(--k-vh);min-height:0!important;max-height:var(--k-vh);
  padding-top:var(--k-header-h);overflow:hidden;
  display:grid;grid-template-rows:minmax(0,1fr) auto;
}
.site-bar{height:var(--k-header-h)}
.world{
  position:relative;inset:auto!important;grid-row:1;min-width:0;min-height:0;
  width:100%;height:100%;overflow:hidden;
}
.conversation-console{
  position:relative!important;inset:auto!important;grid-row:2;
  transform:none!important;left:auto!important;right:auto!important;bottom:auto!important;
  width:min(900px,calc(100% - 24px));max-width:calc(100% - 12px);min-width:0;
  margin:0 auto max(6px,env(safe-area-inset-bottom));
  max-height:none;overflow:visible;
}
.dialogue,
.dialogue.dialogue-compact,
.dialogue.dialogue-expanded,
.dialogue.dialogue-custom{
  position:relative!important;inset:auto!important;transform:none!important;
  width:100%!important;min-width:0!important;max-width:100%!important;
  max-height:clamp(78px,18svh,205px);min-height:0;
}
.dialogue.dialogue-compact{max-height:clamp(62px,11svh,125px)}
.dialogue.dialogue-expanded{max-height:min(36svh,390px)}
.dialogue.dialogue-custom{max-height:min(var(--dialogue-custom-h,34svh),42svh)}
body.large-text .dialogue.dialogue-expanded,body.large-text .dialogue.dialogue-custom{max-height:min(38svh,420px)}
.avatar-zone{
  left:50%!important;bottom:0!important;transform:translateX(-50%)!important;
  width:clamp(250px,min(44vw,58svh),560px)!important;
  height:min(100%,670px)!important;max-height:100%;
}
.avatar-rig{min-height:0!important;height:min(88%,620px)!important}
.workbench{
  max-width:calc(100% - 16px);max-height:calc(var(--k-vh) - var(--k-header-h) - 16px);
}
.dock.workbench-open .world{right:auto!important}

@media(max-width:1024px){
  :root{--k-console-max:clamp(145px,29svh,300px)}
  .avatar-zone{width:clamp(245px,min(54vw,57svh),520px)!important}
  .conversation-console{width:min(860px,calc(100% - 18px))}
  .workbench{top:calc(var(--k-header-h) + 8px);right:8px;bottom:auto;width:min(430px,calc(100% - 16px))}
}
@media(max-width:680px){
  :root{--k-header-h:62px;--k-console-max:clamp(142px,34svh,285px)}
  .site-bar{height:var(--k-header-h)}
  .dock{padding-top:var(--k-header-h)}
  .avatar-zone{width:clamp(225px,min(82vw,53svh),455px)!important}
  .conversation-console{width:calc(100% - 12px);max-width:calc(100% - 12px)}
  .dialogue,
  .dialogue.dialogue-compact,
  .dialogue.dialogue-expanded,
  .dialogue.dialogue-custom{max-height:clamp(72px,16svh,165px)}
  .dialogue.dialogue-compact{max-height:clamp(58px,10svh,105px)}
  .dialogue.dialogue-expanded{max-height:min(31svh,270px)}
  .dialogue.dialogue-custom{max-height:min(var(--dialogue-custom-h,29svh),34svh)}
  .workbench{top:calc(var(--k-header-h) + 5px);left:7px;right:7px;bottom:max(7px,env(safe-area-inset-bottom));width:auto;max-height:calc(var(--k-vh) - var(--k-header-h) - 12px);transform:none}
}
@media(max-width:430px){
  .anchor-brand img{max-width:82px}
  .agent-id{max-width:min(38vw,145px)}
  .avatar-zone{width:min(88vw,430px)!important}
  .composer{grid-template-columns:42px minmax(0,1fr) 42px}
  .composer-button,.send-button{width:40px;height:40px;min-width:40px}
}
@media(max-height:560px) and (orientation:landscape){
  :root{--k-header-h:52px;--k-console-max:min(42svh,205px)}
  .site-bar{height:var(--k-header-h)}
  .anchor-brand img{height:34px}
  .avatar-zone{width:clamp(190px,min(34vw,51svh),370px)!important}
  .conversation-console{width:min(820px,calc(100% - 16px));gap:3px}
  .dialogue,
  .dialogue.dialogue-compact,
  .dialogue.dialogue-expanded,
  .dialogue.dialogue-custom{max-height:min(18svh,86px)}
  .dialogue.dialogue-expanded{max-height:min(27svh,130px)}
  .console-foot{display:none}
}
body.keyboard-open{--k-console-max:min(48svh,315px)}
body.keyboard-open .avatar-zone{width:clamp(175px,min(58vw,39svh),330px)!important}
body.keyboard-open .dialogue{max-height:min(14svh,110px)}
body.keyboard-open .dialogue.dialogue-expanded{max-height:min(22svh,170px)}
body.keyboard-open .world-name{display:none}

@supports not (height:100dvh){
  :root{--k-vh:100vh}
}
@media(prefers-reduced-motion:reduce){.dock,.world,.conversation-console{transition:none!important}}


.site-bar{min-width:0;max-width:100%;overflow:hidden}
.site-bar>*{min-width:0}
.site-actions{flex:0 0 auto}
.connection{min-width:0}
.agent-id{flex:0 1 auto}
@media(max-width:360px){
  .site-bar{gap:5px;padding-left:max(7px,env(safe-area-inset-left));padding-right:max(7px,env(safe-area-inset-right))}
  .anchor-brand img{max-width:68px;height:auto}
  .agent-id{max-width:82px}.agent-id strong{font-size:.69rem}.agent-id span{display:none}
  .round-action{width:40px;height:40px}.site-actions{gap:4px}
  .conversation-console{width:calc(100% - 8px);max-width:calc(100% - 8px)}
  .composer{grid-template-columns:40px minmax(0,1fr) 40px;padding:4px}
  .composer-button,.send-button{width:38px;height:38px;min-width:38px}
}
@media(max-height:430px){
  .world-name,.agent-plaque,.avatar-hint{display:none!important}
  .avatar-zone{width:clamp(150px,min(32vw,42svh),285px)!important}
  .dialogue,.dialogue.dialogue-compact,.dialogue.dialogue-expanded,.dialogue.dialogue-custom{max-height:min(16svh,66px)}
}

/* v16.2 mobile/app interaction hardening */
button,a,input,select,textarea{touch-action:manipulation}
button,.result-actions a,.result-actions button,.search-hints button,.workbench-tabs button{min-height:44px}
.search-line input{min-height:44px;font-size:16px}
.search-line button{min-width:72px}
.offline-note{padding:8px 10px;border:1px solid currentColor;border-radius:10px;font-size:.88rem}
.app-access>button{margin-top:8px;min-height:44px}
.workbench-body{-webkit-overflow-scrolling:touch;overscroll-behavior:contain}
.result{content-visibility:auto;contain-intrinsic-size:160px}
@media(max-width:430px){
  .workbench-tabs{overflow-x:auto;scrollbar-width:none;-webkit-overflow-scrolling:touch}
  .workbench-tabs::-webkit-scrollbar{display:none}
  .workbench-tabs button{flex:0 0 auto;padding-inline:12px}
  .search-line{grid-template-columns:minmax(0,1fr) auto}
  .search-hints{display:flex;overflow-x:auto;gap:6px;padding-bottom:4px;scrollbar-width:none}
  .search-hints::-webkit-scrollbar{display:none}
  .search-hints button{flex:0 0 auto}
  .result-actions{display:flex;gap:8px;flex-wrap:wrap}
}
@media(display-mode:standalone){
  body{user-select:none;-webkit-user-select:none}
  textarea,input,.answer-text,.turn,.result,.source-card{user-select:text;-webkit-user-select:text}
}
/* v16.2 Raven Atlas search metadata — compact by default, no new dashboard. */
.result-meta{display:flex;flex-wrap:wrap;gap:.35rem;margin:0 0 .45rem}
.result-badge{display:inline-flex;align-items:center;min-height:1.65rem;padding:.18rem .5rem;border:1px solid color-mix(in srgb,currentColor 18%,transparent);border-radius:999px;font-size:.76rem;line-height:1.1;opacity:.82}
.atlas-explore{margin:.7rem 0 1rem;border-top:1px solid color-mix(in srgb,currentColor 12%,transparent);border-bottom:1px solid color-mix(in srgb,currentColor 12%,transparent);padding:.55rem 0}
.atlas-explore>summary{cursor:pointer;font-weight:650;min-height:44px;display:flex;align-items:center}
.atlas-categories{display:flex;flex-wrap:wrap;gap:.4rem;padding:.4rem 0 .2rem}
.atlas-categories button{min-height:40px;padding:.45rem .65rem;border-radius:999px}
@media(max-width:520px){.atlas-categories{flex-wrap:nowrap;overflow-x:auto;overscroll-behavior-inline:contain;padding-bottom:.55rem}.atlas-categories button{flex:0 0 auto}.result-meta{gap:.25rem}.result-badge{font-size:.72rem}}

