/* Topbar is one scoped asset for public HTML, auth and Dashboard. Page styles do not override it. */
@import url("./i18n.css");
@import url("./status-die.css");
@property --handoff-t {
  syntax: "<number>";
  inherits: true;
  initial-value: 0;
}
header.topbar {
  --max: 1180px;
  --ink: #171717;
  --muted: #666;
  --muted-2: #999;
  --line: #eaeaea;
  --soft: #fafafa;
  --primary: #000;
  --primary-ink: #fff;
  --blue: #1769ff;
  --nav-bg: rgba(255, 255, 255, 0.72);
  --button-radius: 5px;
  --radius-sm: 16px;
  --font: var(--type-sans, sans-serif);
  --mono: var(--type-mono, monospace);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 400;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  --brand-mark: 34px;
  --brand-compact-mark: 0.9;
  --brand-letter-scale: 1.7;
  --brand-tile-ms: 680ms;
  --brand-package-ms: 280ms;
  --brand-package-from: 0.82;
  --brand-package-delay: 200ms;
  --brand-die-restore-delay: 200ms;
  --brand-restore-gap: 80ms;
  --brand-solid-fit: 1.105263;
  --brand-die-from: 1;
  --brand-ecos-cap: 21px;
  --motion-duration-instant: 0ms;
  --motion-duration-feedback: 140ms;
  --motion-duration-exit: 160ms;
  --motion-duration-disclosure: 240ms;
  --motion-duration-detail: 320ms;
  --motion-duration-overlay: 280ms;
  --motion-duration-overlay-exit: 200ms;
  --motion-duration-loading: 800ms;
  --motion-duration-locate: 1600ms;
  --motion-duration-status-scan: 2400ms;
  --motion-duration-status-open: 3400ms;
  --motion-duration-demo-pulse: 1800ms;
  --motion-duration-demo-cycle: 9600ms;
  --motion-ease-standard: cubic-bezier(0.2, 0, 0, 1);
  --motion-ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --motion-ease-in: cubic-bezier(0.4, 0, 1, 1);
  --motion-ease-linear: linear;
  --motion-distance-small: 4px;
  --motion-distance-medium: 8px;
}
.topbar-mount {
  display: contents;
}
header.topbar *,
header.topbar *::before,
header.topbar *::after {
  box-sizing: border-box;
}
header.topbar a {
  color: inherit;
  text-decoration: none;
}
header.topbar button {
  font: inherit;
  cursor: pointer;
}
header.topbar p,
header.topbar form {
  margin: 0;
}
header.topbar [hidden] {
  display: none !important;
}
header.topbar :is(a, button, summary):focus-visible {
  outline: 2px solid #1769ff;
  outline-offset: 3px;
}
header.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid var(--line);
  background: var(--nav-bg);
  /* R5 frosted topbar spec (shared with the dashboard substrate and the
     app shell): .72 white over blur(20px) saturate(1.8). This file is served
     raw (no build-time prefixing), so keep both lines. */
  backdrop-filter: blur(20px) saturate(1.8);
  -webkit-backdrop-filter: blur(20px) saturate(1.8);
  /* R5 body rhythm (14px/1.55) inside the bar: without it the links/buttons
     fall back to line-height normal and the text sits ~0.8px lower than the
     dashboard's (and the link hover pill is 34px instead of R5's 39.7px). */
  line-height: 1.55;
}
header.topbar .wrap {
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
}
header.topbar .topbar-in {
  height: 72px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 18px;
}
header.topbar .brand {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  justify-self: start;
}
header.topbar .brand-mark {
  position: relative;
  width: var(--brand-mark);
  height: var(--brand-mark);
  flex: 0 0 var(--brand-mark);
  overflow: visible;
}
header.topbar .brand-mark svg {
  display: block;
  filter: var(--brand-mark-shadow);
  width: 100%;
  height: 100%;
  overflow: visible;
  shape-rendering: geometricPrecision;
}
header.topbar .wordmark {
  font-family: "Segoe UI", var(--font);
  font-size: 21px;
  font-weight: 800;
  font-style: italic;
  letter-spacing: -0.9px;
  line-height: 1;
  padding-right: 0.12em;
  color: var(--ink);
  overflow: visible;
  min-width: 0;
  width: auto;
  max-width: none;
  flex: 0 0 auto;
  opacity: 1;
}
header.topbar .brand {
  --handoff-t: 0;
  --rest-combined: calc(var(--brand-compact-mark) * var(--brand-die-from));
  --svg-s: calc(
    var(--brand-compact-mark) + (1 - var(--brand-compact-mark)) *
      var(--handoff-t)
  );
  --combined: calc(
    var(--rest-combined) + (var(--brand-letter-scale) - var(--rest-combined)) *
      var(--handoff-t)
  );
  --field-s: calc(var(--combined) / var(--svg-s));
}
header.topbar.is-compact .brand,
header.topbar.is-retracting .brand {
  --handoff-t: 1;
}
header.topbar.is-spreading .brand {
  --handoff-t: 0;
}
header.topbar.is-retracting .brand {
  animation: brand-handoff-in var(--brand-tile-ms) var(--motion-ease-out) both;
}
header.topbar.is-spreading .brand {
  animation: brand-handoff-out var(--brand-tile-ms) var(--motion-ease-out) both
    var(--brand-restore-gap);
}
header.topbar .brand-mark,
header.topbar.is-compact .brand-mark {
  width: var(--brand-mark);
  height: var(--brand-mark);
  flex: 0 0 var(--brand-mark);
  flex-basis: var(--brand-mark);
}
header.topbar .brand-mark svg,
header.topbar.is-compact .brand-mark svg,
header.topbar.is-spreading .brand-mark svg {
  transform: scale(var(--svg-s));
  transform-origin: 50% 50%;
}
header.topbar .brand-mark .tile-field,
header.topbar .brand-mark .solids,
header.topbar.is-compact .brand-mark .tile-field,
header.topbar.is-compact .brand-mark .solids,
header.topbar.is-spreading .brand-mark .tile-field,
header.topbar.is-spreading .brand-mark .solids {
  transform: scale(var(--field-s));
  transform-origin: 48px 48px;
}
header.topbar .brand-mark .letter {
  opacity: 0;
}
header.topbar .brand-mark .solid,
header.topbar.is-compact .brand-mark .solid,
header.topbar.is-spreading .brand-mark .solid {
  opacity: 1;
  transform-box: fill-box;
  transform-origin: center;
  transform: scale(calc(1 + (var(--brand-solid-fit) - 1) * var(--handoff-t)));
}
header.topbar .brand-mark .package {
  opacity: 1;
  transform-origin: 48px 48px;
  transform: scale(1);
  transition:
    transform var(--brand-package-ms) var(--motion-ease-out)
      var(--brand-package-delay),
    opacity var(--brand-package-ms) var(--motion-ease-out)
      var(--brand-package-delay);
}
header.topbar.is-compact .brand-mark .letter {
  opacity: 0;
}
header.topbar.is-spreading .brand-mark .letter {
  opacity: 0;
}
header.topbar.is-compact .brand-mark .package {
  opacity: 0;
  transform: scale(var(--brand-package-from));
  transition:
    transform var(--brand-package-ms) var(--motion-ease-in),
    opacity var(--brand-package-ms) var(--motion-ease-in);
}
header.topbar .wordmark,
header.topbar.is-compact .wordmark {
  display: flex;
  align-items: baseline;
  overflow: visible;
  letter-spacing: -0.9px;
  width: auto;
  min-width: 0;
  max-width: none;
  flex: 0 0 auto;
  opacity: 1;
  padding-right: 0.12em;
  pointer-events: auto;
}
header.topbar .ecos-run,
header.topbar .factory-run,
header.topbar .ecos-stage,
header.topbar .ecos-clip {
  display: flex;
  align-items: baseline;
}
header.topbar .ecos-stage {
  position: relative;
  overflow: visible;
}
header.topbar .ecos-clip {
  overflow: visible;
}
header.topbar .ecos-clip-white {
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  pointer-events: none;
  clip-path: polygon(
    -220px -4em,
    var(--ink-edge, 0px) -4em,
    var(--ink-edge, 0px) 8em,
    -220px 8em
  );
}
header.topbar .ecos-clip-ink {
  clip-path: polygon(
    var(--ink-edge, 0px) -4em,
    420px -4em,
    420px 8em,
    var(--ink-edge, 0px) 8em
  );
}
header.topbar .glyph {
  display: block;
  position: relative;
  flex: 0 0 auto;
  opacity: 1;
  transform: translate(0, 0) scale(1);
  transform-origin: center center;
}
header.topbar .glyph.factory {
  --travel: 0px;
}
header.topbar .glyph.ecos {
  --dx0: 0px;
  --dy0: 0px;
  --dx1: 0px;
  --dy1: 0px;
  --s: 1;
  --from-x: 0px;
  --from-y: 0px;
  --live-s: calc(var(--s) * var(--combined) / var(--brand-letter-scale));
  --fly-s: calc(1 + var(--handoff-t) * (var(--live-s) - 1));
  --fly-x: calc(
    var(--handoff-t) * (var(--dx0) + var(--handoff-t) * var(--dx1))
  );
  --fly-y: calc(
    var(--handoff-t) * (var(--dy0) + var(--handoff-t) * var(--dy1))
  );
  transform-origin: var(--from-x) var(--from-y);
  transform: translate(var(--fly-x), var(--fly-y)) scale(var(--fly-s));
}
header.topbar .ecos-clip-ink .glyph.ecos {
  color: var(--ink);
}
header.topbar .ecos-clip-white .glyph.ecos {
  color: #ffffff;
}
header.topbar .glyph.ecos .ecos-type {
  display: block;
  opacity: calc(1 - var(--handoff-t));
}
header.topbar .glyph.ecos .ecos-die {
  position: absolute;
  left: 50%;
  top: 50%;
  display: block;
  height: var(--brand-ecos-cap);
  width: auto;
  overflow: visible;
  opacity: var(--handoff-t);
  pointer-events: none;
  transform: translate(-50%, -50%);
}
header.topbar .glyph.ecos .ecos-die path {
  fill: currentColor;
}
header.topbar .ecos-clip-ink .glyph.ecos .ecos-type {
  animation: none;
  opacity: 1;
}
header.topbar .ecos-clip-ink .glyph.ecos .ecos-die {
  animation: none;
  opacity: 0;
}
header.topbar .brand,
header.topbar.is-compact .brand {
  gap: 7px;
}
header.topbar.is-compact .wordmark {
  pointer-events: none;
}
header.topbar.is-compact .glyph.factory {
  transform: translateX(var(--travel));
}
header.topbar.is-retracting .glyph.factory {
  animation: brand-factory-in var(--brand-tile-ms) both var(--delay);
}
header.topbar.is-spreading:not(.is-compact) .glyph.factory {
  animation: brand-factory-out var(--brand-tile-ms) both var(--restore-delay);
}
@keyframes brand-handoff-in {
  from {
    --handoff-t: 0;
  }
  to {
    --handoff-t: 1;
  }
}
@keyframes brand-handoff-out {
  from {
    --handoff-t: 1;
  }
  to {
    --handoff-t: 0;
  }
}
@keyframes brand-factory-in {
  0% {
    opacity: 1;
    transform: translateX(0);
    animation-timing-function: var(--motion-ease-out);
  }
  34% {
    opacity: 1;
    transform: translateX(calc(var(--travel) * 1.12));
    animation-timing-function: linear;
  }
  54% {
    opacity: 1;
    transform: translateX(calc(var(--travel) * 1.12));
    animation-timing-function: var(--motion-ease-out);
  }
  100% {
    opacity: 1;
    transform: translateX(var(--travel));
  }
}
@keyframes brand-factory-out {
  0% {
    opacity: 1;
    transform: translateX(var(--travel));
    animation-timing-function: var(--motion-ease-out);
  }
  34% {
    opacity: 1;
    transform: translateX(calc(var(--travel) * -0.12));
    animation-timing-function: linear;
  }
  54% {
    opacity: 1;
    transform: translateX(calc(var(--travel) * -0.12));
    animation-timing-function: var(--motion-ease-out);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}
header.topbar .nav {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 14px;
  justify-self: center;
}
header.topbar .nav a {
  color: var(--muted);
  padding: 9px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
header.topbar .nav a:hover {
  color: var(--ink);
  background: var(--soft);
}
header.topbar .nav a.on {
  color: var(--ink);
  background: #f2f2f2;
}
header.topbar .top-right {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 10px;
  justify-self: end;
  position: relative;
}
header.topbar .top-right .btn {
  width: 76px;
  white-space: nowrap;
}
header.topbar .top-right .btn[aria-current="page"] {
  background: #f2f2f2;
}
header.topbar .btn {
  min-height: 42px;
  padding: 0 15px;
  border: 1px solid #d9d9d9;
  border-radius: var(--button-radius);
  background: #fff;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 760;
  transition:
    transform var(--motion-duration-feedback) var(--motion-ease-standard),
    border-color var(--motion-duration-feedback) var(--motion-ease-standard),
    background var(--motion-duration-feedback) var(--motion-ease-standard),
    color var(--motion-duration-feedback) var(--motion-ease-standard);
}
header.topbar .btn:hover {
  transform: translateY(-1px);
  border-color: var(--primary);
}
header.topbar .btn.primary {
  background: var(--primary);
  color: var(--primary-ink);
  border-color: var(--primary);
}
header.topbar .btn.ghost {
  background: transparent;
}
header.topbar .btn.small {
  min-height: 34px;
  padding: 0 12px;
  font-size: 13px;
}
header.topbar .icon-btn:not(.locale-trigger) {
  position: relative;
  min-width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  background: #fff;
  border: 1px solid #d9d9d9;
  border-radius: var(--button-radius);
  color: var(--muted);
  cursor: pointer;
}
header.topbar .icon-btn:not(.locale-trigger):hover {
  border-color: var(--primary);
  color: var(--ink);
}
header.topbar .account-menu {
  position: relative;
}
header.topbar .account-menu summary,
header.topbar .bell-menu summary {
  list-style: none;
}
header.topbar .account-menu summary::-webkit-details-marker,
header.topbar .bell-menu summary::-webkit-details-marker {
  display: none;
}
header.topbar .account {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  background: #fff;
  border: 1px solid #d9d9d9;
  border-radius: var(--button-radius);
  padding: 0 12px 0 5px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 760;
  color: var(--ink);
  white-space: nowrap;
}
header.topbar .account:hover,
header.topbar .account-menu[open] .account {
  border-color: var(--primary);
}
header.topbar .avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #f2f2f2;
  color: var(--ink);
  font-size: 11px;
  font-weight: 760;
  display: grid;
  place-items: center;
}
header.topbar .who {
  width: 96px;
  max-width: 96px;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
}
header.topbar .account-menu-content {
  /* Hug the account pill. Avatar-only trigger keeps a readable min-width. */
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.12);
  display: grid;
  left: 0;
  min-width: 0;
  padding: 6px;
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  z-index: 50;
}
header.topbar .account-menu-label {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  overflow: hidden;
  padding: 8px 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
header.topbar .account-menu-sep {
  height: 1px;
  background: var(--line);
  margin: 4px 6px;
}
header.topbar .account-menu-item {
  background: transparent;
  border: 0;
  border-radius: var(--radius-sm);
  color: var(--ink);
  display: block;
  font-size: 14px;
  font-weight: 760;
  min-height: 32px;
  overflow: hidden;
  padding: 8px 9px;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 100%;
  cursor: pointer;
}
header.topbar .account-menu-item:hover {
  background: var(--soft);
}
header.topbar .account-menu-item[aria-current="page"] {
  background: #f2f2f2;
}
header.topbar .account-menu-item.danger {
  color: #b42318;
}
header.topbar .bell-menu[open] .icon-btn:not(.locale-trigger) {
  border-color: var(--primary);
  color: var(--ink);
}
header.topbar .bell-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #000;
  color: #fff;
  font-family: var(--mono);
  font-size: 10px;
  line-height: 16px;
  text-align: center;
}
header.topbar .bell-menu-content {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  z-index: 50;
  width: 372px;
  max-width: min(372px, calc(100vw - 24px));
  max-height: 70vh;
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.12);
  padding: 12px 14px;
}
header.topbar .bell-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 760;
}
header.topbar .bell-more {
  display: inline-block;
  margin-top: 8px;
  font-size: 12.5px;
  font-weight: 600;
}
header.topbar .bell-foot {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
header.topbar .notif-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
header.topbar .notif-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  height: 68px;
  box-sizing: border-box;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
  overflow: hidden;
}
header.topbar .notif-list li:last-child {
  border-bottom: 0;
}
header.topbar .n-dot {
  flex-shrink: 0;
  width: 11px;
  height: 11px;
  margin-top: 4px;
  background: var(--sd-die-pending) border-box;
  background-size: 100% 100%;
}
header.topbar .n-dot.bad {
  background-image: var(--sd-die-red);
}
header.topbar .n-dot.warn {
  background-image: var(--sd-die-current);
}
header.topbar .n-dot.ok {
  background-image: var(--sd-die-done);
}
header.topbar .n-dot.info {
  background-image: var(--sd-die-open);
}
header.topbar .n-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  min-height: 52px;
}
header.topbar .n-title-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 10px;
}
header.topbar .n-title {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-weight: 500;
}
header.topbar .n-title a {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
header.topbar .n-title a:hover {
  color: var(--primary);
}
header.topbar .notif-list li.unread-item {
  background: rgba(23, 105, 255, 0.05);
  margin: 0 -8px;
  padding-left: 8px;
  padding-right: 8px;
  border-radius: 6px;
}
header.topbar .notif-list li.unread-item .n-title {
  color: var(--ink);
  font-weight: 760;
}
header.topbar .n-sub {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  width: 100%;
  height: 32px;
  color: var(--muted);
  font-size: 12px;
  line-height: 16px;
  margin-top: 2px;
  overflow: hidden;
}
header.topbar .n-time {
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--muted);
}
header.topbar .nav a {
  width: 100px;
  text-align: center;
  font-weight: 400;
}
header.topbar .nav a:last-child {
  width: 56px;
}
header.topbar .brand {
  color: var(--ink);
}
header.topbar .wordmark .factory,
header.topbar .glyph.factory {
  color: var(--blue);
}
header.topbar .bell-head {
  color: var(--ink);
  line-height: 1.55;
}
header.topbar .bell-head .count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #f2f2f2;
  color: var(--muted);
  font: 11px var(--mono);
}
header.topbar .bell-more {
  border: 0;
  padding: 0;
  background: none;
  color: var(--blue);
  font-size: 12.5px;
  line-height: 1.55;
  font-weight: 600;
}
header.topbar .who {
  white-space: nowrap;
}
header.topbar .account-menu-item {
  border-radius: 6px;
  line-height: 1.55;
}
header.topbar details[open] > :is(.account-menu-content, .bell-menu-content) {
  animation: topbar-popover-in var(--motion-duration-disclosure)
    var(--motion-ease-out);
}
@keyframes topbar-popover-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@media (max-width: 900px) {
  header.topbar .nav {
    display: none;
  }
  header.topbar .topbar-in {
    grid-template-columns: 1fr auto;
  }
}
@media (max-width: 720px) {
  header.topbar .who,
  header.topbar .account svg {
    display: none;
  }
  header.topbar .account {
    padding: 0 5px;
  }
  header.topbar .account-menu-content {
    left: auto;
    min-width: 220px;
  }
  header.topbar .topbar-in {
    width: min(100% - 24px, var(--max));
  }
}
@media (max-width: 420px) {
  header.topbar .topbar-in {
    gap: 8px;
  }
  header.topbar .top-right {
    gap: 6px;
  }
  header.topbar .top-right .btn.small {
    padding: 0 8px;
    width: 60px;
  }
}
@media (max-width: 359px) {
  header.topbar .brand {
    --brand-mark: 24px;
    --brand-ecos-cap: 14px;
    gap: 5px;
  }
  header.topbar .wordmark {
    font-size: 14px;
  }
  header.topbar .topbar-in {
    gap: 6px;
  }
  header.topbar .top-right {
    gap: 4px;
  }
  header.topbar .top-right .btn.small {
    padding: 0 4px;
    width: 56px;
    font-size: 12px;
  }
}
@media (prefers-reduced-motion: reduce) {
  header.topbar *,
  header.topbar *::before,
  header.topbar *::after {
    animation-duration: 0ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0ms !important;
    transition-delay: 0ms !important;
  }
}
