/* Shared GRITT shell for authenticated pages outside the chat workspace.
   The menu deliberately mirrors the chat "Split rail · Air" treatment. */
@font-face {
  font-family: "Aileron GRITT UI";
  src: url("/assets/fonts/aileron/Aileron-Regular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Aileron GRITT UI";
  src: url("/assets/fonts/aileron/Aileron-SemiBold.otf") format("opentype");
  font-weight: 600 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --gritt-shell-dark: rgba(9, 9, 9, .80);
  --gritt-shell-light: rgba(244, 244, 242, .62);
  --gritt-shell-accent: rgba(250, 250, 248, .94);
  --gritt-shell-menu-width: 400px;
  --gritt-shell-menu-font-size: 10.5px;
}

html.gritt-shell-page .header {
  overflow: visible !important;
}

html.gritt-shell-page .header .wrap.nav {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  overflow: visible;
}

html.gritt-shell-page .gritt-menu-anchor {
  position: relative;
  top: 18px;
  z-index: 20;
  justify-self: center;
}

html.gritt-shell-page .header .nav-left {
  position: relative;
  justify-self: start;
}

html.gritt-shell-page .header .nav-right {
  justify-self: end;
}

html.gritt-shell-page .header .nav-brand-text,
html.gritt-shell-page .header .nav-links-row,
html.gritt-shell-page .header #logoutBtn,
html.gritt-shell-page #mobileAccountNav {
  display: none !important;
}

html.gritt-shell-page #navToggle.gritt-logo-menu {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  padding: 0;
  border: 0 !important;
  border-radius: 8px;
  background: transparent !important;
  box-shadow: none !important;
  line-height: 1;
  cursor: pointer;
  transition: transform .16s ease, filter .16s ease, background .16s ease;
}

html.gritt-shell-page #navToggle.gritt-logo-menu:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
}

html.gritt-shell-page #navToggle.gritt-logo-menu:focus-visible {
  outline: 2px solid rgba(94, 91, 178, .62);
  outline-offset: 4px;
}

html.gritt-shell-page #navToggle.gritt-logo-menu .nav-brand-logo {
  display: block;
  width: 48px;
  height: 48px;
  object-fit: contain;
}

html.gritt-shell-page #userMenu[hidden] {
  display: none !important;
}

html.gritt-shell-page #userMenu.user-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  /* The two tracks are intentionally unequal. Centre their divider on the logo,
     rather than centring the combined menu rectangle. */
  transform: translateX(calc(-50% - 46.5px));
  z-index: 9999;
  width: min(var(--gritt-shell-menu-width), calc(100vw - 36px));
  max-height: calc(100vh - 94px);
  overflow: auto;
  display: grid;
  grid-template-columns: minmax(194px, 1fr) minmax(132px, .62fr);
  align-items: start;
  gap: 4px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

html.gritt-shell-page #userMenu .menu-pane {
  display: grid;
  align-content: start;
  gap: 7px;
  min-width: 0;
  padding: 8px;
  border: 0;
  border-radius: 4px;
  background: var(--gritt-shell-dark);
  backdrop-filter: blur(11px) saturate(108%);
  -webkit-backdrop-filter: blur(11px) saturate(108%);
  box-shadow: 0 19px 42px rgba(0, 0, 0, .28);
}

html.gritt-shell-page #userMenu .menu-pane-admin {
  grid-column: 1 / -1;
}

html.gritt-shell-page #userMenu .menu-section {
  display: grid;
  align-content: start;
  gap: 3px;
  min-width: 0;
}

html.gritt-shell-page #userMenu .menu-section-title {
  padding: 0 3px 2px;
  color: rgba(255, 255, 255, .58);
  font-family: "Aileron", ui-sans-serif, system-ui, sans-serif;
  font-size: 8px;
  font-weight: 750;
  letter-spacing: .12em;
  text-transform: uppercase;
}

html.gritt-shell-page #userMenu .menu-section-links {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2px;
}

html.gritt-shell-page #userMenu .menu-section-links > .btn {
  position: relative;
  isolation: isolate;
  display: flex !important;
  width: 100%;
  min-width: 0;
  height: 27px !important;
  min-height: 26px;
  align-items: center;
  justify-content: flex-start;
  overflow: hidden;
  padding: 4px 20px 4px 7px;
  border: 0;
  border-radius: 2px;
  background: transparent;
  color: rgba(245, 248, 247, .94);
  box-shadow: none;
  font-family: "Aileron", ui-sans-serif, system-ui, sans-serif !important;
  font-size: var(--gritt-shell-menu-font-size) !important;
  font-weight: 400;
  line-height: 1.2;
  text-align: left;
  white-space: normal;
  cursor: pointer;
  opacity: 1;
}

