#spaceDialog{box-sizing:border-box;width:min(446px,calc(100% - 28px));max-height:91dvh;overflow:auto;border:1px solid #dbe6f2;border-radius:20px;padding:22px;background:linear-gradient(155deg,#e8f2ff,#f7f9fc 60%);color:#172e4e;box-shadow:0 18px 60px #182e502e;font:14px/1.55 system-ui}
#spaceDialog::backdrop{background:#23395255;backdrop-filter:blur(4px)}
#spaceDialog header,.space-code{display:flex;align-items:center;justify-content:space-between;gap:8px}
#spaceDialog header{padding-bottom:12px;border-bottom:1px solid #d7e1ef;color:#546780;font-size:12px}
#spaceDialog h2{font-size:21px;margin:18px 0}
#spaceDialog button{font:inherit;color:#205b9f;background:white;border:1px solid #d7e1ef;border-radius:9px;padding:7px 12px;cursor:pointer}
#spaceList button,.space-create{display:block;width:100%;margin:8px 0;text-align:left}
#spaceList small{display:block;color:#64768d}
#spaceDialog .space-create{text-align:center;border-style:dashed}
#spaceDialog fieldset,#spaceResult{background:white;border:0;border-radius:13px;padding:13px;margin:12px 0}
#spaceDialog legend{font-weight:650;color:#295584}
#spaceDialog label{display:block;margin:5px 0 10px;font-size:13px}
#spaceDialog input{box-sizing:border-box;width:100%;min-width:0;border:1px solid #cfdae8;border-radius:8px;height:36px;padding:0 9px;font:inherit}
.space-code button{white-space:nowrap}
#spaceDialog .space-primary{background:#176eea;color:white;width:100%}
#spaceDialog #spaceBack{margin-top:10px}
#spaceDialog [hidden],#productModeMenu [data-space-management][hidden]{display:none!important}
#productModeMenu:not([hidden]) {width:auto;left:8px;right:8px;box-sizing:border-box;padding:8px;background:white;box-shadow:0 14px 34px #18335435,0 3px 8px #1833541c;border:1px solid #c5d4e6;border-radius:17px;max-height:calc(100vh - 78px);overflow:auto}
.app-shell .sidebar:has(#productModeMenu:not([hidden])) {z-index:100;overflow:visible}
.app-shell.sidebar-collapsed #productModeMenu:not([hidden]) {left:calc(100% + 6px);right:auto;width:min(244px,calc(100vw - 88px))}
#productModeMenu .space-identity {
  display:grid;grid-template-columns:36px minmax(0,1fr);align-items:center;gap:10px;
  height:auto;padding:16px 19px;margin:-8px -8px 5px;border:0;
  border-radius:16px 16px 0 0;background:#edf3fa;
}
#productModeMenu .identity-avatar {display:grid;place-items:center;width:36px;height:36px;border-radius:50%;background:#18385c;color:white;font-size:16px;font-weight:600}
#productModeMenu .identity-details {display:grid;min-width:0;gap:3px;line-height:1.4;overflow-wrap:anywhere}
#productModeMenu .identity-details strong {font-size:15px;font-weight:650;color:#183352}
#productModeMenu .identity-details small {font-size:12px;color:#536881}
#productModeMenu .identity-details small:last-child {font-size:11px;color:#687991;font-variant-numeric:tabular-nums}
#productModeMenu button > svg {width:16px;height:16px;flex:0 0 16px;stroke-width:1.8}
#productModeMenu .account-shortcuts {display:grid;grid-template-columns:1fr;gap:0;margin:0}
#productModeMenu .account-shortcuts button {display:grid;grid-template-columns:16px minmax(0,1fr);align-items:center;justify-items:start;gap:11px;padding:9px 11px;background:white;border-radius:8px;height:48px}
#productModeMenu > button {background:white;border-radius:8px;min-height:48px;padding-inline:14px}
#productModeMenu > button[data-account-action=logout] {position:relative;margin-top:8px;border-top:0}
#productModeMenu > button[data-account-action=logout]::before {content:"";position:absolute;inset:-5px 10px auto;height:1px;background:#e7edf4;pointer-events:none}
#productModeMenu button:hover,#productModeMenu button:focus-visible {background:#f4f7fb;color:#155eb4}


#enterprisePanel{box-sizing:border-box;width:100%;height:100%;max-width:none;max-height:none;margin:0;padding:0;border:0;background:white}
#enterprisePanel[open]{display:flex;flex-direction:column}
#enterprisePanel header{padding:7px 16px;background:#f4f8fd;border-bottom:1px solid #dae4ef}
#enterpriseReturn{background:white;color:#254669;border:1px solid #ccd9e6;border-radius:8px;padding:6px 12px;cursor:pointer}
#enterprisePanel iframe{border:0;width:100%;flex:1;min-height:0}

