/* QShell shell — Layout + Header + Home + App page + Profile/Support panels. Ported from the design
   prototype (QShellApp.jsx). Global .qsk-* classes; glass chrome via the qsk-hasBgShell wrapper class. */

.qsk-wrapper { min-height: 100vh; background: var(--color-field-bg); display: flex; flex-direction: column; box-sizing: border-box; position: relative; }
.qsk-hasBgShell .qsk-main { background: transparent; }
.qsk-hasBgShell .qsk-appPage { background: transparent; }
.qsk-hasBgShell .qsk-header { background: var(--glass-bar); backdrop-filter: blur(var(--glass-blur)); border-bottom-color: var(--glass-border); }
.qsk-hasBgShell .qsk-header .qs-btnPrimary { background: var(--glass-pill); border-color: var(--glass-border); }
.qsk-hasBgShell .qsk-header .qs-btnPrimary:hover, .qsk-hasBgShell .qsk-header .qs-btnPrimary.qs-buttonActive { background: var(--glass-pill-hover); border-color: var(--color-primary); }
.qsk-hasBgShell .qsk-header .qs-btnSecondary { background: var(--glass-pill); box-shadow: inset 0 0 0 1px var(--glass-border); }
.qsk-hasBgShell .qsk-header .qs-btnSecondary:hover, .qsk-hasBgShell .qsk-header .qs-btnSecondary.qs-buttonActive { background: var(--glass-pill-hover); box-shadow: none; }
.qsk-hasBgShell .qs-modalContent, .qsk-hasBgShell .qsk-dockedPanel { background: var(--glass-panel); backdrop-filter: blur(var(--glass-blur)); border-left-color: var(--glass-border); }
.qsk-hasBgShell .qsk-supportTabs .qs-tabsHeader { background: var(--glass-well); box-shadow: inset 0 0 0 1px var(--glass-border); }
.qsk-hasBgShell .qsk-tabBtn.qsk-tabBtn.qs-buttonActive { background: var(--glass-pill-strong); }
[data-theme='dark'] .qsk-hasBgShell .qsk-supportTabs .qs-tabsHeader { box-shadow: none; }
[data-theme='dark'] .qsk-hasBgShell .qsk-tabBtn.qsk-tabBtn.qs-buttonActive { box-shadow: none; }
.qsk-hasBgShell .qsk-helpArea { background: transparent; }
.qsk-hasBgShell .qsk-helpSearch { background: var(--glass-field); box-shadow: inset 0 0 0 1px var(--glass-border); }
.qsk-body { display: flex; align-items: stretch; flex: 1; min-height: 0; }
.qsk-main { background: var(--color-bg); flex: 1; padding: 20px 32px; min-width: 0; position: relative; display: flex; flex-direction: column; }
.qsk-mainInner { position: relative; z-index: 1; flex: 1; display: flex; flex-direction: column; }
.qsk-footer { margin-top: auto; padding-top: 24px; display: flex; align-items: center; justify-content: center; gap: 0 8px; font-size: 12px; line-height: 16px; color: var(--color-gray-500); }
.qsk-footer img { height: 18px; display: block; }
.qsk-footer a { display: block; transition: var(--transition, 0.3s all); }
.qsk-footer a:hover { opacity: 0.7; }
.qsk-footer .qsk-logoDarkMode { display: none; }
[data-theme='dark'] .qsk-footer .qsk-logoLight { display: none; }
[data-theme='dark'] .qsk-footer .qsk-logoDarkMode { display: block; }
.qsk-dockedPanel .qsk-supportBody { flex: 1; }
.qsk-bgScrim { position: absolute; inset: 0; z-index: 0; background: var(--bg-scrim); pointer-events: none; }
[data-theme='dark'] .qsk-hasBg .qsk-appBtn:hover, [data-theme='dark'] .qsk-hasBg .qsk-appBtn.qs-buttonActive { background: rgba(39, 41, 48, 0.6); }
[data-theme='dark'] .qsk-hasBg .qsk-appImg { background: rgba(39, 41, 48, 0.7); border-color: rgba(255, 255, 255, 0.08); }
.qsk-hasBg .qsk-appBtn:hover, .qsk-hasBg .qsk-appBtn.qs-buttonActive { background: rgba(255, 255, 255, 0.6); }
.qsk-hasBg .qsk-search { background: var(--glass-field); backdrop-filter: blur(8px); box-shadow: inset 0 0 0 1px var(--glass-border); }
.qsk-bgField { width: 100%; }
.qsk-bgLabel { margin-bottom: 8px; font-size: 13px; line-height: 16px; font-weight: 500; color: var(--color-gray-500); }
.qsk-bgRow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.qsk-bgSwatch { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--color-stroke); cursor: pointer; transition: var(--transition, 0.3s all); padding: 0; display: flex; align-items: center; justify-content: center; background: var(--color-bg); }
.qsk-bgSwatch:hover { border-color: var(--color-primary); }
.qsk-bgSwatchActive { box-shadow: 0 0 0 2px var(--color-bg), 0 0 0 4px var(--color-primary); border-color: transparent; }
.qsk-bgSwatchImage { border-style: dashed; border-color: var(--color-gray-500); }
.qsk-chooseImage { margin-top: 8px; }
.qsk-chooseImage button { font-size: 12px; line-height: 16px; }
.qsk-dockedPanel { width: 348px; flex: none; background: var(--color-bg); border-left: 1px solid var(--color-stroke); overflow: hidden; display: flex; flex-direction: column; }
.qsk-supportModal { display: flex; flex-direction: column; }
.qsk-dockedPanel .qsk-supportTabs, .qsk-supportModal .qsk-supportTabs { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.qsk-dockedPanel .qsk-supportTabs > div, .qsk-supportModal .qsk-supportTabs > div { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; }
.qsk-dockedPanel .qsk-helpArea, .qsk-supportModal .qsk-helpArea { height: auto; flex: 1; }
.qsk-dockedPanel .qsk-supportBody, .qsk-supportModal .qsk-supportBody { flex: 1; }
.qsk-helpArea { padding-top: 16px; background: var(--color-bg-light); height: calc(100vh - 170px); }
.qsk-mainApp { padding: 0; }
.qsk-header { display: flex; align-items: center; justify-content: space-between; gap: 0 12px; padding: 12px; border-bottom: 1px solid var(--color-stroke); background: var(--color-bg); position: relative; z-index: 20; }
.qsk-btnBlock { margin-left: auto; display: flex; align-items: center; gap: 0 4px; }
.qsk-appList { display: flex; align-items: center; gap: 0 4px; width: 100%; max-width: calc(100% - 152px); container-type: inline-size; container-name: chips; }
.qsk-appListPage { max-width: calc(100% - 192px); }
.qsk-chipList { flex: 0 1 auto; display: flex; align-items: center; gap: 0 8px; position: relative; z-index: 20; overflow: hidden; }
.qsk-chip { flex: 0 0 auto; min-width: 100px; max-width: 200px; }

/* Width-responsive chip count: up to 8 chips, then 4, then 0 — the rest live in the overflow popover, which
   is revealed (via :has) exactly when at least one chip is hidden at the current breakpoint. */
.qsk-chip:nth-child(n+9) { display: none; }
.qsk-chipOverflow { display: none; flex: 0 0 auto; }
.qsk-appList:has(.qsk-chip:nth-child(9)) .qsk-chipOverflow { display: inline-flex; }
@container chips (max-width: 720px) {
  .qsk-chip:nth-child(n+5) { display: none; }
  .qsk-appList:has(.qsk-chip:nth-child(5)) .qsk-chipOverflow { display: inline-flex; }
}
@container chips (max-width: 380px) {
  .qsk-chip { display: none; }
  .qsk-appList:has(.qsk-chip) .qsk-chipOverflow { display: inline-flex; }
}
.qsk-overflowList { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; min-width: 200px; }
.qsk-chipBtn.qsk-chipBtn { padding: 6px 8px 6px 12px; gap: 0; }
.qsk-remove { display: flex; align-items: center; justify-content: center; margin-left: auto; cursor: pointer; }
.qsk-iconCircle { border-radius: 50%; padding: 4px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--color-stroke); background: var(--color-bg); }
.qsk-btnPrefix { display: flex; align-items: center; gap: 0 8px; }
.qsk-popoverList { display: flex; flex-direction: column; gap: 2px 0; width: 250px; padding: 4px; border-radius: var(--radius-dropdown, 12px); box-shadow: var(--shadow-popover, 0 23px 44.3px 1px #091c370f); border: 1px solid var(--color-stroke); background: var(--color-bg); max-height: 388px; overflow-y: auto; list-style: none; margin: 0; }
.qsk-popoverApp { width: 100%; min-width: 100px; }
.qsk-openedArrow { display: flex; align-items: center; justify-content: center; }
.qsk-homeHeader { padding-bottom: 20px; display: flex; align-items: center; justify-content: space-between; }
.qsk-title { font-size: 20px; line-height: 24px; font-weight: 500; color: var(--color-primary-text); margin: 0; }
.qsk-title span { color: var(--color-gray-500); }
.qsk-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 4px; list-style: none; margin: 0; padding: 0; }
.qsk-appBtn { width: 100%; padding: 16px 8px; flex-direction: column; border-radius: var(--radius-dropdown, 12px); border-color: transparent; background: transparent; }
.qsk-appBtn:hover, .qsk-appBtn.qs-buttonActive { border-color: transparent; background: var(--color-field-bg); }
.qsk-appBtn p { white-space: normal; text-align: center; font-size: 13px; line-height: 16px; }
.qsk-appImg { display: flex; align-items: center; justify-content: center; margin-bottom: 8px; width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--color-stroke); box-sizing: border-box; background: var(--color-bg); }
.qsk-appImg svg path { fill: var(--color-primary); stroke: var(--color-primary); }
.qsk-noData { color: var(--color-primary-text); }
.qsk-appPage { height: calc(100vh - 61px); background: var(--color-bg-light); display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 8px; color: var(--color-gray-500); font-size: 14px; }
.qsk-appFrame { width: 100%; height: calc(100vh - 61px); border: none; }
.qsk-profileModal { display: flex; flex-direction: column; align-items: center; padding: 32px 24px 24px; box-sizing: border-box; overflow-y: auto; }
.qsk-avatar { display: flex; align-items: center; justify-content: center; padding: 24px; width: 100px; height: 100px; border-radius: 50%; background: var(--color-field-bg); box-sizing: border-box; }
.qsk-name { font-weight: 500; margin: 16px 0 0; font-size: 20px; line-height: 24px; color: var(--color-primary-text); }
.qsk-email { margin: 4px 0 0; font-weight: 500; font-size: 14px; line-height: 100%; color: var(--color-gray-500); }
.qsk-settingsBtn { margin-top: 16px; }
.qsk-selects { width: 100%; margin-top: 20px; display: flex; flex-direction: column; gap: 20px 0; }
.qsk-logout { margin-top: auto; width: 100%; padding-top: 20px; }
.qsk-logoutBtn.qsk-logoutBtn { width: 100%; justify-content: center; background: var(--color-primary-100); color: var(--color-primary-600); border-color: transparent; }
.qsk-logoutBtn.qsk-logoutBtn:hover { background: color-mix(in oklab, var(--color-primary-100) 82%, var(--color-primary)); color: var(--color-primary-600); border-color: transparent; }
.qsk-badge { padding: 4px 8px; background: var(--color-primary-100); border-radius: var(--radius-badge, 100px); font-size: 12px; line-height: 16px; color: var(--color-primary-600); }
.qsk-supportHeader { padding: 24px 16px 16px; }
.qsk-supportTitle { font-size: 16px; line-height: 20px; font-weight: 500; color: var(--color-primary-text); margin: 0; }
.qsk-supportBody { padding: 20px; display: flex; flex-direction: column; gap: 20px 0; }
.qsk-supportName { margin: 0 0 4px; font-size: 16px; line-height: 20px; font-weight: 500; color: var(--color-primary-text); }
.qsk-supportDesc { font-size: 14px; line-height: 24px; color: var(--color-secondary-text); margin: 0; }
.qsk-contactList { display: flex; flex-direction: column; gap: 12px; list-style: none; margin: 0; padding: 0; }
.qsk-contactList li { display: flex; align-items: center; gap: 0 12px; font-size: 14px; line-height: 24px; color: var(--color-primary-text); }
.qsk-contactList li a { color: var(--color-primary); transition: var(--transition, 0.3s all); text-decoration: none; }
.qsk-contactList li a:hover { opacity: 0.7; }
.qsk-tabList { padding: 0 16px 16px; }
.qsk-tabBtn { justify-content: center; width: 100%; }
.qsk-supportTabs .qs-tabsHeader { margin: 0 16px 16px; padding: 4px; background: var(--color-field-bg); border-radius: var(--radius-pill, 40px); gap: 0 4px; }
.qsk-tabBtn.qsk-tabBtn { border-radius: var(--radius-pill, 40px); padding: 8px 12px; }
.qsk-tabBtn.qsk-tabBtn:hover { background: transparent; color: var(--color-primary-text); }
.qsk-tabBtn.qsk-tabBtn.qs-buttonActive { background: var(--color-bg); color: var(--color-primary-text); box-shadow: var(--shadow-popover, 0 23px 44.3px 1px #091c370f); }
.qsk-helpSearch { margin: 0 16px; }

@media (max-width: 992px) {
  .qsk-wrapper { flex-direction: column-reverse; height: 100vh; overflow: hidden; }
  .qsk-hasBgShell .qsk-header { border-top-color: rgba(255, 255, 255, 0.35); }
  [data-theme='dark'] .qsk-hasBgShell .qsk-header { border-top-color: rgba(255, 255, 255, 0.08); }
  .qsk-body { display: block; flex: none; }
  .qsk-main { height: calc(100vh - 94px); overflow-y: auto; padding: 16px; box-sizing: border-box; flex: none; }
  .qsk-mainApp { padding: 0; }
  .qsk-header { padding-bottom: 32px; border-bottom: none; box-shadow: var(--shadow-header-mobile, 0 -17px 20px 1px #091c3708); border-top: 1px solid var(--color-stroke); position: sticky; bottom: 0; z-index: 70; background: var(--color-bg); }
  .qsk-appList { max-width: 100%; }
  .qsk-openedBtn.qsk-openedBtn { display: flex; align-items: center; justify-content: space-between; height: 48px; color: var(--color-primary); font-size: 14px; font-weight: 400; }
  .qsk-openedArrow { transform: rotate(-90deg); }
  .qsk-popoverList { width: 100%; }
  .qsk-homeHeader { flex-direction: column; justify-content: flex-start; align-items: flex-start; gap: 16px 0; padding-bottom: 24px; }
  .qsk-search { width: 100%; box-sizing: border-box; }
  .qsk-appBtn.qsk-appBtn { padding-block: 12px; }
  .qsk-appBtn p { font-size: 13px; line-height: 16px; color: var(--color-primary-text); white-space: normal; }
  .qsk-appImg { margin-bottom: 8px; }
  .qsk-list { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
  .qsk-appPage { height: calc(100vh - 94px); }
  .qsk-appFrame { height: calc(100vh - 94px); }
  .qsk-helpArea { height: calc(100vh - 245px); }
}

@media (max-width: 375px) {
  .qsk-list { grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); }
}
