/* Always-on: which theme bits are visible, and the theme toggle chrome.
   Standard (styles.css) and dark (theme-dark.css) are loaded one-at-a-time. */

html[data-theme="standard"] .theme-only-dark,
html:not([data-theme]) .theme-only-dark {
  display: none !important;
}
html[data-theme="dark"] .theme-only-standard {
  display: none !important;
}

.theme-switch {
  display: inline-flex;
  align-items: stretch;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  flex: none;
}
.theme-switch button {
  margin: 0;
  border: 0;
  border-radius: 999px;
  padding: 6px 12px;
  min-height: 0;
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.2;
  cursor: pointer;
  background: transparent;
  box-shadow: none;
  transform: none;
  white-space: nowrap;
}
.theme-switch button:hover,
.theme-switch button:active,
.theme-switch button:disabled {
  transform: none;
}

html[data-theme="standard"] .theme-switch,
html:not([data-theme]) .theme-switch {
  background: rgba(16, 32, 58, .08);
  border: 1px solid rgba(16, 32, 58, .12);
}
html[data-theme="standard"] .login .theme-switch,
html:not([data-theme]) .login .theme-switch {
  background: rgba(30, 111, 234, .1);
  border-color: rgba(30, 111, 234, .18);
}
html[data-theme="standard"] .theme-switch button,
html:not([data-theme]) .theme-switch button {
  color: #5b6d86;
  background: transparent;
  border: 0;
  box-shadow: none;
}
html[data-theme="standard"] .theme-switch button[aria-pressed="true"],
html:not([data-theme]) .theme-switch button[aria-pressed="true"] {
  background: #fff;
  color: #10203a;
  box-shadow: 0 1px 4px rgba(16, 32, 58, .12);
}
.sidebar-head {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  margin: 0 0 8px;
}
html[data-theme="standard"] .sidebar .theme-switch {
  background: rgba(255, 255, 255, .16);
  border-color: rgba(255, 255, 255, .22);
  margin: 0 4px 4px;
  align-self: stretch;
}
html[data-theme="standard"] .sidebar .theme-switch button {
  color: #d7ecff;
  flex: 1;
}
html[data-theme="standard"] .sidebar .theme-switch button[aria-pressed="true"] {
  background: #fff;
  color: #1558c4;
}

html[data-theme="dark"] .theme-switch {
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .1);
}
html[data-theme="dark"] .theme-switch button {
  color: #8b8c92;
  background: transparent;
  border: 0;
  box-shadow: none;
}
html[data-theme="dark"] .theme-switch button:hover {
  background: rgba(255, 255, 255, .05);
  color: #ececed;
  border: 0;
}
html[data-theme="dark"] .theme-switch button[aria-pressed="true"] {
  background: #2d2f36;
  color: #ececed;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
}
html[data-theme="dark"] .sidebar .theme-switch {
  margin: 0 0.25rem 0.35rem;
  align-self: stretch;
}
html[data-theme="dark"] .sidebar .theme-switch button {
  flex: 1;
}

.login-card .theme-switch {
  display: flex;
  width: 100%;
  margin: 1.25rem auto 0;
}
.login-card .theme-switch button { flex: 1; }
.login-foot {
  margin: 1.25rem 0 0;
  padding-top: 1rem;
  font-size: 12px;
  line-height: 1.45;
  letter-spacing: 0;
  color: #5b6d86;
  text-align: center;
}
html[data-theme="dark"] .login-foot {
  border-top: 1px dashed rgba(255, 255, 255, .1);
  color: #8b8c92;
}

.sidebar-fold {
  justify-content: center;
  text-align: center;
}
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 45;
  background: rgba(10, 16, 28, .45);
  border: 0;
}
.sidebar-reopen {
  display: none;
  position: fixed;
}

.shell.sidebar-collapsed .sidebar {
  width: 3.25rem;
  min-width: 3.25rem;
  padding-left: 0.4rem;
  padding-right: 0.4rem;
}
.shell.sidebar-collapsed .sidebar .sidebar-head,
.shell.sidebar-collapsed .sidebar .brand-row,
.shell.sidebar-collapsed .sidebar .theme-switch,
.shell.sidebar-collapsed .sidebar .nav-btn:not(.sidebar-fold),
.shell.sidebar-collapsed .sidebar .who,
.shell.sidebar-collapsed .sidebar [data-logout] {
  display: none !important;
}
.shell.sidebar-collapsed .sidebar-fold {
  margin-top: auto;
  width: 100%;
  min-height: 2.5rem;
  font-size: 1.25rem;
  font-weight: 700;
}

html[data-theme="standard"] .sidebar-fold,
html:not([data-theme]) .sidebar-fold {
  color: #fff;
  background: rgba(255, 255, 255, .14);
}
html[data-theme="standard"] .sidebar-fold:hover,
html:not([data-theme]) .sidebar-fold:hover {
  background: rgba(255, 255, 255, .22);
}
html[data-theme="dark"] .sidebar-fold {
  color: var(--ink-2, #b0b1b7);
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .1);
  box-shadow: none;
}

.sidebar [data-logout],
[data-logout].logout-btn,
.logout-btn[data-logout] {
  margin-top: 0.35rem;
  width: 100%;
  justify-content: center;
  font-weight: 700;
  background: #d8222f !important;
  border: 1px solid #b51b26 !important;
  color: #fff !important;
  box-shadow: none;
}
.sidebar [data-logout]:hover,
[data-logout].logout-btn:hover {
  background: #f2505c !important;
  border-color: #f2505c !important;
  color: #fff !important;
}

html[data-theme="dark"] .shell.sidebar-collapsed {
  grid-template-columns: 3.25rem minmax(0, 1fr);
  grid-template-areas: "side top" "side work";
}

.faq .help-block { margin-bottom: 8px; }
.faq .help-block pre { white-space: pre-wrap; word-break: break-word; }

@media (max-width: 800px) {
  .shell.sidebar-open .sidebar-backdrop { display: block; }
  .shell.sidebar-open .sidebar {
    display: flex !important;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(18rem, 88vw);
    z-index: 50;
    overflow: auto;
    box-shadow: 12px 0 40px rgba(0, 0, 0, .35);
  }
  .sidebar-reopen {
    display: grid;
    place-items: center;
    position: fixed;
    left: 0.75rem;
    bottom: calc(3.75rem + env(safe-area-inset-bottom, 0px));
    z-index: 30;
    min-width: 3.25rem;
    height: 2.5rem;
    padding: 0 0.85rem;
    border: 0;
    border-radius: 999px;
    font: inherit;
    font-size: 0.8125rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .28);
  }
  .shell.sidebar-open .sidebar-reopen,
  .shell.chat-open .sidebar-reopen,
  .shell.tools-open .sidebar-reopen { display: none; }
  html[data-theme="standard"] .sidebar-reopen,
  html:not([data-theme]) .sidebar-reopen {
    color: #fff;
    background: var(--blue, #1e6fea);
  }
  html[data-theme="dark"] .sidebar-reopen {
    color: #ececed;
    background: var(--raised-2, #2d2f36);
    border: 1px solid var(--line, #2c2e34);
    box-shadow: none;
    min-height: 0;
  }
}


