:root{color-scheme:dark;font-family:'Segoe UI',sans-serif;color:#edf4f2;background:#0c141a;font-size:14px}*{box-sizing:border-box}body{margin:0;display:grid;grid-template-columns:226px minmax(440px,1fr) 284px;height:100vh}button,input,textarea{font:inherit}button{border:1px solid #2c404b;border-radius:9px;padding:10px 14px;background:#1a2b34;color:#e6f0eb;cursor:pointer}button:hover{border-color:#70dfbd;background:#223b42}button:disabled{opacity:.4;cursor:default}button:focus-visible,input:focus-visible,textarea:focus-visible{outline:2px solid #70dfbd;outline-offset:3px}.sidebar{border-right:1px solid #26353e;padding:28px 18px;display:flex;flex-direction:column;background:#101b22}.brand{display:flex;align-items:center;gap:12px;margin-bottom:36px}.brand img{width:44px;height:44px}.brand strong{display:block;font-size:26px;line-height:1.1;letter-spacing:2px}.brand span{font-size:10px;letter-spacing:3px;color:#a7b9be}.eyebrow{font-size:10px;letter-spacing:1.8px;color:#94aaa9;font-weight:650;margin:0 0 15px}.workspaceList{overflow:auto;flex:1;min-height:60px}.workspaceList button{display:block;width:100%;text-align:left;border-color:transparent;background:none;margin-bottom:6px}.workspaceList button.selected{background:#203b36;border-color:#355f50}.workspaceList small{display:block;margin-top:5px;color:#9ab0b4}.newBox{border-top:1px solid #2a3b44;padding-top:14px}.newBox p{color:#9bb0b6;font-size:12px}.newBox button{display:block;width:100%;text-align:left;margin-top:7px;background:#14232b}.sidebarFoot{margin-top:28px}.badge{font-size:9px;letter-spacing:1.5px;color:#70dfbd;border:1px solid #36544c;border-radius:5px;padding:5px 7px}.quiet{background:none;border:0;padding:8px 0;color:#a8bdc0;text-align:left}.sidebarFoot button{font-size:11px;margin-top:9px}main{padding:30px 32px 20px;display:flex;flex-direction:column;min-height:0}header{display:flex;justify-content:space-between;align-items:center;gap:10px;padding-bottom:20px;border-bottom:1px solid #23343e}h1{font-size:23px;letter-spacing:-.5px;margin:0;font-weight:600}header .eyebrow{font-size:9px;margin-bottom:8px}header button{font-size:12px}.inspector{border-left:1px solid #26353e;background:#101b22;padding:30px 20px;overflow:auto}.statusCard{border:1px solid #2a4048;border-radius:12px;padding:16px;color:#b4c6c9;line-height:1.6;font-size:12px}.statusCard strong{display:block;color:#e6efea;font-size:14px;margin-bottom:6px}.space{margin-top:28px}.architecture{margin:24px 0;border-top:1px solid #2a3b44;padding-top:12px;font-size:11px;color:#a6b9bc}.architecture h3{font-size:13px;color:#deebe5}.architecture p{line-height:1.5}.architecture b{color:#70dfbd}.architecture small{display:block;line-height:1.6;color:#91a5ac}.phoneBox{background:#172a31;padding:14px;border-radius:12px;font-size:11px;line-height:1.7;color:#adc1c3}.phoneBox button{font-size:11px;width:100%}.phoneBox .eyebrow{margin-bottom:8px}#welcome{text-align:center;overflow:auto;flex:1;padding:36px 0 22px}.heroMark{margin:0 auto 20px;border:1px solid #356253;border-radius:20px;width:65px;height:65px;display:grid;place-items:center;color:#70dfbd;font-size:35px;background:#1a3029}h2{font-size:27px;font-weight:550;letter-spacing:-.5px;margin:8px 0 14px}#welcome>p{color:#a6bcc1;line-height:1.9}.featureGrid{margin-top:32px;display:grid;grid-template-columns:repeat(3,1fr);gap:13px;text-align:left}.featureGrid article{background:#13232b;border:1px solid #263e47;border-radius:12px;padding:18px 14px}.featureGrid span{font-size:10px;color:#70dfbd}.featureGrid h3{font-size:13px;font-weight:600;margin-top:15px}.featureGrid p{font-size:12px;color:#9fb4ba;line-height:1.7}#composer{border:1px solid #2e454e;background:#14232b;border-radius:14px;padding:14px;margin-top:18px}textarea,input{border:1px solid #344950;border-radius:7px;background:#101c23;color:#f0f5f2;padding:10px;resize:vertical;width:100%}#message{background:none;border:0;resize:none;padding:3px 2px;line-height:1.7;min-height:70px}#message:focus-visible{outline:none}.composeFoot{display:flex;align-items:center;justify-content:space-between;gap:12px;font-size:11px;color:#9db5b8}.primary{background:#70dfbd;color:#09291f;border-color:#70dfbd;font-weight:650;white-space:nowrap}.primary:hover{background:#95edcd;color:#09291f}.srOnly{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}[hidden]{display:none!important}#conversation{flex:1;overflow:auto;padding:20px 0}.message{white-space:pre-wrap;line-height:1.8;padding:16px 18px;border-radius:12px;background:#13232b;margin-bottom:16px;overflow-wrap:anywhere}.message.user{background:#1c332e;margin-left:28px}.message strong{font-size:10px;letter-spacing:1px;color:#70dfbd;display:block;margin-bottom:5px}.emptyChat{color:#8fa7ae;margin:50px 0;text-align:center}#error,#notice{padding:12px;border-radius:8px;margin-top:12px;font-size:12px;background:#472e26;color:#ffd2b9}#notice{background:#1f382f;color:#9fdfc6}.entry{font-size:11px;border-bottom:1px solid #283d45;padding:13px 2px;line-height:1.65;white-space:pre-wrap;overflow-wrap:anywhere}.entry b{display:block;color:#b6d8cc}dialog{background:#14232b;color:#eaf2ee;border:1px solid #3a555e;border-radius:16px;padding:26px;max-width:720px;width:calc(100% - 64px);max-height:90vh;box-shadow:0 30px 110px #000a}dialog::backdrop{background:#050e15c9}.dialogHeading{display:flex;justify-content:space-between;align-items:center;gap:20px}.dialogHeading h2{font-size:23px}.dialogHeading .eyebrow{margin-bottom:6px}dialog label{display:block;font-size:12px;color:#c5d6d7;margin-top:15px}dialog input,dialog textarea{display:block;margin-top:7px}dialog .toggle{display:flex;align-items:center;gap:10px;line-height:1.6}dialog .toggle input{width:auto;margin:0}.subtle{font-size:12px;color:#a8bdc1;line-height:1.6}.dialogFoot{display:flex;justify-content:space-between;align-items:center;margin-top:22px;gap:15px;color:#9db3b6;font-size:11px}pre{white-space:pre-wrap;overflow-wrap:anywhere;font:11px/1.6 Consolas,monospace;background:#0d1a21;padding:16px;border-radius:8px}#about p{color:#b6c7c9;line-height:1.8;font-size:13px}
/* The same application adapts to a narrow phone screen. */
.mobileNav{display:none}.runtimeActions{display:flex;flex-wrap:wrap;gap:8px;margin:8px 0}.runtimeActions button{font-size:11px}.phone-client #chooseModel,.phone-client #copyPhone{display:none}#pairing{max-width:420px;line-height:1.7}#pairing input{font-size:16px}#pairing button{margin-top:18px}#pairError{color:#ffd2b9}.mobileNav button.active{background:#203b36;border-color:#70dfbd}
@media(max-width:800px){body{display:block;height:100dvh;min-width:0}.sidebar,.inspector{display:none}main{height:100dvh;padding:12px 14px 14px;min-width:0}.mobileNav{display:flex;gap:8px;margin-bottom:18px}.mobileNav button{flex:1;padding:10px 4px;font-size:12px}header{gap:8px;padding-bottom:14px}h1{font-size:21px;overflow-wrap:anywhere}header .eyebrow{font-size:8px;letter-spacing:1px}header button{font-size:11px;padding:10px;max-width:104px}#welcome{padding-top:22px}#welcome h2{font-size:25px}.featureGrid{grid-template-columns:1fr;margin-top:20px;gap:10px}.featureGrid article{padding:13px 15px}.featureGrid h3{margin:7px 0}.featureGrid p{margin:5px 0}.heroMark{width:54px;height:54px;margin-bottom:13px}#composer{padding:10px;margin-top:10px}.composeFoot{align-items:flex-end}#message,input,textarea{font-size:16px}#activity{font-size:10px;line-height:1.6}.message{padding:13px;font-size:14px}.message.user{margin-left:12px}dialog{width:calc(100% - 24px);max-height:92dvh;padding:18px}.dialogHeading h2{font-size:22px}.dialogFoot{align-items:flex-end}body[data-view="workspaces"] .sidebar{display:flex;position:absolute;inset:64px 14px 14px;padding:16px;border:1px solid #2c404b;border-radius:14px;z-index:2}body[data-view="workspaces"] main> :not(.mobileNav){visibility:hidden}.sidebar .brand{margin-bottom:18px}.sidebarFoot{margin-top:16px}body[data-view="context"] .inspector{display:block;position:absolute;inset:64px 14px 14px;border:1px solid #2c404b;border-radius:14px;padding:20px;z-index:2}body[data-view="context"] main> :not(.mobileNav){visibility:hidden}.phoneBox{margin-bottom:15px}}
/* Settings stay in the app, with the same controls on a narrow phone screen. */
.cogButton{display:flex;gap:9px;align-items:center;min-height:44px}.cogButton>span:first-child{font-size:23px;line-height:1}.sectionHeading{display:flex;align-items:flex-start;justify-content:space-between;gap:14px}.sectionHeading>div{min-width:0}.sectionHeading .eyebrow{margin-top:8px}.sectionHeading p{margin-top:4px}.memoryPreview{display:block;width:100%;background:none;text-align:left;border:0;border-bottom:1px solid #293e45;border-radius:0;padding:0}.memoryPreview .entry{border:0}.activityFeed .entry{font-size:11px}.activityFeed .entry b{color:#91b5a7;font-size:10px}.settingsTabs{display:flex;gap:6px;overflow-x:auto;margin:16px 0 20px;padding-bottom:8px;border-bottom:1px solid #304750}.settingsTabs button{white-space:nowrap;font-size:12px;min-height:44px;padding:9px 11px}.settingsTabs button.active{color:#9af0cc;border-color:#70dfbd;background:#1f3c32}#settings{max-width:850px}.inlineError{color:#ffd0b8;background:#472e26;border-radius:8px;padding:12px;font-size:12px;line-height:1.6}h3{font-size:16px;font-weight:600}details{margin-top:18px}summary{cursor:pointer;color:#a9cac2;font-size:12px;padding:8px 0}select{font:inherit;display:block;width:100%;margin-top:7px;padding:11px;border:1px solid #344950;border-radius:7px;background:#101c23;color:#edf4f2}input[type=range]{accent-color:#70dfbd;padding:4px 0;height:28px;background:transparent;border:0}input[type=checkbox]{accent-color:#70dfbd;width:18px!important;height:18px;flex-shrink:0}input[readonly]{color:#a0dcc5}.fieldHelp{font-size:11px;line-height:1.7;color:#9fb5b9;margin:5px 0 12px}output{float:right;color:#91f0c7;font-variant-numeric:tabular-nums}#contextList{margin-top:15px}.contextCard{display:block;width:100%;text-align:left;margin-bottom:12px;padding:15px;border-radius:11px;background:#10202a}.contextCard strong{display:block;font-size:15px;line-height:1.5;color:#e5f2eb}.contextCard small{display:block;color:#a1c7ba;margin-top:5px;font-size:11px;line-height:1.6}.contextCard p{font-size:12px;color:#b0c4c8;line-height:1.7;margin:10px 0;white-space:pre-wrap;overflow-wrap:anywhere}.disabledEntry{opacity:.65}.referenceText{white-space:pre-wrap;overflow-wrap:anywhere;border-left:2px solid #3b6658;padding:12px 14px;color:#bed2ce;font-size:12px;line-height:1.8;background:#102028}.danger{color:#f5b7a2;background:#382621;border-color:#624037}hr{border:0;border-top:1px solid #304750;margin:28px 0}.memoryDetails{margin-top:28px}#modelForm>button{margin-top:12px}#phoneAddress,#remoteAddress{font-family:Consolas,monospace;font-size:13px}.connectionButtons{display:flex;flex-wrap:wrap;gap:10px;margin-top:12px}.phone-client #chooseModel{display:none}.phone-client #copyPhone{display:inline-block}
@media(max-width:800px){.mobileNav button:last-child{flex:0 0 44px;font-size:22px;padding:5px}.settingsLabel{display:none}.cogButton{min-width:44px;justify-content:center;padding:5px}#settings{padding:16px;max-width:calc(100% - 24px)}.settingsTabs{margin:12px 0 18px;gap:5px}.settingsTabs button{min-height:44px;padding:9px 10px;font-size:12px}.sectionHeading{display:block}.sectionHeading button{margin-bottom:12px}.sectionHeading .quiet{float:right}.dialogFoot{flex-wrap:wrap}.dialogFoot button{flex:1}.dialogFoot span{width:100%}.contextCard{padding:13px}#modelForm input,#modelForm select,#entryForm input{font-size:16px}}
/* Keep the composer visible while lists and settings scroll independently. */
body{overflow:hidden}.sidebar,.inspector{min-height:0}.workspaceList{min-height:0}#contextList{min-height:0}
@media(max-width:800px){main{padding-bottom:calc(14px + env(safe-area-inset-bottom))}.sidebar{overflow:auto}#settings{max-height:calc(100dvh - 24px)}}
/* Session setup presents only controls that fit the chosen purpose. */
#sessionDialog{max-width:760px}.sessionTypeCards{display:grid;gap:12px;margin-top:20px}.sessionTypeCards button{padding:18px;text-align:left;min-height:82px;background:#11252d}.sessionTypeCards strong{display:block;font-size:17px;color:#e9f5ec;margin-bottom:7px}.sessionTypeCards span{font-size:12px;line-height:1.7;color:#afc6c7;display:block}#sessionSetupForm #changeSessionType{margin:0 0 8px}#sessionSetupForm #setupAdventureOptions{padding:8px 16px 14px;margin-top:18px;border:1px solid #36544b;border-radius:10px;background:#10252a}#sessionSetupForm #setupAdventureOptions h3{margin-top:8px}#sessionSetupForm .dialogFoot{position:sticky;bottom:-26px;background:#14232b;border-top:1px solid #304750;padding:16px 0 4px;margin-top:20px}#welcome #startSession{margin:4px 0 14px}
@media(max-width:800px){#sessionDialog{width:calc(100% - 24px);padding:18px;max-height:calc(100dvh - 24px)}.sessionTypeCards button{padding:15px}.sessionTypeCards strong{font-size:16px}.sessionTypeCards span{font-size:12px}#sessionSetupForm .dialogFoot{bottom:-18px;padding:12px 0 3px}#sessionSetupForm #setupAdventureOptions{padding:8px 12px 12px}}
.newBox #newSessionButton{background:#70dfbd;color:#09291f}.newBox #newSessionButton:hover{background:#95edcd}

.componentDraftButton{font-size:12px;min-height:40px;margin:0 0 12px}.layerGuide{border:1px solid #35524c;border-radius:10px;padding:10px 13px;margin-bottom:18px}.layerGuide table{width:100%;border-collapse:collapse;font-size:12px;line-height:1.7}.layerGuide th,.layerGuide td{text-align:left;vertical-align:top;border-bottom:1px solid #304750;padding:10px 8px;overflow-wrap:anywhere}.layerGuide th{width:32%;color:#a5e5ce}#componentDialog{max-width:740px}#componentResult{white-space:pre-wrap;min-height:180px}.fieldHelp{overflow-wrap:anywhere}

label[hidden]+.fieldHelp{display:none!important}

#userGuideDialog{max-width:850px}.userGuideContent{font-size:14px;line-height:1.75;overflow-wrap:anywhere}.userGuideContent h2{font-size:17px;margin-top:26px;color:#a7e5ce}

.artControls{display:flex;flex-wrap:wrap;gap:12px}.artControls label{flex:1;min-width:90px}#imageGallery img{display:block;max-width:100%;max-height:65dvh;object-fit:contain;border-radius:12px}#imageGallery figure{margin:18px 0}#imageGallery figcaption{white-space:pre-wrap;overflow-wrap:anywhere;color:#9fb5b9;margin:8px 0;font-size:12px}

/* Keep the transcript as the only scrolling region in the chat view. */
#conversation { flex: 1 1 0; min-height: 0; }
#composer { flex: 0 0 auto; }
.composerTools, .composeRow { display: flex; align-items: center; gap: 8px; }
.composerTools { margin-bottom: 6px; }
.composerTools button { font-size: 12px; padding: 6px 10px; min-height: 34px; white-space: nowrap; }
.outputModes { display: inline-flex; gap: 2px; background: #101c23; border-radius: 9px; }
.outputModes button { background: none; border-color: transparent; }
.outputModes button[aria-pressed="true"] { background: #203b36; border-color: #467865; color: #c6f5e5; }
#openImageGallery { margin-left: auto; }
.messageInput { flex: 1; min-width: 0; }
.messageInput .fieldHelp { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); margin: 0; }
.composeRow { align-items: flex-end; }
#message { display: block; min-height: 44px; max-height: min(126px, 23dvh); padding: 9px 6px; line-height: 1.45; field-sizing: content; }
#sendButton { min-height: 44px; }
#activity { display: block; margin-top: 5px; color: #9db5b8; font-size: 11px; }
#activity:empty, #queueStatus:empty { display: none; }
#artOptions .dialogHeading, #imageGalleryDialog .dialogHeading { position: sticky; top: -26px; background: #14232b; z-index: 1; }
#artOptions .dialogHeading button, #imageGalleryDialog .dialogHeading button { min-height: 44px; }
#artOptions input[type="checkbox"] { display: inline-block; vertical-align: middle; margin: 0 4px 0 0; }
#chooseImageModel { margin-top: 8px; }
.phone-client #chooseImageModel { display: none; }
#openSessionActions { min-width: 44px; min-height: 44px; font-size: 20px; line-height: 1; padding: 6px; }
#sessionActions, #removeContent { max-width: 430px; }
#removeContentDescription { color: #c5d6d7; line-height: 1.6; overflow-wrap: anywhere; }
.sessionActionButtons, .galleryActions { display: flex; flex-wrap: wrap; gap: 8px; }
.sessionActionButtons button, .galleryActions button, #removeContent button { min-height: 44px; }
.galleryActions { margin-top: 8px; }

@media (max-width: 800px) {
  .mobileNav { margin-bottom: 8px; gap: 6px; }
  .mobileNav button { min-height: 44px; }
  .hasWorkspace header { padding-bottom: 6px; }
  .hasWorkspace header > div { display: flex; align-items: center; gap: 8px; min-width: 0; width: 100%; }
  .hasWorkspace header .eyebrow, .hasWorkspace #settingsButton, .hasWorkspace #accountStatus { display: none; }
  .hasWorkspace h1 { flex: 1; min-width: 0; font-size: 18px; }
  #openSessionActions { flex: 0 0 auto; }
  #queueStatus { margin: 4px 0; }
  .hasWorkspace #notice { margin-top: 6px; padding: 6px 9px; }
  #conversation { padding: 8px 0; }
  .message { margin-bottom: 9px; line-height: 1.55; }
  #composer { margin-top: 6px; padding: 7px 8px; }
  .composerTools { gap: 5px; margin-bottom: 3px; }
  .composerTools button { min-height: 38px; padding-inline: 8px; }
  #artOptions .dialogHeading, #imageGalleryDialog .dialogHeading { top: -18px; }
  #artOptions select { font-size: 16px; }
}
#adventureBuilderDialog{width:min(640px,calc(100% - 24px));max-height:calc(100dvh - 24px)}
#adventureBuilderDialog[open]{display:flex;flex-direction:column}
.builderMessages{min-height:100px;overflow:auto;overscroll-behavior:contain;padding-right:6px}
.builderMessages .message{margin:8px 0;overflow-wrap:anywhere}
#builderForm{flex-shrink:0}
.builderActions{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:8px}
.builderSuggestions{padding-left:24px;margin:8px 0 12px}
.builderSuggestions li{padding:8px 0;overflow-wrap:anywhere}
.builderSuggestions p{margin:4px 0 8px}
#starterEntryList article{padding:12px 0;border-bottom:1px solid #304750;overflow-wrap:anywhere}
#starterEntryList article p{margin:6px 0}
.imageReferenceChip{display:flex;align-items:center;gap:8px;margin-top:7px;color:#b8d5cc;font-size:12px}
.imageReferenceChip button{min-height:34px;padding:3px 10px}
.pinnedImage{margin:0 0 14px;padding:10px;border:1px solid #304750;border-radius:10px;background:#101f28}
.pinnedImage img{display:block;width:auto;max-width:100%;height:auto;max-height:360px;object-fit:contain;border-radius:6px}
.pinnedImage img:not([src]){visibility:hidden;width:auto;height:140px}
.pinnedImage figcaption{margin:7px 0;font-size:12px;overflow-wrap:anywhere}
#attachImage{flex:0 0 40px;min-height:40px;padding:4px;font-size:22px;line-height:1}
#imageReferenceLabel{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#imageUpload[hidden],.imageReferenceChip[hidden]{display:none}
.playerDetails{border-bottom:1px solid #304750;padding:4px 0 10px}
.playerDetails summary{font-size:14px}
.playerDetails fieldset{margin:10px 0;border:1px solid #304750;border-radius:8px}
.playerDetails form{margin-bottom:10px}
.playerDetails .entry{white-space:pre-wrap;overflow-wrap:anywhere}
.continueResponse{display:block;margin-top:12px;min-height:44px}

#teamsDialog #teamDetails { margin-top: 16px; }
#teamsDialog details details { margin: 6px 0; }
#teamReplyPreview { max-height: 12rem; overflow: auto; white-space: pre-wrap; }
#peopleList .entry, #teamRecords .entry { white-space: pre-wrap; overflow-wrap: anywhere; }
#peopleList .entry button, #teamSessions .entry button { margin: 8px 8px 0 0; }
.newBox #openTeams { width: 100%; margin-top: 8px; }

.messageActions {display:flex; gap:6px; margin-top:6px;}
.messageActions button {min-height:32px; padding:4px 8px; font-size:.86em;}
#redoHistory {align-self:flex-start; min-height:36px;}

.historyShortcut {min-height:44px; display:inline-flex; align-items:center; gap:6px; margin-right:6px;}
.historyShortcut > span:first-child {font-size:17px;}

@media(max-width:800px){.historyShortcut{flex:0 0 44px;justify-content:center;margin:0;padding:5px;} .historyShortcutLabel{display:none;}}

#photoEditCanvas{display:block;max-width:100%;max-height:42vh;width:auto;height:auto;margin:10px auto 0;touch-action:none;cursor:crosshair;border-radius:8px;}
#photoEditStrength{width:100%;}
#photoEditDialog{width:min(92vw,540px);}