html.gritt-shell-page #userMenu .menu-section-links > .btn::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  pointer-events: none;
}

html.gritt-shell-page #userMenu :is(.menu-section-navigation, .menu-section-report, .menu-section-business) .btn::before {
  background: linear-gradient(90deg,
    rgba(255, 255, 255, .14) 0%,
    rgba(255, 255, 255, .11) 35%,
    rgba(255, 255, 255, .075) 58%,
    rgba(255, 255, 255, .035) 81%,
    rgba(9, 9, 9, 0) 100%);
}

html.gritt-shell-page #userMenu :is(.menu-section-controls, .menu-section-session) .btn::before {
  background: linear-gradient(90deg,
    rgba(9, 9, 9, 0) 0%,
    rgba(255, 255, 255, .035) 24%,
    rgba(255, 255, 255, .075) 48%,
    rgba(255, 255, 255, .11) 72%,
    rgba(255, 255, 255, .14) 100%);
}

html.gritt-shell-page #userMenu :is(.menu-section-navigation, .menu-section-report, .menu-section-business) .btn::after {
  content: "\2192";
  position: absolute;
  right: 8px;
  color: rgba(255, 255, 255, .40);
  font-size: 12px;
}

html.gritt-shell-page #userMenu .menu-section-controls .btn::after {
  content: "";
  position: absolute;
  right: 9px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .30);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .05);
}

html.gritt-shell-page #userMenu .menu-section-controls .btn[aria-pressed="true"]::after {
  background: var(--gritt-shell-accent);
  box-shadow: none;
}

html.gritt-shell-page #userMenu :is(.menu-section-report, .menu-section-session) {
  margin-top: 5px;
}

html.gritt-shell-page #userMenu .menu-section-session .btn::before {
  background: linear-gradient(90deg,
    rgba(9, 9, 9, 0) 0%,
    rgba(255, 255, 255, .035) 30%,
    rgba(255, 255, 255, .08) 67%,
    rgba(255, 255, 255, .14) 100%);
}

html.gritt-shell-page #userMenu .menu-section-admin .menu-section-links {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

html.gritt-shell-page #userMenu .menu-section-admin .btn::before {
  background: linear-gradient(90deg, rgba(131, 145, 154, .13), rgba(131, 145, 154, .045) 70%, rgba(8, 10, 11, 0));
}

html.gritt-shell-page #userMenu .btn:hover::before {
  filter: contrast(1.22) brightness(1.12);
}

html.gritt-shell-page #userMenu .btn:focus-visible {
  outline: 2px solid rgba(255, 255, 255, .55);
  outline-offset: -2px;
}

html.gritt-shell-page[data-theme="aluminium"] #userMenu .menu-pane {
  background: var(--gritt-shell-light);
  box-shadow: 0 17px 38px rgba(24, 24, 24, .14);
}

html.gritt-shell-page body.fuga-page #userMenu .menu-section-links > .btn,
html.gritt-shell-page body.fuga-page #userMenu .menu-section-links > .btn:hover {
  text-decoration: none !important;
}

html.gritt-shell-page[data-theme="aluminium"] #userMenu .btn {
  color: #1d252b;
}

html.gritt-shell-page[data-theme="aluminium"] #userMenu :is(.menu-section-navigation, .menu-section-report, .menu-section-business) .btn::before {
  background: linear-gradient(90deg,
    rgba(32, 32, 32, .14) 0%,
    rgba(32, 32, 32, .12) 35%,
    rgba(32, 32, 32, .09) 57%,
    rgba(32, 32, 32, .04) 81%,
    rgba(32, 32, 32, 0) 100%);
}

html.gritt-shell-page[data-theme="aluminium"] #userMenu :is(.menu-section-controls, .menu-section-session) .btn::before {
  background: linear-gradient(90deg,
    rgba(32, 32, 32, 0) 0%,
    rgba(32, 32, 32, .04) 24%,
    rgba(32, 32, 32, .09) 48%,
    rgba(32, 32, 32, .12) 72%,
    rgba(32, 32, 32, .14) 100%);
}

