/* ZORDEX_SHARED_ACCOUNT_GATE_V3
   Reuse Zorqelia's auth shell; Zordex owns neither login nor registration. */
html[data-product="zordex"],
html[data-product="zordex"] body { min-height:100%; height:auto!important; overflow-x:clip!important; }
html[data-product="zordex"] body:has(#authScreen:not(.hidden)) { overflow-y:auto!important; }
html[data-product="zordex"] #authScreen { min-height:100dvh; height:auto!important; overflow:visible!important; }
html[data-product="zordex"] #authScreen .auth-x-shell {
  min-height:100dvh; transform:none!important;
  padding-top:clamp(36px,7vh,84px); padding-bottom:64px;
}
html[data-product="zordex"] body.zordex-app-mode #authScreen .auth-x-heading h1 {
  font-size:clamp(2.15rem,3.5vw,3rem)!important;
  line-height:1.08!important; overflow-wrap:anywhere;
}
html[data-product="zordex"] body.zordex-app-mode #authScreen .auth-x-heading h1::after,
html[data-product="zordex"] #authScreen .auth-x-heading h1::after { content:none!important; display:none!important; }
/* Fail open: keep the original auth form available if the gateway script failed. */
html[data-product="zordex"] #authScreen.zordex-account-gateway-ready #authForm,
html[data-product="zordex"] #authScreen.zordex-account-gateway-ready #googleSignInButton,
html[data-product="zordex"] #authScreen.zordex-account-gateway-ready .auth-x-content > .auth-divider,
html[data-product="zordex"] #authScreen.zordex-account-gateway-ready #authModeActions { display:none!important; }
html[data-product="zordex"] #zordexAccountGateway { display:grid; gap:12px; width:100%; max-width:480px; margin:0; }
html[data-product="zordex"] #zordexAccountGateway a {
  box-sizing:border-box; display:flex; align-items:center; justify-content:center;
  min-height:48px; padding:12px 18px; border-radius:999px;
  border:1px solid #536471; font:700 .91rem/1.25 system-ui,sans-serif;
  text-align:center; text-decoration:none; transition:background .15s ease;
}
html[data-product="zordex"] #zordexAccountGateway .zordex-gateway-login {
  background:#eff3f4; border-color:#eff3f4; color:#0f1419;
}
html[data-product="zordex"] #zordexAccountGateway .zordex-gateway-login:hover { background:#d7dbdc; }
html[data-product="zordex"] #zordexAccountGateway .zordex-gateway-create { background:#050505; color:#eff3f4; }
html[data-product="zordex"] #zordexAccountGateway .zordex-gateway-create:hover { background:#171b20; }
html[data-product="zordex"] #zordexAccountGateway p { color:#8b98a5; font:400 .78rem/1.5 system-ui,sans-serif; margin:0; }
@media (max-width:900px) {
  html[data-product="zordex"] #authScreen .auth-x-shell { padding-top:34px; padding-bottom:70px; }
}
html[data-product="zordex"] .zordex-origin-notice {
  box-sizing:border-box; position:fixed; bottom:12px; left:50%; transform:translateX(-50%);
  width:min(560px,calc(100% - 24px)); z-index:100000; padding:12px 42px 12px 14px;
  background:#202831; color:#fff; border:1px solid #526170; border-radius:8px;
  font:13px/1.45 system-ui; overflow-wrap:anywhere;
}
html[data-product="zordex"] .zordex-origin-notice button {
  position:absolute; top:6px; right:6px; width:28px; height:28px;
  border:0; border-radius:6px; background:transparent; color:inherit; cursor:pointer; font-size:20px;
}
@media(max-width:900px) {
  html[data-product="zordex"] #authScreen .auth-x-shell { width:min(480px,calc(100% - 32px)); grid-template-columns:minmax(0,1fr); gap:0; }
  html[data-product="zordex"] #authScreen .auth-x-art { display:none; }
}
@media(max-width:520px) {
  html[data-product="zordex"] #authScreen .auth-field-grid,
  html[data-product="zordex"] #authScreen .auth-compact-row { grid-template-columns:minmax(0,1fr); }
  html[data-product="zordex"] #authScreen .auth-x-heading h1 { font-size:1.8rem!important; }
}
html[data-oauth-return="pending"] #authScreen { visibility:hidden!important; }
.oauth-return-retry { position:fixed;inset:0;z-index:2147483647;display:grid;align-content:center;justify-items:center;gap:16px;padding:24px;background:#080a0c;color:#fff;font:15px/1.5 system-ui;text-align:center; }
.oauth-return-retry button { padding:12px 18px;border:1px solid #526170;border-radius:8px;background:#202831;color:#fff;cursor:pointer; }
.product-login-factors { box-sizing:border-box;width:min(420px,calc(100vw - 32px));max-height:calc(100dvh - 32px);overflow:auto;margin:auto;border:1px solid #3d4650;border-radius:14px;padding:24px;background:#11151a;color:#f5f7fa;box-shadow:0 24px 80px #000a;font:14px/1.5 system-ui; }
.product-login-factors::backdrop { background:#000a; }
.product-login-factors form { display:grid;gap:16px; }
.product-login-factors h2 { margin:0;font-size:1.2rem;line-height:1.3; }
.product-login-factors p { margin:0;color:#abb5c1; }
.product-login-factors label { display:grid;gap:7px; }
.product-login-factors label[hidden] { display:none!important; }
.product-login-factors input { box-sizing:border-box;width:100%;min-width:0;padding:11px;border:1px solid #526170;border-radius:7px;background:#080b10;color:#fff;font:inherit; }
.product-login-factors [data-error] { color:#ffabb0; }
.product-login-factors [data-error]:empty { display:none; }
.product-login-actions { display:flex;justify-content:flex-end;gap:10px; }
.product-login-actions button { padding:10px 14px;border:1px solid #526170;border-radius:7px;background:#202831;color:#fff;font:inherit;cursor:pointer; }
.product-login-actions button[type="submit"] { background:#eff3f4;color:#11151a;font-weight:700; }
.product-login-actions button:disabled { opacity:.6;cursor:wait; }

/* Zordex saved chats: reserve usable space and prevent nested horizontal scroll. */
body.zordex-app-mode #appSidebar {
  gap:10px;
  overflow-x:hidden;
  overflow-y:auto;
}
body.zordex-app-mode #appSidebar .sidebar-top { padding:4px 8px 10px; }
body.zordex-app-mode #appSidebar .sidebar-top > div { gap:4px; }
body.zordex-app-mode #appSidebar .signed-in { margin:4px 0 0; }
body.zordex-app-mode #appSidebar > :not(#chatListWrap) { flex-shrink:0; }
body.zordex-app-mode #appSidebar .sidebar-model-control { margin-bottom:0; }
body.zordex-app-mode #appSidebar .zordex-admin-shortcut { margin-bottom:0; }
body.zordex-app-mode #appSidebar #chatListWrap {
  flex:1 0 260px;
  min-height:260px!important;
  max-height:none;
  min-width:0;
  overflow-x:hidden!important;
  overflow-y:auto;
  scrollbar-width:thin;
  scrollbar-color:#657884 transparent;
  padding:4px 4px 8px 0;
}
body.zordex-app-mode #appSidebar #chatSectionLabel {
  display:block!important;
  margin:2px 4px 10px;
  color:#c3d3dc;
  font:700 11px/1.4 system-ui,sans-serif;
  letter-spacing:.08em;
}
body.zordex-app-mode #appSidebar #chatList,
body.zordex-app-mode #appSidebar .project-group,
body.zordex-app-mode #appSidebar .project-chat-list {
  min-width:0;
  max-width:100%;
  grid-template-columns:minmax(0,1fr);
  gap:8px;
}
body.zordex-app-mode #appSidebar .project-chat-list { margin-left:0;padding-left:7px; }
body.zordex-app-mode #appSidebar .chat-item {
  min-width:0;
  max-width:100%;
  min-height:68px;
  border:1px solid #43515d;
  border-radius:8px;
  background:#202830;
  color:#f4f7fa;
}
body.zordex-app-mode #appSidebar .chat-item:hover { border-color:#8ba9ba;background:#293640; }
body.zordex-app-mode #appSidebar .chat-item.active { border-color:#86cdbb;background:#293d40;box-shadow:inset 3px 0 #86cdbb; }
body.zordex-app-mode #appSidebar .chat-item-open { padding:11px 10px;text-align:left; }
body.zordex-app-mode #appSidebar .chat-item-title {
  color:inherit;
  display:-webkit-box;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:2;
  overflow:hidden;
  font:650 14px/1.4 system-ui,sans-serif;
  white-space:normal;
  overflow-wrap:anywhere;
}
body.zordex-app-mode #appSidebar .chat-item-meta {
  color:#bdcbd4;
  font:400 12px/1.5 system-ui,sans-serif;
  white-space:normal;
  overflow-wrap:anywhere;
}
body.zordex-app-mode #appSidebar .chat-delete-button { width:28px;margin-right:4px;color:#bdcbd4; }


