/* Keep the supplied symbol, but render the wordmark as crisp browser text. */
.app-brand {
  display: flex !important;
  align-items: center;
  gap: 6px;
  width: min(100%, 214px) !important;
  height: 60px !important;
  flex: 0 0 auto;
  overflow: visible;
  color: #192938 !important;
  white-space: nowrap;
  background: none !important;
}

.app-brand:not([data-crisp-wordmark]) {
  color: transparent !important;
  font-size: 0 !important;
}

.app-brand .brand-symbol {
  display: block;
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: url("../pwa/logo-symbol.png") center / contain no-repeat;
  background-image: image-set(
    url("../pwa/logo-symbol.png") 1x,
    url("../pwa/logo-symbol@2x.png") 2x
  );
  background-color: #f7f9f6;
}

.app-brand .brand-wordmark {
  display: block;
  padding-bottom: .1em;
  color: #000;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 17px;
  font-weight: 900;
  letter-spacing: -.65px;
  line-height: 1.16;
  white-space: nowrap;
}

.app-brand .brand-wordmark b {
  color: #000 !important;
  font: inherit;
}

:root.dark-mode .app-brand .brand-symbol {
  border-radius: 14px;
  filter: invert(1) hue-rotate(180deg) brightness(.96) contrast(1.04);
  box-shadow: none;
}

:root.dark-mode .app-brand .brand-wordmark,
:root.dark-mode .app-brand .brand-wordmark b {
  color: #f4f7f5 !important;
}

/* Neutralize the legacy divider styling applied to every span inside .brand. */
.app-brand > .brand-symbol,
.app-brand > .brand-wordmark {
  margin-left: 0 !important;
  padding-left: 0 !important;
  border-left: 0 !important;
  vertical-align: initial !important;
}

.welcome .app-brand {
  justify-content: center;
  width: max-content !important;
  max-width: 100%;
  height: 76px !important;
  gap: 8px;
}
.welcome .app-brand .brand-symbol { flex-basis: 60px; width: 60px; height: 60px; }
.welcome .app-brand .brand-wordmark { font-size: 22px; letter-spacing: -.85px; }

.welcome .welcome-intro {
  background: #fff !important;
  color: #192938 !important;
}
.welcome .welcome-intro h1,
.welcome .welcome-intro p { color: #192938 !important; }
.welcome .welcome-intro .eyebrow { color: #ee373e !important; }

/* Login is one calm, centered column: logo first, then the existing form. */
body .welcome {
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  min-height: 100dvh;
  padding: clamp(24px, 4vh, 42px) 20px 32px;
  background: #fff;
}
body .welcome .welcome-intro {
  display: block;
  width: min(100%, 440px);
  min-height: 0;
  padding: 0;
  background: transparent !important;
}
body .welcome .welcome-intro > :not(.app-brand) { display: none !important; }
body .welcome .welcome-intro .app-brand { margin: 0 auto; }
body .welcome .login-area {
  display: block;
  width: min(100%, 440px);
  padding: 0;
}
body .welcome .login-box { width: 100%; max-width: none; }

/* Give login feedback its own calm space instead of visually joining it to
   the submit button. Both the regular and observer login use this element. */
body .welcome .login-box form > .error {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  margin: 18px 0 14px;
  padding: 13px 18px;
  border: 1px solid #f0c2c6;
  border-radius: 12px;
  background: #fff6f6;
  color: #a91f2a;
  text-align: center;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.45;
}

body .welcome .login-box form > .error + .primary.wide {
  margin-top: 0;
}

body .welcome .login-progress {
  margin: 18px 0 22px;
  padding: 17px 18px;
  border-color: #dce4e0;
  border-radius: 12px;
  text-align: center;
}

body .welcome .login-progress-heading {
  position: relative;
  display: block;
  margin-bottom: 13px;
  padding: 0 42px;
}

body .welcome .login-progress-heading > span {
  display: block;
  text-align: center;
  font-weight: 500;
}

body .welcome .login-progress-heading small {
  position: absolute;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  font-weight: 400;
}

@media screen and (max-width: 700px) {
  body .welcome { padding: 24px 18px; }
  body .welcome .app-brand { width: max-content !important; max-width: 100%; height: 66px !important; }
  body .welcome .app-brand .brand-symbol { flex-basis: 52px; width: 52px; height: 52px; }
  body .welcome .app-brand .brand-wordmark { font-size: 19px; letter-spacing: -.7px; }
  body .welcome .login-box form > .error {
    min-height: 50px;
    margin-top: 16px;
    padding: 12px 14px;
    font-size: 13px;
  }
}

.mobile-brand.app-brand {
  width: 225px !important;
  height: 52px !important;
  gap: 5px;
}
.mobile-brand.app-brand .brand-symbol { flex-basis: 43px; width: 43px; height: 43px; }
.mobile-brand.app-brand .brand-wordmark { font-size: 15.5px; letter-spacing: -.6px; }

@media screen and (max-width: 370px) {
  .app .topbar { padding-inline: 9px; }
  .mobile-brand.app-brand { width: min(215px, calc(100vw - 138px)) !important; height: 52px !important; }
}

@media screen and (min-width: 701px) {
  /* The top-bar copy is mobile-only; desktop keeps the breadcrumb at the left. */
  .mobile-brand.app-brand { display: none !important; }
  .app .sidebar { padding-top: 10px; }
  .app .sidebar::after {
    content: "";
    position: absolute;
    z-index: 1;
    top: 79px;
    left: 0;
    right: 0;
    border-top: 1px solid #dce2df;
    pointer-events: none;
  }
  .app .sidebar > .app-brand {
    width: 100% !important;
    height: 60px !important;
    margin-inline: 0;
    gap: 12px;
    justify-content: flex-start;
    text-align: left !important;
  }
  .app .sidebar > .app-brand .brand-symbol {
    flex-basis: 40px;
    width: 40px;
    height: 40px;
    border-radius: 12px;
  }
  .app .sidebar > .app-brand .brand-wordmark {
    font-size: 14.5px !important;
    letter-spacing: -.6px;
  }
  /* Join the sidebar divider to the bottom edge of the 80px desktop top bar. */
  .app .sidebar .workspace-name { margin: 12px 0 30px; border-top: 0; }
}

@media print {
  .app-brand .brand-symbol { background-image: url("../pwa/logo-symbol.png") !important; }
}
