:root{--surface:#fff;--surface-raised:#fafafb;--surface-hover:#edeef0;--control:#fafbfc;--border:#d7d9df;--text-primary:#292b31;--text-secondary:#6d717b;--terminal-bg:#fff;--terminal-fg:#262626}
:root[data-theme=dark]{--bg:#202124;--panel:#27282c;--line:#ffffff14;--muted:#a1a4ac;--text:#e8e9ec;--green:#71bb93;--surface:#202124;--surface-raised:#292a2f;--surface-hover:#34353b;--control:#303137;--border:#464850;--text-primary:#e8e9ec;--text-secondary:#a9acb5;--terminal-bg:#202124;--terminal-fg:#e7e7eb}
.appearance-control{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:0 7px 12px;color:var(--text-secondary);font-size:13px}
.appearance-control select{font:inherit;color:var(--text-primary);border:1px solid var(--border);border-radius:7px;background:var(--control);padding:5px 8px;width:94px}
.code-output{background:var(--terminal-bg);padding-top:12px;padding-bottom:12px}.code-output pre{color:var(--terminal-fg)}
#code-form{max-width:none;width:calc(100% - 36px);margin-bottom:6px;box-shadow:0 1px 4px #00000006}
.composer-model,.agent-controls{max-width:none;width:calc(100% - 36px)}
#code-form:focus-within{border-color:#8b939f;box-shadow:0 0 0 2px #8994a412}
.code-history{font-size:12px}.code-history .quiet{font-size:12px;color:var(--text-secondary)}
:root[data-theme=dark] .sidebar{background:linear-gradient(135deg,#2d2e32,#25262a);border-color:var(--border)}
:root[data-theme=dark] :is(.home,.topbar,.session-toolbar,.workspace-overview,.coding-panel){background:var(--surface);color:var(--text-primary);border-color:var(--border)}
:root[data-theme=dark] :is(.provider-card,.provider-icon,.new-session,.download-latest,.folder-picker,.account-services,.account-service,.workspace #workspace-team,.workspace #workspace-team .member-row){background:var(--surface-raised);border-color:var(--border);box-shadow:none;color:var(--text-primary)}
:root[data-theme=dark] :is(.provider-card:hover,.session-item:hover,.session-item.active){background:var(--surface-hover);border-color:var(--border);box-shadow:none}
:root[data-theme=dark] :is(.button.primary,.button.secondary,.account-action,.member-access,.workspace #workspace-team .member-access,.workspace #workspace-team .invitation-link-controls .button,#code-send,.composer-actions #attach-file,.agent-controls button){background-color:var(--control);background-image:none;border-color:var(--border);color:var(--text-primary);box-shadow:none}
:root[data-theme=dark] :is(button:hover:not(:disabled),.account-action:hover:not(:disabled)){filter:brightness(1.12)}
:root[data-theme=dark] :is(#code-form,input,textarea,select,.inline-project-name){background-color:var(--surface-raised);color:var(--text-primary);border-color:var(--border)}
:root[data-theme=dark] #code-prompt{background:transparent}
:root[data-theme=dark] #code-send:disabled{background:#292a2e;border-color:#3a3c43;color:#888c95}
:root[data-theme=dark] ::placeholder{color:#898d97}
:root[data-theme=dark] :is(.intro,.provider-card p,.card-bottom,.quiet,.download-version,.shortcut,.section-label,.session-heading p,.session-item small,.composer-model,.field-help,.modal-description,.service-content p,.account-profile span:not(.avatar),.account-permissions,.account-connection,.settings-symbol,.home-footer,.account small,.member-row small){color:var(--text-secondary)}
:root[data-theme=dark] :is(h1,h2,h3,.provider-card h2,.account strong,.session-item strong,.account-profile strong){color:var(--text-primary)}
:root[data-theme=dark] .brand{color:#b1b5bf}
:root[data-theme=dark] :is(dialog,#modal[data-kind="account"]){background:var(--surface-raised);border-color:var(--border);color:var(--text-primary);box-shadow:0 20px 80px #0007}
:root[data-theme=dark] dialog::backdrop{background:#0007;backdrop-filter:blur(7px)}
:root[data-theme=dark] :is(.account-service+.account-service,.account-session-actions,.code-history,.account,.member-row){border-color:var(--border)}
:root[data-theme=dark] .service-status{background:#33353a;border-color:#4c4f56;color:#c0c3cb}
:root[data-theme=dark] .service-status.connected{background:#263b31;border-color:#41624f;color:#99d4ad}
:root[data-theme=dark] :is(.agent-controls[open]>div,.session-context-menu,#toast){background:#303137;color:var(--text-primary);border-color:var(--border);box-shadow:0 8px 28px #0004}
:root[data-theme=dark] .avatar{background:#383a40;box-shadow:none}
:root[data-theme=dark] .avatar.has-photo{background:transparent;box-shadow:none}
:root[data-theme=dark] .form-error{background:#402c30;color:#efb4b9;border-color:#765057}
:root[data-theme=dark] .attachment-chip{background:var(--control);color:var(--text-primary);border-color:var(--border)}
:root[data-theme=dark] .workspace #workspace-team .member-access{background-image:url('assets/chevron-down.svg');background-repeat:no-repeat;background-position:right 9px center}

:root[data-theme=dark] main,:root[data-theme=dark] .workspace{background:var(--surface)}

/* Reading should stay legible at every window size; the PTY handles reflow. */
.code-output pre{font-size:14px;line-height:20px}
.code-history{gap:12px;flex-wrap:wrap;flex-shrink:0;min-height:34px;color:var(--text-secondary)}
.code-history .quiet{min-height:32px;font-size:13px}
.code-history #code-live.has-new-output{color:var(--text-primary);font-weight:600;border-bottom:2px solid var(--green)}
.code-output ::selection{background:#b9d6ff;color:#172235}
:root[data-theme=dark] .code-output ::selection{background:#405f8d;color:#fff}
.code-output:focus-visible{outline:2px solid #879bb5;outline-offset:-2px}

/* Launch: two equal, keyboard-accessible destinations on a quiet metal surface. */
#modal[data-kind="launch"]{width:540px;max-width:calc(100vw - 36px);padding:28px;border:1px solid var(--border);border-radius:22px;background:linear-gradient(145deg,#fff,#f2f3f5);box-shadow:0 24px 90px #17202e26,inset 0 1px #fff}
#modal[data-kind="launch"] #modal-title{font-size:25px;letter-spacing:-.7px;margin-bottom:8px}
#modal[data-kind="launch"] #modal-description{font-size:14px;color:var(--text-secondary)}
.launch-provider{display:flex;align-items:center;gap:10px;margin:22px 0 15px;font-size:14px;font-weight:600;color:var(--text-primary)}
.launch-provider>svg{width:30px;height:30px}
.launch-choices{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-bottom:23px}
.launch-choice{position:relative;display:flex;flex-direction:column;align-items:flex-start;text-align:left;gap:8px;border:1px solid #cfd3d9;border-radius:14px;padding:18px;background:linear-gradient(145deg,#fff,#eceef1);box-shadow:inset 0 1px #fff,0 2px 4px #17202e06;transition:border-color .15s,box-shadow .15s}
.launch-choice[aria-pressed="true"]{border-color:#768595;box-shadow:0 0 0 1px #768595,inset 0 1px #fff;background:linear-gradient(145deg,#fff,#e6eaf0)}
.launch-choice strong{font-size:15px;font-weight:600;color:var(--text-primary)}
.launch-choice-copy{font-size:13px;line-height:1.5;color:var(--text-secondary);min-height:39px}
.launch-illustration-icon{height:45px;display:flex;align-items:center;color:#707b89;margin-bottom:3px}
.launch-illustration-icon svg{width:39px;height:35px;filter:drop-shadow(0 1px 0 #fff8)}
.launch-check{position:absolute;top:13px;right:13px;width:19px;height:19px;border:1px solid #c3c9d1;border-radius:50%;font-size:11px;display:grid;place-items:center;color:transparent;background:#ffffff80}
.launch-choice[aria-pressed="true"] .launch-check{background:#647488;border-color:#647488;color:white}
#modal[data-kind="launch"] .project-options{margin-top:20px;padding-top:15px;border-top:1px solid var(--border)}
#modal[data-kind="launch"] .project-options summary{font-size:13px;color:var(--text-secondary);cursor:pointer}
#modal[data-kind="launch"] #modal-submit{min-width:136px}
:root[data-theme=dark] #modal[data-kind="launch"]{background:linear-gradient(145deg,#303136,#25262a);box-shadow:0 24px 90px #0007,inset 0 1px #ffffff0a}
:root[data-theme=dark] .launch-choice{background:linear-gradient(145deg,#383a40,#2b2d32);border-color:#50545d;box-shadow:inset 0 1px #ffffff0b}
:root[data-theme=dark] .launch-choice[aria-pressed="true"]{background:linear-gradient(145deg,#414751,#30353d);border-color:#98a9be;box-shadow:0 0 0 1px #98a9be}
:root[data-theme=dark] .launch-illustration-icon{color:#c0c7d1}
:root[data-theme=dark] .launch-illustration-icon svg{filter:none}
:root[data-theme=dark] .launch-check{background:#3b3e44;border-color:#656d7a}
:root[data-theme=dark] .launch-choice[aria-pressed="true"] .launch-check{background:#acbfd6;border-color:#acbfd6;color:#232933}
@media(max-width:480px){#modal[data-kind="launch"]{padding:22px}.launch-choice{padding:14px}.launch-choice-copy{min-height:59px}}

#modal[data-kind="launch"] select{width:100%;font:inherit;min-height:42px;border:1px solid var(--border);border-radius:9px;padding:9px 12px;background-color:var(--surface);color:var(--text-primary)}
.launch-invitation{border-top:1px solid var(--border);padding-top:16px;margin-top:4px}
.launch-invitation>summary{font-size:14px;font-weight:500;cursor:pointer;color:var(--text-primary)}
.launch-invitation>summary>span{float:right;font-size:12px;font-weight:400;color:var(--text-secondary)}
#modal[data-kind="launch"] .project-options{margin-top:16px}
#modal[data-kind="launch"] .launch-invitation label{font-weight:500}
#modal[data-kind="launch"]{max-height:calc(100vh - 40px);overflow:auto}
#modal[data-kind="launch"] label{color:var(--text-secondary)}
/* One quiet control language across launch, people and session actions. */
.theme-toggle{display:grid;place-items:center;width:34px;height:34px;padding:7px;margin:0 6px 8px;border:1px solid var(--border);border-radius:50%;background:var(--surface-raised);color:var(--text-secondary);box-shadow:0 1px 3px #00000006}
.theme-toggle svg{width:19px;height:19px}.theme-sun{display:none}:root[data-theme=dark] .theme-moon{display:none}:root[data-theme=dark] .theme-sun{display:block}
#modal-title:focus{outline:none}
.launch-choice[aria-pressed="true"],:root[data-theme=dark] .launch-choice[aria-pressed="true"]{box-shadow:none;border-width:1px}
.launch-choice:focus-visible{outline:1px solid var(--text-secondary);outline-offset:3px}
.launch-invitation>.invitation-heading{display:flex;align-items:center;justify-content:space-between;font-size:14px;font-weight:550;color:var(--text-primary);margin-bottom:12px}
.launch-invitation>.invitation-heading span{font-size:12px;font-weight:400;color:var(--text-secondary)}
#modal[data-kind=launch] .launch-invitation{display:grid;grid-template-columns:minmax(0,1fr) 140px;column-gap:12px}
#modal[data-kind=launch] .invitation-heading{grid-column:1/-1}
#modal[data-kind=launch] .launch-invitation label[for=field-email]{grid-column:1;grid-row:2;margin-top:0}
#modal[data-kind=launch] #field-email{grid-column:1;grid-row:3}
#modal[data-kind=launch] .launch-invitation label[for=field-access]{grid-column:2;grid-row:2;margin-top:0}
#modal[data-kind=launch] #field-access{grid-column:2;grid-row:3;width:100%;min-width:0}
#modal[data-kind=launch] .launch-invitation label[for=field-delivery],#modal[data-kind=launch] #field-delivery{grid-column:1/-1}
.avatar,.avatar.online,.avatar.has-photo,.avatar.has-photo.online{border:0!important;box-shadow:none!important;border-radius:50%;padding:2px;width:26px;height:26px;flex-basis:26px}
.avatar.has-photo{padding:0!important}.avatar img{width:100%;height:100%;object-fit:cover;border-radius:50%}
.account .avatar{width:26px;height:26px;flex:0 0 26px}.account{gap:9px}
.workspace .session-toolbar{display:flex;flex-direction:row;flex-wrap:nowrap;gap:14px;padding:12px 18px;overflow-x:auto;overflow-y:hidden;min-height:66px;flex-shrink:0;justify-content:flex-start}
.workspace .session-heading{flex:0 0 auto;max-width:240px;min-width:130px;gap:9px}
.workspace .session-heading h2{max-width:190px}.workspace .session-heading>svg{width:23px;height:23px}
.workspace .session-actions{display:flex;flex-wrap:nowrap;flex:0 0 auto;width:auto;gap:7px}
.workspace #presence{display:none}
.workspace #workspace-team{display:flex;flex:0 0 auto;flex-wrap:nowrap;gap:10px;padding:0 0 0 12px;margin:0;overflow:visible;max-height:none;background:transparent;border:0;border-left:1px solid var(--border);border-radius:0;box-shadow:none}
.workspace #workspace-team .member-row{display:flex;flex:0 0 auto;gap:8px;padding:0;margin:0;background:transparent;border:0;border-radius:0;max-width:none;align-items:center}
.workspace #workspace-team .avatar{width:24px;height:24px;flex:0 0 24px}
.workspace #workspace-team .member-row small{display:none}
.workspace #workspace-team .member-row strong{font-size:13px;font-weight:500;max-width:140px}
.workspace #workspace-team .avatar:not(.online){filter:grayscale(1);opacity:.6}
.workspace :is(.button,.member-access),.workspace #workspace-team :is(.member-access,.invitation-link-controls .button){height:32px;min-height:32px;border:1px solid var(--border);border-radius:8px;padding:0 10px;font-size:13px;font-weight:500;line-height:30px;background-color:var(--control);color:var(--text-primary);box-shadow:none}
.workspace #workspace-team .member-access{padding-right:24px;width:90px;min-width:90px}
.workspace #workspace-team .invitation-link-controls{flex:0 0 auto!important;padding:0}
.workspace #workspace-team .invitation-link-controls .button{width:auto;min-width:78px}
.workspace #close-session{width:32px;height:32px;flex:0 0 32px;padding:0}
.code-history{justify-content:flex-end;border:0;min-height:30px;padding:0 18px}
.code-history #code-live{font-size:12px;font-weight:500;min-height:28px;padding:4px 0;border:0;color:var(--text-secondary)}
.code-history #code-live.has-new-output{border:0;font-weight:500;color:var(--text-primary)}
.code-output pre .terminal-fill{display:inline-block;vertical-align:top;height:20px;line-height:20px}
@media(max-width:480px){#modal[data-kind=launch] .launch-invitation{grid-template-columns:minmax(0,1fr) 115px}.workspace .session-toolbar{padding:10px 12px}}

/* The launch sheet keeps its geometry when optional project settings expand. */
#modal[data-kind="launch"]{height:min(660px,calc(100dvh - 40px));overflow:hidden;box-sizing:border-box}
#modal[data-kind="launch"] #modal-form{height:100%;min-height:0;display:flex;flex-direction:column}
#modal[data-kind="launch"] #modal-eyebrow{display:none}
#modal[data-kind="launch"] .modal-header{position:absolute;top:18px;right:18px}
#modal[data-kind="launch"] #modal-title{padding-right:30px;flex-shrink:0}
#modal[data-kind="launch"] #modal-description{flex-shrink:0}
#modal[data-kind="launch"] #modal-fields{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;padding:4px 5px 12px;margin:0 -5px;scrollbar-gutter:stable}
#modal[data-kind="launch"] .modal-actions{flex-shrink:0;margin-top:16px;padding-top:14px;border-top:1px solid var(--border)}
#modal[data-kind="launch"] .launch-choice:hover{filter:none;border-color:var(--text-secondary)}
#modal[data-kind="launch"] .launch-illustration-icon{flex:0 0 45px;overflow:visible}
#modal[data-kind="launch"] .launch-illustration-icon svg{flex-shrink:0;overflow:visible;filter:none}

.provider-grid{grid-template-columns:repeat(auto-fit,minmax(min(200px,100%),1fr))}

/* A distinct aluminium tile keeps transparent agent marks legible in dark mode. */
:root[data-theme=dark] .provider-icon,
:root[data-theme=dark] .launch-provider>svg,
:root[data-theme=dark] .session-item>svg,
:root[data-theme=dark] .workspace .session-heading>svg{
  background:linear-gradient(145deg,#505560,#363b44)!important;
  border:1px solid #6b728066!important;
  box-shadow:inset 0 1px #ffffff1a,0 2px 5px #0003!important;
}
:root[data-theme=dark] .launch-provider>svg{width:38px;height:38px;padding:4px;border-radius:10px;flex-shrink:0}
:root[data-theme=dark] .session-item>svg{width:28px;height:28px;padding:4px;border-radius:7px;flex-shrink:0}
:root[data-theme=dark] .workspace .session-heading>svg{width:31px;height:31px;padding:4px;border-radius:8px;flex-shrink:0}

:root[data-theme=dark] .provider-icon svg{filter:none}

/* Quiet brand watermark on the welcome screen. */
.home{position:relative;isolation:isolate}
.home::before{content:"";position:absolute;inset:0;z-index:-1;pointer-events:none;background:url('assets/enrobage-light.png') no-repeat 88% 45%;background-size:min(68vw,680px);opacity:.065;filter:grayscale(1)}
:root[data-theme=dark] .home::before{opacity:.075;filter:grayscale(1) brightness(1.5)}

/* One horizontal provider rail: available agents and clearly marked previews. */
.provider-grid{display:flex;gap:18px;overflow-x:auto;overflow-y:hidden;scroll-snap-type:x proximity;padding:4px 2px 16px;scrollbar-width:thin;overscroll-behavior-x:contain;max-width:100%}
.provider-grid>.provider-card{flex:0 0 clamp(200px,23vw,240px);scroll-snap-align:start;display:flex;flex-direction:column;text-align:left}
.provider-grid .card-top{min-height:62px;align-items:flex-start}
.provider-grid .provider-card p{min-height:48px}
.provider-grid .card-bottom{margin-top:auto;min-height:44px}
.provider-wordmark{font-size:15px;font-weight:650;letter-spacing:-.5px;color:var(--text-secondary)}
.soon-label{font-size:10px;line-height:1.4;border:1px solid var(--border);border-radius:6px;padding:3px 6px;margin-left:8px;color:var(--text-secondary);white-space:nowrap}
@media(max-width:700px){.provider-grid>.provider-card{flex-basis:210px}.provider-grid{gap:12px}}

.coding-panel.is-harness>:not(#harness-container){display:none!important}
#harness-container{flex:1;min-height:420px;height:100%;width:100%;padding:0;color:var(--text-secondary)}
#harness-container:not([hidden]){display:block}

/* The provider rail uses the window, not a narrow reading column. */
.home-content{max-width:none;min-width:0;padding-left:clamp(24px,3vw,54px);padding-right:clamp(24px,3vw,54px)}
.provider-grid{width:100%;min-width:0;padding:6px 4px 20px;scroll-padding-inline:4px}
.provider-grid>.provider-card{flex:1 0 210px;max-width:260px;min-width:0}
.provider-preview-logo{display:block;width:36px;height:36px;object-fit:contain;opacity:1}
:root[data-theme=dark] .provider-preview-logo.provider-monochrome{filter:invert(1)}

/* The rail is a scroll container, not a selectable control. */
.provider-grid:focus{outline:none}
.provider-card:focus:not(:focus-visible){outline:none}
.provider-card:focus-visible{outline:2px solid var(--text-secondary);outline-offset:2px}

.launch-agents{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin:10px 0 18px}
.launch-agent{position:relative;display:flex;align-items:center;gap:8px;padding:12px 9px;min-height:58px;border:1px solid var(--border);border-radius:11px;background:var(--control);text-align:left;font-size:12px;color:var(--text-primary)}
.launch-agent>svg{width:26px;height:26px;flex-shrink:0}.launch-agent>span:not(.agent-check){flex:1}
.launch-agent[aria-pressed=true]{border-color:#8995a5;background:var(--surface-hover)}
.agent-check{font-size:11px;opacity:0}.launch-agent[aria-pressed=true] .agent-check{opacity:1}
.launch-choice:disabled{opacity:.4;cursor:default}
@media(max-width:480px){.launch-agents{gap:5px}.launch-agent{flex-direction:column;padding:10px 5px}.agent-check{position:absolute;right:6px;top:5px}}
