/* The header every hdadmin.com site wears: the family row, the section row,
   the narrow-screen menu and the account chip with its notifications. The
   three apps import this from packages/ui. The docs carry a copy that
   build.sh refreshes into apps/docs/shared/stylesheets/chrome.css from
   here, so edit THIS file, never the copy */

:root {
  --bg: #0e1119;
  --panel: #0b1120;
  --border: rgba(125, 151, 255, 0.14);
  --text: #eef1fb;
  --muted: #97a0b8;
  --blue-soft: #5c7cff;
  --link: #7d97ff;
  --danger: #ff6b81;
  --font-heading: "Outfit", system-ui, sans-serif;
  --font-body: "Manrope", system-ui, sans-serif;
  --font-ui: "Inter", system-ui, sans-serif;
  --grad-1: #22307c;
  --grad-2: #1a2560;
  --grad-3: #131b48;
  --tint: 92, 124, 255;
  --strong-tint: 51, 95, 255;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 150ms;
  --dur: 300ms;
}

/* Outfit has no Cyrillic, so a page in Russian sets its headings in Manrope
   rather than mixing two faces inside one word */
:root:lang(ru) {
  --font-heading: "Manrope", system-ui, sans-serif;
}

/* Korean breaks lines between words, the way Korean pages are set, and
   Korean and Thai take the device's own fonts for their letters */
:root:lang(ko) body {
  word-break: keep-all;
  overflow-wrap: break-word;
}

/* ---- the two rows ---- */

/* The bar alone sticks, above the page AND the modal fade (z 10), so popups
   dim everything below the topbar items. The section row rides in the flow
   beneath it and leaves with the page, the docs' default. Both rows draw
   the same left-to-right gradient, so they read as one block at the top */
.chrome {
  position: sticky;
  top: 0;
  z-index: 20;
  background: linear-gradient(90deg, var(--grad-1) 0%, var(--grad-2) 55%, var(--grad-3) 100%);
  transition: box-shadow var(--dur-fast) ease;
}

/* The tinted hairline and blue glow that underline the chrome. They sit
   under the section row while it shows and move up to the bar once the row
   has scrolled under it, which SiteChrome watches for */
.chrome-stuck {
  box-shadow: 0 1px 0 rgba(var(--tint), 0.25), 0 4px 24px rgba(var(--strong-tint), 0.15);
}

/* Material's canonical 48px header scale, sized to how the docs read */
.topbar-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 48px;
}

.topbar-spacer {
  flex: 1 1 0;
  min-width: 8px;
}

.brand-home {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

/* No CSS radius. The logo PNG carries its own corners, and re-rounding a
   24px render shaves the square into looking cropped */
.brand-home .brand-mark {
  width: 24px;
  height: 24px;
  display: block;
  object-fit: contain;
}

/* The family, the sites in their fixed order, set exactly like the section
   row below. The one you are on is simply bold */
.family {
  display: flex;
  align-items: stretch;
  align-self: stretch;
  margin-left: 2px;
}

.family-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 12px;
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  opacity: 0.6;
  white-space: nowrap;
  text-decoration: none;
  transition: opacity 250ms ease;
}

.family-link:hover {
  opacity: 1;
  color: #fff;
}

.family-link:focus-visible {
  outline-offset: -3px;
  border-radius: 8px;
  opacity: 1;
}

.family-link-active {
  opacity: 1;
  font-weight: 700;
}

/* Each site's mark, the landing's own, beside its name */
.family-icon {
  flex: none;
  width: 16px;
  height: 16px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

/* The section row, the site's own pages, translucent navy over the bar's
   gradient. Positioned so its glow paints over the page below, not under */
.tabs {
  position: relative;
  z-index: 1;
  background: linear-gradient(rgba(14, 17, 25, 0.6), rgba(14, 17, 25, 0.6)),
    linear-gradient(90deg, var(--grad-1) 0%, var(--grad-2) 55%, var(--grad-3) 100%);
  border-bottom: 1px solid #232c3e;
  box-shadow: 0 1px 0 rgba(var(--tint), 0.25), 0 4px 24px rgba(var(--strong-tint), 0.15);
}

.tabs > .container {
  display: flex;
  align-items: center;
  height: 48px;
  overflow: visible;
}

/* Material's link model: white at 0.7, full strength on hover, no recolour */
.tab {
  display: flex;
  align-items: center;
  height: 100%;
  flex-shrink: 0;
  padding: 0 12px;
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  color: #fff;
  opacity: 0.6;
  transition: opacity 250ms ease;
}

/* The first label's own padding would push its text off the container line */
.tab:first-child {
  margin-left: -12px;
}

.tab:hover:not(.tab-active) {
  opacity: 1;
}

/* The popout marker on a tab that opens a new page */
.tab-ext {
  margin-left: 6px;
  flex-shrink: 0;
}

/* Inset so the tabs row's scroll clipping can't slice the ring */
.tab:focus-visible {
  outline-offset: -3px;
  border-radius: 8px;
  opacity: 1;
}

.tab-active {
  opacity: 1;
  font-weight: 600;
}

/* Sits before the first pushRight item and eats the slack, sending it and
   everything after it to the right-hand end */
.tab-spacer {
  flex: 1;
}

/* ---- the narrow-screen menu, in the topbar like the docs drawer ---- */

.nav-menu {
  display: none;
  align-items: center;
  min-width: 0;
}

.nav-menu-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  margin-left: -10px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #fff;
  cursor: pointer;
  transition: background var(--dur-fast) ease;
}