#spaceDialog[data-view=choices]{padding:26px;background:linear-gradient(150deg,#e8f2ff,#f4f8ff 34%,#f8fafc 75%)}
#spaceDialog[data-view=choices] header{padding-bottom:18px}
#spaceDialog[data-view=choices] h2{margin:24px 0 18px;font-size:22px;line-height:1.4}
#spaceList{display:grid;gap:10px}
#spaceList button{display:grid;grid-template-columns:40px minmax(0,1fr) 16px;align-items:center;gap:13px;min-height:76px;margin:0;padding:12px 15px;border-radius:13px;color:#1b304c;box-shadow:0 2px 6px #24466506}
#spaceList button:is(:hover,:focus-visible){background:#f8fbff;border-color:#91b7ee}
#spaceList strong{display:block;font-size:15px;line-height:1.45;font-weight:600}
#spaceList small{margin-top:3px;font-size:12px}
#spaceList .space-mark{display:grid;place-items:center;width:40px;height:40px;background:#eaf2ff;color:#2874d9;border-radius:12px}
#spaceList [data-kind=personal] .space-mark{background:#edf2f7;color:#47627d}
#spaceList .space-mark svg{width:20px;height:20px}
#spaceList button>svg{width:16px;color:#8394aa}
#spaceDialog[data-view=choices] .space-create{margin:20px 0 0;min-height:44px;background:#ffffffab;border-radius:11px}
@media(max-width:370px){#spaceDialog[data-view=choices]{padding:18px}#spaceList button{gap:9px;padding-inline:10px}}

/* The chooser occupies the enclosing desktop window; keep its reading column bounded. */
#spaceDialog[data-view=choices] {
  inset:0;margin:0;width:100%;height:100%;max-width:none;max-height:none;border:0;border-radius:0;
  padding:clamp(22px,5vh,32px) max(clamp(16px,calc(25vw - 76px),44px),calc((100% - 392px)/2));

  background:radial-gradient(ellipse at top right,#d8eaff,transparent 55%),linear-gradient(#f0f6ff,#f7f9fc 72%);
}
#spaceDialog[data-view=choices] header {font-size:14px;min-height:40px}
#spaceDialog[data-view=choices] h2 {font-size:24px;margin:clamp(24px,5vh,32px) 0 24px}
#spaceList {gap:14px}
#spaceList button {min-height:clamp(80px,13vh,83.2px);padding:14px 18px;grid-template-columns:46px minmax(0,1fr) 18px;gap:15px}
#spaceList .space-mark {width:46px;height:46px;border-radius:14px}
#spaceList strong {font-size:15px}
#spaceList small {font-size:14px}
#spaceDialog[data-view=choices] .space-create {min-height:50px;margin-top:14px;font-size:16px}
#spaceDialog:is([data-view=form],[data-view=pending]){
  inset:0;margin:0;width:100%;height:100%;max-width:none;max-height:none;border:0;border-radius:0;
  padding:calc(clamp(18px,3.5vh,26px) + max(0px,(100dvh - 760px)/2)) max(clamp(16px,calc(25vw - 76px),44px),calc((100% - 392px)/2));
  background:radial-gradient(ellipse at 95% 0%,#d6f3f5,transparent 38%),radial-gradient(ellipse at 10% 0%,#dce9ff,transparent 50%),#f6f9fd;
}
#spaceDialog:is([data-view=form],[data-view=pending]) header{min-height:40px;font-size:14px}
#spaceDialog:is([data-view=form],[data-view=pending]) h2{margin:18px 0;font-size:24px;line-height:1.35}
#enterpriseApplication{display:grid;gap:18px}
#spaceDialog #spaceResult{box-sizing:border-box;min-width:0;margin:0;padding:16px 20px;border:1px solid #dfe9f2;border-radius:16px;background:#ffffffef;box-shadow:0 3px 14px #254c7908}

#spaceDialog #enterpriseApplication label{margin:4px 0 12px;font-size:15px;font-weight:550}
#spaceDialog #enterpriseApplication input{display:block;margin-top:5px;height:42px;padding:0 12px;background:#fafcff;font-size:16px;font-weight:400}
#enterpriseApplication input:focus-visible{outline:2px solid #8cb8ff;outline-offset:1px}
#spaceDialog #spaceSend{align-self:end;min-height:42px;font-size:14px}
#spaceMessage{font-size:14px;color:#395b83}
#spaceDialog .cert-submit,#spaceDialog[data-view=pending] #spaceBack{width:100%;min-height:48px;border:0;border-radius:12px;background:linear-gradient(110deg,#0754ec,#4259e9);color:white;font-size:16px;font-weight:600;box-shadow:0 5px 15px #3459e840}
#spaceDialog[data-view=form] #spaceBack{width:100%;min-height:42px;font-size:15px}
#spaceDialog[data-view=pending] #spaceResult{padding:20px 22px;margin:12px 0 18px}
#spaceResult p{margin:0;color:#425972;font-size:16px;line-height:1.7}
.review-details{margin:18px 0 0;font-size:15px}
.review-details div{display:grid;grid-template-columns:5em 1fr;gap:12px;padding:13px 0;border-top:1px solid #e6edf4}
.review-details dt{color:#52657a}
.review-details dd{margin:0;text-align:right;overflow-wrap:anywhere}
#spaceDialog:not([data-view=pending]) .review-details{display:none}

#spaceDialog:not([data-view=form]) .cert-submit {display:none}
#spaceDialog[open][data-view=form] {
  display:grid;grid-template-columns:minmax(0,2fr) minmax(0,3fr);
  grid-template-rows:auto auto minmax(0,max-content) auto;align-content:start;column-gap:12px;overflow:hidden;

}
#spaceDialog[data-view=form] :is(header,h2,form) {grid-column:1/-1}
#spaceDialog[data-view=form] h2 {margin:15px 0}
#spaceDialog #enterpriseApplication {align-content:start;gap:12px;overflow-y:auto;overscroll-behavior:contain;padding:2px 3px 4px}
.cert-group {min-width:0;padding:14px 16px;border-radius:14px;background:white;box-shadow:0 3px 12px #233f6510}
.cert-group h3 {margin:0 0 10px;padding-bottom:8px;border-bottom:1px solid #e8eef5;color:#203d60;font-size:16px}
#spaceDialog #enterpriseApplication label {margin:8px 0 0;font-size:14px}
#spaceDialog #enterpriseApplication input {margin-top:3px;height:38px}
#enterpriseApplication .space-code {margin-top:3px}
#spaceDialog #enterpriseApplication .space-code input {margin:0}
#spaceDialog #spaceSend {min-height:38px}
#spaceDialog[data-view=form] #spaceBack,#spaceDialog[data-view=form] .cert-submit {grid-row:4;margin:10px 0 0;min-height:44px}
#spaceDialog[data-view=form] #spaceBack {grid-column:1}
#spaceDialog[data-view=form] .cert-submit {grid-column:2}

@media (min-height:740px) and (min-width:420px) {
  #spaceDialog:is([data-view=form],[data-view=pending],[data-view=choices]) {--action-inset:max(clamp(16px,calc(25vw - 76px),44px),calc((100% - 392px)/2))}
  #spaceDialog[open][data-view=form] {padding-block:calc(38px + max(0px,(100dvh - 760px)/2)) var(--access-action-bottom);grid-template-rows:auto auto minmax(0,1fr) auto}
  #spaceDialog[data-view=form] h2 {margin:18px 0}
  #spaceDialog #enterpriseApplication {gap:9px}
  #enterpriseApplication .cert-group {padding:10px 16px}
  #enterpriseApplication .cert-group h3 {margin:0 0 5px;padding-bottom:4px}
  #spaceDialog #enterpriseApplication label {margin:4px 0 0;line-height:1.35}
  #spaceDialog #enterpriseApplication input,#spaceDialog #spaceSend {height:36px;min-height:36px}
  #spaceDialog[data-view=form] :is(.cert-submit,#spaceBack) {height:var(--access-action-height)}
  #spaceDialog[data-view=pending] #spaceBack {position:absolute;left:var(--action-inset);right:var(--action-inset);bottom:var(--access-action-bottom);width:auto;height:var(--access-action-height);margin:0}
}

#spaceDialog[open][data-view=choices] {display:flex;flex-direction:column}
#spaceDialog[data-view=choices] > * {flex-shrink:0}
#spaceDialog[data-view=choices] header {margin-top:auto}
#spaceDialog[data-view=choices] #spaceBack {align-self:flex-start}
#spaceDialog[data-view=choices]::after {content:"";margin-bottom:auto}

#spaceDialog #enterpriseApplication {gap:16px;padding-inline:0}
#enterpriseApplication .cert-group {padding:14px 16px}
#enterpriseApplication .cert-group h3 {border:0;margin:0 0 8px;padding:0;color:#244265}
@media (min-width:400px) {
  #spaceDialog #enterpriseApplication label {display:grid;grid-template-columns:8em minmax(0,1fr);align-items:center;gap:8px;margin:0;padding:9px 0;border-top:1px solid #e8eef5}
  #spaceDialog #enterpriseApplication input {margin:0;padding-inline:9px;background:#f7faff;font-size:15px}
  #enterpriseApplication .space-code {margin:0;min-width:0}
  #spaceDialog #spaceSend {padding-inline:8px}
}

@media (min-height:740px) and (min-width:420px) {
  #spaceDialog #enterpriseApplication {gap:20px}
  #spaceDialog #enterpriseApplication label {padding-block:10px}
}

#spaceDialog[open]:is([data-view=choices],[data-view=form],[data-view=pending]) {padding-bottom:var(--access-action-bottom)}
#spaceDialog[data-view=choices]::after {display:none}
#spaceDialog[data-view=choices] .space-create {margin-bottom:0}

@media (max-height:739px), (max-width:419px) {
  #spaceDialog[open][data-view=form] {grid-template-rows:auto auto minmax(0,1fr) auto}
  #spaceDialog[open][data-view=pending] {display:flex;flex-direction:column;gap:12px}
  #spaceDialog[data-view=pending] #spaceBack {margin-top:auto;flex-shrink:0}
}

#spaceDialog[open]:is([data-view=choices],[data-view=form],[data-view=pending]) {
  padding-top:38px;
}
#spaceDialog:is([data-view=choices],[data-view=form],[data-view=pending]) header {
  margin:0;
  min-height:40px;
  padding-bottom:12px;
}
#spaceDialog:is([data-view=choices],[data-view=form],[data-view=pending]) h2 {
  margin:18px 0;
}
#spaceDialog[data-view=choices] #spaceChoices {
  display:flex;
  flex:1;
  min-height:0;
  flex-direction:column;
  gap:14px;
}
#spaceDialog[data-view=choices] #spaceList {
  flex:0 1 auto;
  min-height:0;
  overflow-y:auto;
  align-content:start;
}
#spaceDialog[data-view=choices] .space-create {flex:none;margin:0}
#spaceDialog[open][data-view=pending] {
  display:grid;
  grid-template-rows:auto auto minmax(0,1fr) auto;
  gap:0;
}
#spaceDialog[data-view=pending] #spaceResult {
  align-self:start;
  max-height:100%;
  overflow:auto;
  margin:0;
}
#spaceDialog[data-view=pending] #spaceBack {
  position:static;
  width:100%;
  margin:10px 0 0;
  height:var(--access-action-height);
}