html.gritt-shell-page[data-theme="aluminium"] #userMenu .menu-section-session .btn::before {
  background: linear-gradient(90deg, rgba(32, 32, 32, 0), rgba(32, 32, 32, .04) 28%, rgba(32, 32, 32, .09) 64%, rgba(32, 32, 32, .14));
}

html.gritt-shell-page[data-theme="aluminium"] #userMenu .menu-section-controls .btn[aria-pressed="true"]::after {
  background: rgba(32, 32, 32, .82);
  box-shadow: none;
}

html.gritt-shell-page[data-theme="aluminium"] #userMenu .btn:focus-visible {
  outline-color: rgba(32, 32, 32, .48);
}

html.gritt-shell-page[data-theme="aluminium"] #userMenu .menu-section-title {
  color: rgba(20, 24, 29, .58);
}

html.gritt-shell-page[data-theme="aluminium"] #userMenu :is(.menu-section-navigation, .menu-section-report, .menu-section-business) .btn::after {
  color: rgba(20, 24, 29, .40);
}

/* The chat workspace is the visual authority for the shared light theme. */
html.gritt-shell-page[data-theme="aluminium"],
html.gritt-shell-page[data-theme="aluminium"] body {
  --bg: #edf0f2;
  --bg-2: #f3f5f7;
  --bg-3: #e2e7eb;
  --bg-5: #edf0f2;
  --bg2: var(--bg-2);
  --bg3: var(--bg-3);
  --ink: rgba(25, 29, 34, .88);
  --muted: rgba(25, 29, 34, .62);
  --accent: #3d9982;
  --accent-2: #327e6c;
  --line: rgba(25, 29, 34, .13);
  --panel: #f3f5f7;
  --panel-bg: rgba(243, 245, 247, .94);
  --panel-bg-2: rgba(226, 231, 235, .96);
  --shadow: 0 10px 28px rgba(15, 20, 26, .12);
  --gritt-shell-accent: #3d9982;
  color-scheme: light;
  background: #edf0f2 !important;
}

