:root{font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:#182333;background:#f5f6f8;--line:#cdd5e2;--muted:#667184;--blue:#244a79;--rail:#eceff5}*{box-sizing:border-box}body{margin:0}button,input,textarea,select{font:inherit;color:inherit}button,a,input,textarea,select{outline-offset:4px}button:focus-visible,a:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible{outline:2px solid #315ec5}button{cursor:pointer;border:1px solid var(--line);border-radius:8px;background:#f8f9fb;padding:8px 12px}button:hover{background:#e1e8f3}button:disabled{cursor:not-allowed;opacity:.5}a{color:var(--blue)}header{height:72px;border-bottom:1px solid var(--line);display:flex;align-items:center;gap:12px;padding:10px 24px;background:#f7f8fa}.brand-logo{width:44px;height:44px;object-fit:cover;object-position:50% 45%;border-radius:50%;box-shadow:0 2px 6px #0002}h1{font-size:18px;letter-spacing:-.3px;font-weight:650;margin:0}h1 span{font-weight:500}.attribution{margin-left:auto;text-decoration:none;font-size:13px;color:#586779;white-space:nowrap}.attribution b{color:#244a79}#rail-toggle{display:none}.shell{display:grid;grid-template-columns:242px minmax(0,1fr);height:calc(100dvh - 72px)}aside{border-right:1px solid var(--line);background:var(--rail);padding:18px 12px 0;overflow-y:auto;display:flex;flex-direction:column;gap:6px}aside>button{text-align:left;background:transparent;border:0;font-size:13px}.new{border:1px solid var(--line);padding:11px 8px;margin-bottom:8px;color:var(--blue);font-weight:600}.rail-heading{display:flex;align-items:center;justify-content:space-between;font-size:11px;color:var(--muted);margin-top:14px;padding:8px 4px}.rail-heading button{border:0;padding:0;font-size:10px;background:none;text-decoration:underline}.search input{width:100%;padding:9px;border:1px solid var(--line);border-radius:6px;background:#f5f7fb;font-size:12px}#conversations{min-height:110px;flex:1;padding-top:8px}.group-label{font-size:11px;color:#57657b;padding:12px 7px 4px}.conversation{display:block;width:100%;text-align:left;border:0;background:none;padding:10px 8px;border-radius:7px;font-size:12px;overflow-wrap:anywhere}.conversation.active{background:#dce5f3;color:#17395f}.conversation small{display:block;color:var(--muted);margin-top:5px;font-size:10px}.utilities{font-size:12px;padding:12px 4px;border-top:1px solid var(--line)}summary{cursor:pointer;color:#58677f;padding-bottom:8px}.utilities button,.utilities a{display:block;width:100%;text-align:left;border:0;background:none;padding:7px 4px;font-size:12px;text-decoration:none}.utilities button:hover,.utilities a:hover{background:#dfe5ef}.utilities small{float:right;color:#687387;font-size:9px}.profile{margin-top:10px;border-top:1px solid var(--line);display:flex;gap:9px;align-items:center;padding:15px 4px!important;border-radius:0!important}.profile span:last-child{min-width:0}.profile b{display:block;font-size:12px;font-weight:600}.profile small{display:block;font-size:10px;color:var(--muted);margin-top:4px}.initial{width:32px;height:32px;display:grid;place-items:center;border-radius:50%;background:#d9e3ef;color:var(--blue);font-size:11px}main{min-width:0;overflow-y:auto;display:flex;flex-direction:column}.canvas-top{min-height:48px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid #e0e5ed;padding:10px 26px;font-size:12px;color:var(--muted)}.demo-badge{font-size:10px;border:1px solid #c9d7d0;color:#446052;border-radius:20px;padding:5px 9px}.welcome{flex:1;min-height:300px;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:30px 20px}.welcome-medallion{width:136px;height:136px;border-radius:50%;border:1px solid #bdc9da;padding:8px;background:#eaf0f5;box-shadow:0 8px 18px #21334b12}.avatar-fallback{width:100%;height:100%;display:flex;align-items:center;justify-content:center;font-size:64px;color:#7d8999;background:#e1e7ee;border-radius:50%}.welcome-medallion img{width:100%;height:100%;border-radius:50%;object-fit:cover;object-position:50% 46%}.welcome h2{font-size:27px;letter-spacing:-.7px;margin:23px 0 10px}.welcome p{font-size:14px;color:var(--muted);max-width:480px;line-height:1.6;margin:0 0 16px}.welcome button{background:none;border:0;color:var(--blue);font-size:12px;text-decoration:underline}.welcome .quiet{font-size:11px;margin-top:10px;color:#718093}.compose-wrap{width:min(860px,calc(100% - 68px));margin:20px auto 0}.tools{display:flex;gap:6px;flex-wrap:wrap;margin:10px 0}.tools button{font-size:11px;padding:6px 9px;background:#e7ecf4}#composer{display:flex;align-items:center;gap:10px;border:1px solid #6288d0;border-radius:17px;background:#f8f9fb;padding:12px 14px;min-height:66px}textarea{resize:vertical;border:0;background:none;min-width:0;flex:1;max-height:160px;padding:5px;font-size:14px;line-height:1.5}select{font-size:11px;border:1px solid var(--line);border-radius:6px;background:#e7edf5;padding:7px;max-width:215px}.send{border:0;background:var(--blue);color:white;width:36px;height:36px;font-size:22px;padding:0;border-radius:9px}.work-state{font-size:11px;color:#60748e;padding:0 4px}#storage-note{font-size:10px;color:#687488;margin:8px 4px}.medallions{display:flex;justify-content:center;gap:22px;margin:24px 0 0;padding:20px 20px 22px;border-top:1px solid var(--line);background:linear-gradient(#f6f7f9,#edf0f4)}.medallions :is(button,a){border:0;padding:0;background:none;display:flex;flex-direction:column;align-items:center;gap:7px;font-size:11px;color:#42536a;text-decoration:none}.medallions small{font-size:9px;font-weight:400;line-height:1}.medallions :is(button,a):disabled{opacity:.45}.medallions img{width:52px;height:52px;border-radius:50%;object-fit:cover;object-position:center;box-shadow:0 3px 6px #1d2c4533}.medallions :is(button,a)[aria-current=page]{color:#173b70;font-weight:650}.medallions :is(button,a)[aria-current=page] img{outline:2px solid #244a79;outline-offset:2px}#chat{flex:1;padding:18px max(24px,calc((100% - 860px)/2));min-height:280px}.chat-heading{display:flex;align-items:center;gap:8px;border-bottom:1px solid var(--line);padding-bottom:12px;flex-wrap:wrap}.chat-heading h2{font-size:16px;font-weight:600;margin:0 auto 0 0}.chat-heading button{font-size:11px}.turn{max-width:76ch;padding:18px 0;border-bottom:1px solid #e2e7ee}.turn b{font-size:12px;font-weight:600}.turn p{font-size:14px;line-height:1.7;white-space:pre-wrap;overflow-wrap:anywhere;margin:7px 0}.turn time{font-size:10px;color:var(--muted);margin-left:10px}#mode-panel{flex:1;padding:40px max(28px,calc((100% - 760px)/2));min-height:300px}#mode-panel h2{font-size:23px}#mode-panel p{line-height:1.7;font-size:14px;color:var(--muted)}[hidden]{display:none!important}dialog{border:1px solid var(--line);border-radius:16px;padding:22px;width:min(720px,calc(100% - 26px));max-height:85dvh;color:#203148;background:#f7f9fc;box-shadow:0 22px 80px #152f5a33}dialog::backdrop{background:#14233b55}.dialog-head{display:flex;align-items:center;gap:14px;margin-bottom:20px}.dialog-head h2{margin:0;flex:1;font-size:20px}.dialog-head button{border:0;background:none;font-size:22px;padding:2px 7px}.field{display:block;margin:12px 0;font-size:12px}.field input,.field textarea,.field select{display:block;width:100%;margin-top:7px;border:1px solid var(--line);border-radius:7px;background:white;padding:10px;max-width:none}.field textarea{min-height:90px}.actions{display:flex;gap:9px;flex-wrap:wrap;margin-top:18px}.primary{background:#244a79;color:white;border-color:#244a79}.directory-entry{width:100%;display:flex;align-items:center;justify-content:space-between;text-align:left;border:0;border-bottom:1px solid var(--line);border-radius:0;background:none;padding:15px 3px}.directory-entry small{display:block;font-size:11px;color:var(--muted);margin-top:5px}.kind{font-size:10px;color:#60738b;margin-left:12px;white-space:nowrap}.detail{display:grid;grid-template-columns:135px 1fr;gap:13px;font-size:13px;line-height:1.6}.detail dt{color:var(--muted)}.detail dd{margin:0;overflow-wrap:anywhere}.note{font-size:12px;color:var(--muted);line-height:1.7}.record{border-top:1px solid var(--line);padding:15px 0;font-size:13px;line-height:1.6;overflow-wrap:anywhere}.record p{white-space:pre-wrap}.record small{color:var(--muted)}.empty{font-size:12px;color:var(--muted);padding:15px 4px}#status{position:static;align-self:flex-end;flex-shrink:0;margin:8px 14px 0;background:#213c60;color:white;border-radius:8px;font-size:12px;padding:10px 16px;max-width:min(360px,calc(100% - 28px));overflow-wrap:anywhere;box-shadow:0 4px 12px #0002}#status:empty{display:none}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}@media(max-width:800px){header{padding:10px 14px;gap:9px}h1{font-size:15px}h1 span{display:block;font-size:12px;margin-top:3px}.attribution{font-size:10px}.brand-logo{width:35px;height:35px}#rail-toggle{display:block;border:0;background:none;padding:4px}.shell{grid-template-columns:1fr}aside{display:none;position:fixed;z-index:3;top:72px;bottom:0;left:0;width:258px;box-shadow:10px 0 30px #23334a22}aside.open{display:flex}.canvas-top{padding:12px 16px;font-size:11px}.demo-badge{font-size:9px;padding:4px 6px}.compose-wrap{width:calc(100% - 28px);margin-top:12px}.welcome{min-height:310px;padding-top:20px}.welcome-medallion{width:112px;height:112px}.welcome h2{font-size:25px}.welcome p{font-size:12px}#composer{flex-wrap:wrap;padding:10px}#composer textarea{flex-basis:calc(100% - 55px)}#composer select{order:3;max-width:none;width:100%}.medallions{gap:clamp(8px,3vw,18px);margin-top:17px;padding:18px}.medallions img{width:46px;height:46px}.tools button{font-size:10px}#chat{padding:18px}.detail{grid-template-columns:105px 1fr;gap:12px;font-size:12px}}@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important}}

.room-artifacts{border-top:1px solid var(--line);padding:15px 4px 6px;margin-top:12px}.room-artifacts h2{font-size:11px;color:var(--muted);font-weight:600;margin:0 0 8px}.room-artifacts h3{font-size:12px;font-weight:600;margin:0 0 8px}.room-artifacts p,.room-artifacts small{font-size:11px;line-height:1.5;color:var(--muted);margin:4px 0;display:block}#utilities>a{display:block;padding:8px 5px;font-size:12px;text-decoration:none}#utilities>a:hover{background:#e1e8f3;border-radius:6px}#utilities>a small{display:block;font-size:10px;color:var(--muted);margin-top:3px}

.demo-badge[data-connection="active"]{background:#e6f5eb;color:#14532d;border:1px solid #267541;outline:none}.demo-badge[data-connection="unverified"]{outline:2px solid #7950a8;outline-offset:1px}.room-inactive{color:#853d00;background:#fff3e2;border-left:3px solid #a65000;border-radius:4px;padding:9px 12px}.connection-action{display:inline-block;font-weight:700;margin-top:10px}

/* Original blue contour mark from Meridian Gridworks' vector asset pack. */
.brand-logo{object-fit:contain;object-position:center;border-radius:0;padding:2px;box-shadow:none}
.medallions [data-mode="Meridian"] img{object-fit:contain;padding:7px;background:#f7f8fa}

/* The transcript owns scrolling; the composer and navigation remain in flow. */
main:has(#chat:not([hidden])){min-height:0;overflow:hidden}
main:has(#chat:not([hidden]))>:is(.canvas-top,.compose-wrap,#status,.medallions){flex-shrink:0}
#chat{display:flex;flex-direction:column;min-height:0;overflow:hidden}
.chat-heading{flex-shrink:0}
#messages{flex:1;min-height:0;overflow-y:auto;overscroll-behavior-y:contain;padding-bottom:24px;scroll-padding-bottom:24px;overflow-anchor:none}
@media(max-height:650px){
 main:has(#chat:not([hidden])) .medallions{margin-top:6px;padding:8px 12px}
 main:has(#chat:not([hidden])) .medallions img{width:32px;height:32px}
 main:has(#chat:not([hidden])) #chat{padding-top:10px;padding-bottom:8px}
 main:has(#chat:not([hidden])) .compose-wrap{margin-top:8px}
 main:has(#chat:not([hidden])) #storage-note{margin-top:4px;margin-bottom:4px}
 main:has(#chat:not([hidden])) #status{padding:6px 12px;font-size:11px}
}

#build-id{font-size:11px;color:#586779;white-space:nowrap;font-variant-numeric:tabular-nums}
.unfinished-control:disabled{opacity:1;cursor:default;color:#586779;font-size:11px}
@media(max-width:800px){header{flex-wrap:wrap;height:auto;min-height:72px;position:relative;padding-right:14px}#build-id{position:absolute;right:14px;bottom:6px;font-size:10px}.attribution{padding-bottom:12px}.chat-heading{flex-wrap:wrap;gap:8px}}
@media(max-width:800px){.chat-heading .unfinished-control:disabled{font-size:10px;padding:6px}.chat-heading h2{flex-basis:100%}}

.room-form{display:grid;gap:12px;margin-top:18px}.room-form label{display:grid;gap:6px}.room-form input,.room-form textarea,.room-form select{width:100%;min-width:0;padding:9px;border:1px solid var(--line);border-radius:6px}.room-form textarea{min-height:100px}.room-form [hidden]{display:none}.room-records article{padding:12px 0;border-bottom:1px solid var(--line)}.room-records p{white-space:pre-wrap;overflow-wrap:anywhere}.room-records a,#room-artifacts a{display:block;overflow-wrap:anywhere}.room-records small{display:block;color:#586779;margin-top:6px}
.living-backlog{display:block;padding:12px;background:#dce5f3;border:1px solid #244a79;border-radius:8px;font-weight:600}
.historical-reference{white-space:pre-wrap;overflow-wrap:anywhere;font:inherit;line-height:1.5}#dialog-body>p{overflow-wrap:anywhere}
.room-files article{padding:12px 0;border-bottom:1px solid var(--line);overflow-wrap:anywhere}.room-files small{display:block;margin:6px 0;color:#586779}

.recipient-controls{display:flex;align-items:center;gap:6px;min-width:0}.recipient-controls select{min-width:0}#add-agent{font-size:11px;padding:7px;white-space:nowrap}.agent-roster-entry{padding:12px;border:1px solid var(--line);border-radius:8px}.agent-roster-entry h3{margin-top:0}@media(max-width:800px){.recipient-controls{order:3;width:100%}.recipient-controls select{order:0;flex:1;width:0!important;max-width:none}}
.agent-roster-entry[data-availability="available"]{border:2px solid #237245}
.recipient-controls label{font-size:11px;white-space:nowrap}.delivery-state{font-size:11px;color:#586779;padding:8px 0;overflow-wrap:anywhere}

.member-entry{min-height:100dvh;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:16px;padding:30px;text-align:center}.member-entry img{width:64px;height:64px}.member-entry h2{font-size:24px;margin:0}.member-entry p{max-width:440px;line-height:1.5;margin:0}.member-entry a{padding:12px 18px;border:1px solid var(--blue);border-radius:8px;background:var(--blue);color:white;text-decoration:none}#member-workspace{height:100dvh}

#member-entry[hidden],#member-workspace[hidden]{display:none!important}

#status:has(.room-agent-statuses){background:transparent;box-shadow:none;padding:0;display:grid;gap:8px;max-width:min(360px,calc(100vw - 28px))}#status:has(.room-agent-statuses)>div:not(.room-agent-statuses):not(:empty){background:#244a79;color:white;padding:10px 16px;border-radius:8px;box-shadow:0 4px 12px #0002}.room-agent-statuses{display:grid;gap:7px}.room-agent-statuses button{width:100%;text-align:left;font-size:12px;box-shadow:0 4px 12px #0002}.room-agent-statuses .agent-status-active{background:#244a79;color:#fff;border:2px solid #244a79}.room-agent-statuses .agent-status-previous{background:#fff;color:#244a79;border:2px solid #244a79}

.room-agent-statuses button{padding:5px 8px;line-height:14px}

/* Gaggle editor: reuse the portal palette/type; keep role and recipient controls legible. */
.gaggle-form fieldset{min-width:0;border:1px solid var(--line);border-radius:8px;padding:14px;margin:12px 0;display:grid;gap:12px}.gaggle-form legend{font-weight:600;padding:0 5px}.gaggle-form input[type=checkbox]{width:18px;height:18px;min-width:18px;padding:0;margin:0;accent-color:var(--blue)}.gaggle-form label:has(input[type=checkbox]){display:flex;align-items:center;gap:8px}.gaggle-form fieldset>div{display:grid;gap:8px;padding:8px 0;border-bottom:1px solid var(--line)}.gaggle-form p,.gaggle-form small{font-size:13px;line-height:1.5}.gaggle-form textarea{resize:vertical;min-height:130px}.gaggle-form button{justify-self:start;max-width:100%;white-space:normal;text-align:left}

/* Conversation reading layout. Keep navigation recoverable without taking transcript space. */
#member-workspace:has(#chat:not([hidden])){height:auto}
#portal-screen:has(#chat:not([hidden])){display:grid;grid-template-rows:auto minmax(0,1fr);height:var(--reading-viewport,100dvh);overflow:hidden}
#member-workspace:has(#chat:not([hidden])) .shell{height:auto;min-height:0}
main:has(#chat:not([hidden])) .canvas-top{order:-3;min-height:36px;padding-block:4px}
main:has(#chat:not([hidden])) #status{max-height:5rem;overflow-y:auto}
#chat{padding-top:6px;padding-bottom:0}
.chat-heading{display:grid;grid-template-columns:minmax(0,1fr) auto auto auto;gap:4px;align-items:center;padding:2px 0 8px}
.chat-heading h2{width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.chat-heading button{white-space:nowrap;padding:6px}
.reading-toggle{display:inline-flex;align-items:center;gap:3px;padding:5px 4px;font-size:11px;white-space:nowrap;cursor:pointer;color:var(--blue)}
.reading-toggle input{width:14px;height:14px;margin:0;accent-color:var(--blue)}
#messages:focus-visible{outline:2px solid #315ec5;outline-offset:-2px}
.turn{padding:13px 0;max-width:82ch}
.turn b{font-size:14px}
.turn p{font-size:17px;line-height:1.6}
.turn time{font-size:12px;margin:0}
main:has(#chat:not([hidden])) .compose-wrap{margin-top:4px;padding-bottom:max(4px,env(safe-area-inset-bottom))}
main:has(#chat:not([hidden])) #composer{min-height:0;padding:7px 10px}
#composer textarea{font-size:16px;max-height:min(160px,25dvh)}
#portal-screen:has(#chat:not([hidden]) #reading-mode:checked)>header,
main:has(#chat:not([hidden]) #reading-mode:checked)>.canvas-top,
main:has(#chat:not([hidden]) #reading-mode:checked) #status:has(.room-agent-statuses)> .room-agent-statuses,
main:has(#chat:not([hidden]) #reading-mode:checked) #status:has(.room-agent-statuses):not(:has(>div:not(.room-agent-statuses):not([hidden]):not(:empty))){display:none}
@media(max-width:800px){
 #chat{padding-inline:12px}
 .chat-heading h2{font-size:14px}
 .chat-heading button,.chat-heading .unfinished-control:disabled{font-size:10px;padding:5px}
 #member-workspace:has(#chat:not([hidden]) #reading-mode:checked) aside.open{top:0}
}
.keyboard-reading #portal-screen:has(#chat:not([hidden]))>header,
.keyboard-reading main:has(#chat:not([hidden]))>.canvas-top{display:none}
.room-info{position:relative;flex:none;font-size:12px}
.room-info>summary{padding:3px 0 5px;width:max-content;max-width:100%}
.room-info>div{position:absolute;z-index:2;top:100%;left:0;width:min(360px,100%);max-height:30dvh;overflow:auto;padding:10px;background:#f7f9fc;border:1px solid var(--line);border-radius:8px;box-shadow:0 4px 12px #0002}
.room-info p{margin:5px 0}
@media(max-height:520px){
 #portal-screen:has(#chat:not([hidden]) ~ .compose-wrap textarea:focus)>header,
 main:has(#chat:not([hidden]) ~ .compose-wrap textarea:focus)>.canvas-top{display:none}
}

@media(max-width:800px){
 .room-info>summary{font-size:11px}
 #member-workspace:has(#chat:not([hidden]) #reading-mode:checked) .chat-heading{padding-bottom:5px}
}
.room-info:not([open])>div{display:none}
.keyboard-reading #status .room-agent-statuses,
.keyboard-reading #status:has(.room-agent-statuses):not(:has(>div:not(.room-agent-statuses):not([hidden]):not(:empty))){display:none}
@media(max-height:520px){
 main:has(#chat:not([hidden]) ~ .compose-wrap textarea:focus) #status .room-agent-statuses,
 main:has(#chat:not([hidden]) ~ .compose-wrap textarea:focus) #status:has(.room-agent-statuses):not(:has(>div:not(.room-agent-statuses):not([hidden]):not(:empty))){display:none}
}


/* The initial screen ends at the composer; the document scrolls to the footer. */
#member-workspace{height:auto}
#member-workspace > .medallions{margin:0;padding:10px 12px max(10px,env(safe-area-inset-bottom))}
#member-workspace > .medallions img{width:32px;height:32px}
#messages{overscroll-behavior-y:auto}

#status:has(>div[hidden]:only-child){display:none}
#footer-agents:not(:has(button)){display:none}
#footer-agents{padding:8px 12px;background:#f5f6f8}
#footer-agents .room-agent-statuses{width:min(860px,100%);margin-inline:auto;display:flex;flex-wrap:wrap;justify-content:center}
#footer-agents .room-agent-statuses button{width:auto;max-width:100%;overflow-wrap:anywhere}
#status:has(>div:empty:only-child){display:none}

/* Keep the mobile title compact; release metadata belongs below the navigation. */
.release-footer{padding:0 14px max(8px,env(safe-area-inset-bottom));text-align:right;background:#edf0f4}
.release-footer #build-id{position:static;font-size:10px;color:#667184}
@media(max-width:800px){
 #portal-screen>header{height:55px;min-height:55px;padding:4px 10px;gap:7px;flex-wrap:nowrap}
 #portal-screen>header .brand-logo{width:31px;height:31px}
 #portal-screen>header h1{line-height:1.02;font-size:14px}
 #portal-screen>header h1 span{font-size:11px;margin-top:2px}
 #portal-screen>header .attribution{padding-bottom:0;font-size:10px}
 #portal-screen #sidebar{top:55px}
 #portal-screen:not(:has(#chat:not([hidden]))) .shell{height:calc(100dvh - 55px)}
 #member-workspace:has(#chat:not([hidden]) #reading-mode:checked) #sidebar.open{top:0}
}