.nav-menu-btn:hover,
.nav-menu-btn[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.12);
}

/* The button's three lines, which fold into a cross while the drawer is
   open: the outer two swing to the middle and the middle one shrinks away.
   The docs' button is Material's drawer label, so it follows the drawer's
   checkbox instead of an expanded state */
.burger path {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  transition: transform var(--dur) var(--ease-out), opacity var(--dur-fast) ease;
}

.burger-top {
  transform-origin: 12px 7px;
}

.burger-mid {
  transform-origin: 12px 12px;
}

.burger-bot {
  transform-origin: 12px 17px;
}

.nav-menu-btn[aria-expanded="true"] .burger-top,
#__drawer:checked ~ .md-header .burger-top {
  transform: translateY(5px) rotate(45deg);
}

.nav-menu-btn[aria-expanded="true"] .burger-mid,
#__drawer:checked ~ .md-header .burger-mid {
  opacity: 0;
  transform: scaleX(0);
}

.nav-menu-btn[aria-expanded="true"] .burger-bot,
#__drawer:checked ~ .md-header .burger-bot {
  transform: translateY(-5px) rotate(-45deg);
}

/* The section you are on, beside the mark where the family row was */
.nav-menu-title {
  display: none;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 17px;
  line-height: 26px;
  color: #fff;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Dims the page while the panel is open, and the page holds still behind
   it. It sits just under the chrome's own layer, so the bar and the panel
   stay bright above it */
.nav-menu-scrim {
  position: fixed;
  inset: 0;
  z-index: 19;
  background: rgba(5, 7, 12, 0.55);
  animation: fade-in var(--dur-fast) ease both;
}

/* The lock goes on the root, whose overflow the viewport takes. On the body
   it would make the body its own scroll box, since the root already clips
   sideways, and the sticky bar would stick to the page's top, not the
   screen's, gone whenever the page is scrolled */
html.nav-menu-open {
  overflow: hidden;
}

/* The drawer, the docs' one on every site: it slides in from the left under
   the bar, part of the width and the rest of the height, and scrolls on
   its own while the page holds still */
.nav-menu-drawer {
  position: fixed;
  top: 48px;
  bottom: 0;
  left: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  width: 242px;
  max-width: calc(100vw - 56px);
  padding: 10px 8px 20px;
  overflow-y: auto;
  background: var(--panel);
  border-right: 1px solid rgba(var(--tint), 0.18);
  box-shadow: 8px 0 32px rgba(0, 0, 0, 0.45);
  animation: slide-in var(--dur) var(--ease-out) both;
}

/* The site's own pages, stepped in under its name with a guide line down
   from its mark, the way a tree shows children */
.nav-menu-sub {
  display: flex;
  flex-direction: column;
  margin: 2px 0 6px 22px;
  padding-left: 18px;
  border-left: 1px solid rgba(var(--tint), 0.3);
}

.nav-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 10px;
  border-radius: 10px;
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: background var(--dur-fast) ease, color var(--dur-fast) ease;
}

.nav-menu-item:hover {
  background: rgba(var(--tint), 0.08);
}

.nav-menu-item-active,
.nav-menu-item-active:hover {
  color: var(--link);
  background: rgba(var(--tint), 0.14);
}

.nav-menu-icon {
  flex: none;
  width: 20px;
  height: 20px;
  opacity: 0.9;
}

/* A step smaller and lighter than the sites, so they read as children */
.nav-menu-item-sub {
  padding: 10px;
  font-size: 14px;
  font-weight: 500;
}

/* Below this the labels stop fitting, so both rows give way to the menu.
   Every site shares the number so they never disagree about where mobile
   starts */