html.gritt-shell-page[data-theme="aluminium"] body {
  color: var(--ink) !important;
  background:
    linear-gradient(180deg, #e6eaed 0%, #edf0f2 180px, #f3f5f7 62%, #e7ebee 100%)
    fixed !important;
}

html.gritt-shell-page[data-theme="aluminium"] :is(.account-page-title, .docs-page-title) {
  color: #327e6c !important;
}

html.gritt-shell-page[data-theme="aluminium"] :is(.panel.card, .account-hero-card, .account-section-card) {
  color: var(--ink) !important;
  border-color: var(--line) !important;
  background: rgba(243, 245, 247, .92) !important;
  box-shadow: var(--shadow) !important;
}

html.gritt-shell-page[data-theme="aluminium"] :is(.account-meta-chip, .account-security-state, .account-passkey-item) {
  color: var(--ink) !important;
  border-color: rgba(25, 29, 34, .12) !important;
  background: rgba(226, 231, 235, .66) !important;
}

html.gritt-shell-page[data-theme="aluminium"] :is(.input, input[type="text"], input[type="email"], input[type="password"], select, textarea) {
  color: var(--ink) !important;
  border-color: rgba(25, 29, 34, .14) !important;
  background: rgba(250, 249, 248, .96) !important;
}

html.gritt-shell-page[data-theme="aluminium"] :is(.input, input, textarea)::placeholder {
  color: rgba(25, 29, 34, .46) !important;
}

html.gritt-shell-page[data-theme="aluminium"] :is(.btn, .btn-link, .badge, .pill) {
  color: var(--ink);
  border-color: rgba(25, 29, 34, .14);
}

html.gritt-shell-page[data-theme="aluminium"] .btn:hover {
  background: rgba(61, 153, 130, .12);
  border-color: rgba(50, 126, 108, .42);
}

html.gritt-shell-page[data-theme="aluminium"] body.user-catalog :is(#uplForm, #ud-editorBox, #docsList .item, #prevDlg) {
  color: var(--ink) !important;
  border-color: var(--line) !important;
  background: rgba(243, 245, 247, .92) !important;
  box-shadow: 0 10px 28px rgba(15, 20, 26, .08) !important;
}

html.gritt-shell-page[data-theme="aluminium"] body.user-catalog :is(.upl-info, #docsList .item > .head) {
  border-color: rgba(25, 29, 34, .11) !important;
  background: rgba(226, 231, 235, .58) !important;
}

html.gritt-shell-page[data-theme="aluminium"] body.user-catalog :is(.upl-info-summary, .upl-info-icon, .upl-info-body) {
  color: rgba(25, 29, 34, .76) !important;
  border-color: rgba(25, 29, 34, .14) !important;
}

html.gritt-shell-page[data-theme="aluminium"] body.user-catalog :is(pre.preview, #prevText, .upl-progress-bar) {
  color: var(--ink) !important;
  border-color: rgba(25, 29, 34, .13) !important;
  background: rgba(226, 231, 235, .72) !important;
}

/* Documents owns an older set of page-local theme rules. These explicit dark
   contracts prevent light surfaces or illegible controls from leaking into a
   Carbon Steel session when the account theme changes after initial paint. */
html.gritt-shell-page[data-theme="carbon-steel"] body.user-catalog {
  --bg: #060708;
  --bg-2: #0c0e10;
  --bg-3: #14181d;
  --bg-5: #060708;
  --ink: rgba(236, 240, 245, .92);
  --muted: rgba(236, 240, 245, .68);
  --line: rgba(235, 238, 242, .14);
  color: var(--ink) !important;
  background: linear-gradient(180deg, #0c0e10 0%, #060708 55%, #0a0c0e 100%) fixed !important;
}

html.gritt-shell-page[data-theme="carbon-steel"] body.user-catalog :is(#uplForm, #ud-editorBox, #docsList .item, #prevDlg) {
  color: var(--ink) !important;
  border-color: rgba(235, 238, 242, .16) !important;
  background: linear-gradient(180deg, rgba(18, 22, 28, .86), rgba(10, 12, 14, .90)) !important;
  box-shadow: 0 18px 46px rgba(0, 0, 0, .45) !important;
}

html.gritt-shell-page[data-theme="carbon-steel"] body.user-catalog :is(.upl-info, #docsList .item > .head) {
  color: var(--ink) !important;
  border-color: rgba(235, 238, 242, .11) !important;
  background: rgba(255, 255, 255, .035) !important;
}

html.gritt-shell-page[data-theme="carbon-steel"] body.user-catalog :is(.upl-info-summary, .upl-info-icon, .upl-info-body, #ud-editorBox > summary, #ud-editorBox strong, #docsList .title) {
  color: rgba(236, 240, 245, .90) !important;
  border-color: rgba(235, 238, 242, .14) !important;
}

html.gritt-shell-page[data-theme="carbon-steel"] body.user-catalog :is(.input, input[type="text"], input[type="email"], input[type="password"], select, textarea, pre.preview, #prevText, .upl-progress-bar) {
  color: var(--ink) !important;
  border-color: rgba(235, 238, 242, .12) !important;
  background: rgba(0, 0, 0, .34) !important;
  box-shadow: none !important;
}

html.gritt-shell-page[data-theme="carbon-steel"] body.user-catalog :is(.btn, .btn-link, .badge, .pill) {
  color: rgba(236, 240, 245, .90) !important;
  border-color: rgba(235, 238, 242, .14) !important;
}

/* Silktide is appended inside body. A transformed/will-change body otherwise
   becomes the containing block for its fixed icon, making it scroll. */
html.gritt-shell-page body {
  will-change: auto !important;
}

html.gritt-shell-page #silktide-wrapper {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100dvh !important;
}

html.gritt-shell-page #silktide-cookie-icon {
  position: fixed !important;
  left: 12px !important;
  right: auto !important;
  bottom: 12px !important;
}

@media (max-width: 800px) {
  html.gritt-shell-page .header {
    position: fixed !important;
    inset: 0 0 auto 0 !important;
    z-index: 300;
  }

  html.gritt-shell-page #userMenu.user-menu {
    position: fixed;
    top: calc(var(--gritt-shell-mobile-header-h, 64px) + env(safe-area-inset-top));
    left: 12px;
    right: 12px;
    transform: none;
    width: auto;
    max-height: calc(100dvh - var(--gritt-shell-mobile-header-h, 64px) - 24px);
    grid-template-columns: 1fr;
  }

  html.gritt-shell-page #userMenu .menu-pane-admin {
    grid-column: auto;
  }

  html.gritt-shell-page #userMenu .menu-section-admin .menu-section-links {
    grid-template-columns: 1fr;
  }
}

::view-transition-group(root),::view-transition-old(root),::view-transition-new(root){animation-duration:1s}