#productModeMenu > button[role=menuitem] {
  display:grid;
  grid-template-columns:16px minmax(0,1fr);
  align-items:center;
  justify-items:start;
  gap:11px;
  min-height:48px;
  padding:9px 11px;
}
#productModeMenu > button[role=menuitem] strong {font-size:12px;font-weight:500;line-height:18px}

#accountMenuButton[aria-expanded="true"] {
  background:transparent;
  border-color:transparent;
  box-shadow:none;
}

#productModeMenu button:is(:hover,:focus-visible) > svg {color:#7b8b9f}
#productModeMenu button:is(:hover,:focus-visible) strong {color:#526176}

#productModeMenu button[role=menuitem] {border-radius:8px}
#productModeMenu button[role=menuitem]:is(:hover,:focus-visible) {background-color:#f4f7fb}

#spaceDialog[data-view=choices] h2 {
  color: #192b43;
  font-size: 22px;
  font-weight: 600;
  line-height: 1.4;
}
#spaceList strong { color: #26384e; font-weight: 550; }
#spaceList small { color: #63758b; font-size: 13px; font-weight: 400; }
#spaceDialog[data-view=choices] .space-create {
  border: 0;
  border-radius: 12px;
  background: linear-gradient(105deg, #1053ed, #4356ec);
  color: white;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
}
#spaceDialog[data-view=choices] .space-create:hover { filter: brightness(1.04); }
#spaceDialog[data-view=choices] .space-create:active { filter: brightness(.96); }

#spaceDialog[data-view=form] h2 {font-size:22px;font-weight:600;color:#192b43}
#enterpriseApplication .cert-group h3 {font-size:15px;font-weight:550;color:#314053}
#spaceDialog #enterpriseApplication label {font-weight:400;color:#314053}
#spaceDialog #enterpriseApplication input {
  min-width:0;border:0;border-radius:0;background:transparent;box-shadow:none;
  padding-inline:0;color:#192b43;font-size:15px;font-weight:400;
}
#spaceDialog #enterpriseApplication input:focus {outline:none}
#spaceDialog #enterpriseApplication input::placeholder {color:#9aa6b8;font-weight:300;opacity:1}
#spaceDialog #spaceSend {border:0;background:transparent;padding-inline:4px}
#spaceDialog #spaceSend:enabled {color:#176bcb;font-weight:550}
@media (min-width:400px) {
  #spaceDialog #enterpriseApplication input {text-align:right}
}
@media (forced-colors:active) {
  #spaceDialog #enterpriseApplication input:focus {outline:1px solid Highlight}
}