@media (max-width: 780px) {
  .tabs,
  .family {
    display: none;
  }

  /* No section row to carry the glow here, so the bar always does */
  .chrome {
    box-shadow: 0 1px 0 rgba(var(--tint), 0.25), 0 4px 24px rgba(var(--strong-tint), 0.15);
  }

  .nav-menu {
    display: flex;
  }

  .nav-menu-title {
    display: block;
  }
}

/* A phone's bar holds the menu, the mark, the site's name, search, the flag
   and Sign in. At the desktop gaps the name was cut on a 360px phone, so
   the gaps tighten there, and the name's type steps down on the narrowest */
@media (max-width: 480px) {
  .topbar-inner {
    gap: 8px;
  }

  .topbar-spacer {
    min-width: 0;
  }

  .topbar-right {
    gap: 8px;
  }

  /* Named through its parent to outrank the button's own rule further down */
  .topbar-right .topbar-signin {
    gap: 6px;
    padding: 7px 12px 7px 10px;
  }
}

/* Narrow phones, where a longer language still has to fit: German reads
   Erkunden and Anmelden, French Explorer and Connexion, where English reads
   Explore and Sign in */
@media (max-width: 400px) {
  .nav-menu-title {
    font-size: 15px;
  }

  .topbar-right .topbar-signin {
    gap: 5px;
    padding: 7px 10px 7px 8px;
    font-size: 12px;
  }

  .topbar-right .topbar-signin svg {
    width: 13px;
    height: 13px;
  }
}

@media (max-width: 374px) {
  .topbar-inner {
    gap: 6px;
  }
}

/* ---- the account chip ---- */

.profile-menu {
  position: relative;
}

.profile-chip {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 12px 4px 5px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  cursor: pointer;
  transition: background var(--dur-fast) ease;
}

.profile-chip:hover,
.profile-chip[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.14);
}

.nb-avatar {
  display: block;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  object-fit: cover;
}

/* A tinted initial stands in when someone has no headshot, or when the one
   we have stops loading */
.nb-avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: hsl(var(--hue, 225) 45% 34%);
  color: #fff;
  font-family: var(--font-ui);
  font-weight: 700;
  line-height: 1;
}

.profile-avatar {
  flex-shrink: 0;
}

.profile-name {
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 600;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* The name is what pushes the topbar past narrow screens, the avatar
   carries the meaning on its own there */
@media (max-width: 560px) {
  .profile-name {
    display: none;
  }
}

.profile-caret {
  opacity: 0.7;
  transition: transform var(--dur-fast) ease;
}

.profile-caret-open {
  transform: rotate(180deg);
}

/* The unread count, anchored to the chip's corner */
.profile-badge {
  position: absolute;
  top: -3px;
  left: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-family: var(--font-ui);
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1;
}

.profile-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  /* The tabs are stacking contexts (opacity) painted after the topbar, so
     without this they draw over the open menu */
  z-index: 2;
  min-width: 320px;
  padding: 6px;
  background: var(--panel);
  border: 1px solid rgba(var(--tint), 0.18);
  border-radius: 12px;
  box-shadow: 0 0 0 1px rgba(var(--tint), 0.06), 0 12px 32px rgba(0, 0, 0, 0.45), 0 0 32px
    rgba(var(--tint), 0.08);
  animation: rise-in var(--dur-fast) var(--ease-out) both;
}

@media (max-width: 400px) {
  .profile-dropdown {
    min-width: 0;
    width: calc(100vw - 32px);
  }
}

.profile-item {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--dur-fast) ease;
}

.profile-item:hover {
  background: rgba(var(--tint), 0.1);
  color: var(--text);
}

.profile-item-danger,
.profile-item-danger:hover {
  color: var(--danger);
}

.topbar-signin {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px 7px 12px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--dur-fast) ease;
}

.topbar-signin:hover {
  background: rgba(255, 255, 255, 0.18);
}

.topbar-signin:disabled {
  opacity: 0.7;
  cursor: default;
}

/* The docs render the chip from a script, so the slot holds its width from
   the cookie until then and the header never shifts */
.nb-account {
  display: flex;
  align-items: center;
  min-height: 36px;
}

.nb-account[data-nb-signed="1"]:empty {
  min-width: 132px;
}

.nb-account[data-nb-signed="0"]:empty {
  min-width: 86px;
}

/* ---- notifications, the feed above the menu items ---- */

.profile-dropdown-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 8px 10px 4px;
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.notice-clear {
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--link);
}

.notice-clear:hover {
  text-decoration: underline;
}

.profile-notices {
  max-height: 340px;
  overflow-y: auto;
  margin-bottom: 6px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.notice-rows {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.notice-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  color: var(--text);
  text-decoration: none;
}

.notice-row:hover {
  background: rgba(var(--tint), 0.08);
}

.notice-row-unseen {
  background: rgba(var(--tint), 0.1);
}

.notice-actor {
  flex-shrink: 0;
  display: inline-flex;
}

.notice-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.notice-line {
  font-family: var(--font-body);
  font-size: 13.5px;
  line-height: 1.35;
}

.notice-when {
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--muted);
}

.notice-empty {
  margin: 6px 10px 10px;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--muted);
}

.notice-badge {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(var(--tint), 0.12);
  font-size: 15px;
}

/* ---- the dashboard's demo pill, explained on hover ---- */

.demo-tag {
  position: relative;
  margin-left: 0;
  cursor: help;
}

.demo-tag::after {
  content: attr(data-tip);
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 250px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
  text-transform: none;
  letter-spacing: normal;
  text-align: left;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  transition: opacity var(--dur-fast) ease, transform var(--dur-fast) ease;
  z-index: 30;
}

.demo-tag:hover::after,
.demo-tag:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slide-in {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(0);
  }
}

/* The language picker, the flag and the code of the language in use, see
   LANGUAGE-PLAN.md. A details element, so on the docs it opens with no
   script at all. Each language is listed in its own words beside its flag */
.lang-pick {
  position: relative;
}

/* A flag is drawn in a 60 by 40 box (packages/i18n/languages.json) and shown
   as its middle, clipped round, the way benicja.com shows its own */
.lang-flag {
  display: block;
  flex: none;
  width: 18px;
  height: 18px;
  overflow: hidden;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.22);
}

.lang-flag svg {
  display: block;
  width: 100%;
  height: 100%;
}

.lang-button {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 11px 0 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  list-style: none;
  cursor: pointer;
  user-select: none;
  transition: background var(--dur-fast) ease;
}

.lang-button::-webkit-details-marker {
  display: none;
}

.lang-button:hover,
.lang-pick[open] .lang-button {
  background: rgba(255, 255, 255, 0.14);
}

.lang-globe {
  flex: none;
  width: 18px;
  height: 18px;
  opacity: 0.85;
}

.lang-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 2;
  min-width: 190px;
  padding: 6px;
  background: var(--panel);
  border: 1px solid rgba(var(--tint), 0.18);
  border-radius: 12px;
  box-shadow: 0 0 0 1px rgba(var(--tint), 0.06), 0 12px 32px rgba(0, 0, 0, 0.45), 0 0 32px
    rgba(var(--tint), 0.08);
  animation: rise-in var(--dur-fast) var(--ease-out) both;
}

.lang-option {
  display: flex;
  align-items: center;
  gap: 10px;
  box-sizing: border-box;
  width: 100%;
  padding: 9px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--dur-fast) ease;
}

.lang-option:hover {
  background: rgba(var(--tint), 0.1);
  color: var(--text);
}

/* The name takes the room, so the dot of the one in use sits at the end */
.lang-name {
  flex: 1;
}

.lang-option[aria-current="true"]::after {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--blue-soft);
}

/* A phone's bar has no room for the code beside Sign in without cutting the
   site's name, so there the button is the flag alone, in a round the size
   of the search button beside it. The button is the one place to change
   language, so it stays on the narrowest screens too, where the site's name
   gives way to it */
@media (max-width: 560px) {
  .lang-button {
    justify-content: center;
    width: 32px;
    padding: 0;
  }

  .lang-code {
    display: none;
  }

  .lang-button .lang-flag {
    width: 20px;
    height: 20px;
  }
}

/* The one-time offer to a visitor whose country speaks one of our languages
   while their browser asks for English. It never switches by itself */
.lang-offer {
  position: fixed;
  right: 0;
  bottom: 20px;
  left: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 14px;
  width: fit-content;
  max-width: calc(100vw - 32px);
  margin: 0 auto;
  padding: 10px 10px 10px 18px;
  background: var(--panel);
  border: 1px solid rgba(var(--tint), 0.22);
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5), 0 0 32px rgba(var(--tint), 0.1);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  animation: rise-in var(--dur) var(--ease-out) both;
}

.lang-offer-text {
  margin: 0;
}

.lang-offer-actions {
  display: flex;
  flex: none;
  gap: 8px;
}

.lang-offer-accept,
.lang-offer-keep {
  padding: 7px 14px;
  border: 0;
  border-radius: 999px;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.lang-offer-accept,
.lang-offer-accept:hover {
  background: rgb(var(--strong-tint));
  color: #fff;
}

.lang-offer-keep {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

@media (max-width: 560px) {
  .lang-offer {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    width: auto;
    margin: 0 16px;
    padding: 14px;
    text-align: center;
  }

  .lang-offer-actions {
    justify-content: center;
  }
}
