/* Homepage navigation and its dialogs; shared page headers keep their own layout. */
body.home-page .site-header.home-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  width: 100%;
  max-width: 1360px;
  height: 72px;
  min-height: 72px;
  margin: 0 auto;
  padding: 0 24px;
}

.home-header .brand {
  gap: 11px;
  min-height: 48px;
  min-width: 0;
  border-radius: 7px;
}

.home-header .brand img {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
}

.home-header .brand strong {
  font-size: 20px;
  line-height: 1.2;
}

.home-header .brand small.brand-tagline {
  display: block;
  margin-top: 3px;
  font-size: 10px;
  line-height: 1.5;
  letter-spacing: .1em;
}

.home-header .header-primary-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 0;
}

.home-header .header-primary-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 10px 12px;
  border-radius: 8px;
  color: #bfd1de;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.5;
  white-space: nowrap;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 6px;
}

.home-header .header-primary-nav a:hover,
.home-header .header-primary-nav a[aria-current] {
  color: var(--ink);
  text-decoration-color: var(--mint);
}

.home-header .header-actions {
  gap: 10px;
  min-width: 0;
}

.home-header .auth-signin-btn,
.home-header .auth-account-btn,
.home-header .get-app-toggle,
.home-header .header-more-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  height: auto;
  padding: 10px 13px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.5;
  cursor: pointer;
  transform: none;
  transition: none;
}

.home-header .auth-signin-btn {
  border: 1px solid transparent;
  background: transparent;
  color: #bfd1de;
}

.home-header .auth-signin-btn:hover {
  background: #ffffff08;
  color: var(--ink);
}

.home-header .auth-account-btn {
  max-width: 190px;
  padding-left: 7px;
  border: 1px solid transparent;
  background: transparent;
}

.home-header .auth-account-btn:hover {
  border-color: var(--line);
  background: #ffffff08;
}

.home-header .auth-avatar {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
}

.home-header .auth-name {
  max-width: 112px;
  font-size: 14px;
}

.home-header .get-app-toggle,
.home-header .header-more-toggle {
  border: 1px solid #3c716d;
  background: transparent;
  color: var(--mint);
  white-space: nowrap;
}

.home-header .get-app-toggle:hover,
.home-header .header-more-toggle:hover {
  border-color: var(--mint);
  background: #56d9c00b;
  transform: none;
}

.home-header .get-app-toggle svg,
.home-header .header-more-toggle svg {
  width: 19px;
  height: 19px;
  flex: 0 0 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.home-header .header-more-toggle,
.home-header .auth-signin-btn[hidden],
.home-header .auth-account[hidden],
.home-header .get-app-toggle[hidden] {
  display: none;
}

.home-header :is(a, button):focus-visible,
body.home-page :is(.header-more-dialog, .header-account-dialog, .header-install-dialog) :is(a, button, summary):focus-visible {
  outline: 3px solid var(--mint);
  outline-offset: 3px;
}

body.home-page :is(dialog.header-more-dialog, dialog.header-account-dialog, dialog.header-install-dialog) {
  position: fixed;
  inset: 0;
  width: min(460px, calc(100% - 32px));
  height: fit-content;
  max-width: none;
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 20px;
  border: 1px solid #36586e;
  border-radius: 22px;
  background: #0d2235;
  color: var(--ink);
  box-shadow: 0 24px 80px #0008;
  overflow: auto;
  overscroll-behavior: contain;
}

body.home-page dialog.header-more-dialog {
  width: min(400px, calc(100% - 32px));
}

body.home-page dialog.header-account-dialog {
  width: min(360px, calc(100% - 32px));
}

body.home-page :is(dialog.header-more-dialog, dialog.header-account-dialog, dialog.header-install-dialog):not([open]),
body.home-page dialog.auth-modal-overlay:not([open]) {
  display: none;
}

body.home-page :is(dialog.header-more-dialog, dialog.header-account-dialog, dialog.header-install-dialog)[open] {
  display: block;
}

body.home-page :is(.header-more-dialog, .header-account-dialog, .header-install-dialog, dialog.auth-modal-overlay) [hidden] {
  display: none !important;
}

body.home-page :is(dialog.header-more-dialog, dialog.header-account-dialog, dialog.header-install-dialog, dialog.auth-modal-overlay)::backdrop {
  background: #030c16b8;
}

body.home-page .header-dialog-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

body.home-page .header-dialog-heading h2 {
  min-width: 0;
  margin: 0;
  font-size: 23px;
  line-height: 1.25;
  letter-spacing: -.025em;
}

body.home-page .header-dialog-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: transparent;
  color: #bed2e0;
  font-size: 25px;
  line-height: 1;
  cursor: pointer;
}

body.home-page .header-dialog-close:hover {
  border-color: #557c94;
  background: #ffffff08;
  color: var(--ink);
}

body.home-page .header-more-links {
  display: grid;
  gap: 3px;
}

body.home-page .header-more-links > :is(a, button),
body.home-page .header-account-dialog .auth-panel-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  padding: 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #d1e1ec;
  font: inherit;
  font-size: 16px;
  line-height: 1.5;
  text-align: left;
  overflow-wrap: anywhere;
  cursor: pointer;
}

body.home-page .header-more-links > :is(a, button):hover,
body.home-page .header-account-dialog .auth-panel-item:hover {
  background: #ffffff08;
  color: var(--mint);
}

body.home-page .header-more-links svg {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

body.home-page #accountSheetName {
  margin: 0 0 5px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

body.home-page #accountSheetEmail {
  margin: 0 0 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
  color: #afc3d1;
  font-size: 14px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

body.home-page #installDescription {
  margin: 0 0 16px;
  color: #bed0dd;
  font-size: 16px;
  line-height: 1.6;
}

body.home-page #installPlatform {
  margin: 0 0 12px;
  color: var(--mint);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
}

body.home-page #installPrimary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  width: 100%;
  padding: 12px 16px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: var(--mint);
  color: #05211c;
  font: inherit;
  font-size: 16px;
  font-weight: 750;
  line-height: 1.5;
  cursor: pointer;
}

body.home-page #installPrimary:hover:not(:disabled) {
  background: #7de6d2;
}

body.home-page #installPrimary:disabled {
  background: #173d42;
  border-color: #3c716d;
  color: #a7dfd4;
  cursor: default;
}

body.home-page #installPrimary[hidden],
body.home-page #installSteps[hidden] {
  display: none;
}

body.home-page #installSteps {
  margin: 18px 0 0;
  padding-left: 24px;
  color: #c1d2df;
  font-size: 15px;
  line-height: 1.65;
}

body.home-page #installSteps li {
  padding-left: 4px;
  margin-bottom: 8px;
}

body.home-page #installSteps li::marker {
  color: var(--mint);
  font-weight: 700;
}

body.home-page #getAppNote {
  margin: 16px 0 0;
  padding: 12px 14px;
  border: 1px solid #56d9c038;
  border-radius: 12px;
  background: #56d9c008;
  color: #c4dedc;
  font-size: 15px;
  line-height: 1.55;
}

body.home-page #getAppNote:empty {
  display: none;
}

body.home-page #installOther {
  margin-top: 20px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

body.home-page #installOther summary {
  min-height: 48px;
  padding: 12px 0;
  color: #c0d2df;
  font-size: 15px;
  font-weight: 650;
  line-height: 1.5;
  cursor: pointer;
}

body.home-page .install-alternatives {
  display: grid;
  gap: 8px;
  margin: 4px 0 14px;
}

body.home-page .install-alternatives :is(a, button) {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 48px;
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  color: #cfe0eb;
  font: inherit;
  font-size: 15px;
  line-height: 1.5;
  white-space: normal;
  text-align: left;
  cursor: pointer;
}

body.home-page .install-alternatives :is(a, button):hover {
  border-color: #4f7894;
  background: #ffffff05;
}

body.home-page .header-install-dialog .get-app-apk-help,
body.home-page .install-disclaimer {
  margin: 14px 0 0;
  color: #9fb8ca;
  font-size: 14px;
  line-height: 1.55;
}

body.home-page dialog.auth-modal-overlay {
  position: fixed;
  inset: 0;
  display: block;
  width: min(440px, calc(100% - 28px));
  height: fit-content;
  max-width: none;
  max-height: calc(100dvh - 28px);
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: 22px;
  background: transparent;
  color: var(--ink);
  overflow: visible;
}

body.home-page dialog.auth-modal-overlay .auth-modal {
  width: 100%;
  max-height: calc(100dvh - 28px);
}

body.home-page dialog.auth-modal-overlay .auth-modal-close,
body.home-page dialog.auth-modal-overlay .auth-tab,
body.home-page dialog.auth-modal-overlay .auth-submit {
  min-height: 48px;
}

body.home-page dialog.auth-modal-overlay .auth-modal-close {
  width: 48px;
  height: 48px;
}

body.home-page dialog.auth-modal-overlay .auth-form label {
  font-size: 14px;
}

body.home-page dialog.auth-modal-overlay .auth-form :is(input, textarea) {
  font-size: 16px;
  min-height: 48px;
}

body.home-page dialog.auth-modal-overlay :is(.auth-note, .auth-hint) {
  font-size: 14px;
  line-height: 1.55;
}

body.home-page dialog.auth-modal-overlay :is(.auth-error, .auth-success) {
  font-size: 14px;
  line-height: 1.5;
}

body.home-page dialog.auth-modal-overlay :is(button, label.avatar-upload-label):focus-visible {
  outline: 3px solid var(--mint);
  outline-offset: 3px;
}

@media (max-width: 1099px) {
  body.home-page .site-header.home-header {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .home-header .header-primary-nav,
  .home-header .header-actions .auth-widget,
  .home-header .header-actions .get-app {
    display: none;
  }

  .home-header .header-more-toggle {
    display: inline-flex;
  }
}

@media (max-width: 700px) {
  body.home-page .site-header.home-header {
    height: 64px;
    min-height: 64px;
    padding: 0 14px;
    gap: 12px;
  }

  .home-header .brand {
    gap: 9px;
  }

  .home-header .brand img {
    flex-basis: 36px;
    width: 36px;
    height: 36px;
  }

  .home-header .brand strong {
    font-size: 19px;
  }

  .home-header .brand small.brand-tagline {
    display: block;
    margin-top: 1px;
    color: #b8d1df;
    font-size: 11px;
    line-height: 1.25;
    letter-spacing: .02em;
    white-space: nowrap;
  }

  /* Phone navigation lives in the fixed bottom bar; search lives in the library. */
  .home-header .header-actions { display: none; }
  body.home-page .header-more-links > .header-tablet-only { display: none; }

  body.home-page :is(dialog.header-more-dialog, dialog.header-account-dialog, dialog.header-install-dialog) {
    inset: auto 0 0;
    width: 100%;
    max-height: 94dvh;
    margin: 0;
    padding: 18px 18px calc(20px + env(safe-area-inset-bottom, 0px));
    border-radius: 22px 22px 0 0;
  }

  body.home-page .header-dialog-heading {
    gap: 12px;
    margin-bottom: 12px;
  }

  body.home-page .header-dialog-heading h2 {
    font-size: 22px;
  }

  body.home-page dialog.auth-modal-overlay {
    max-height: 94dvh;
  }

  body.home-page dialog.auth-modal-overlay .auth-modal {
    max-height: 94dvh;
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-header *,
  body.home-page :is(.header-more-dialog, .header-account-dialog, .header-install-dialog, .auth-modal-overlay) * {
    transition: none;
    animation: none;
    scroll-behavior: auto;
  }
}

@media (forced-colors: active) {
  .home-header :is(.get-app-toggle, .header-more-toggle),
  body.home-page :is(.header-more-dialog, .header-account-dialog, .header-install-dialog),
  body.home-page :is(.header-dialog-close, #installOther, .install-alternatives a, .install-alternatives button, #getAppNote),
  body.home-page dialog.auth-modal-overlay .auth-modal {
    border-color: CanvasText;
  }

  .home-header .header-primary-nav a[aria-current] {
    text-decoration-color: LinkText;
  }

  body.home-page #installPrimary {
    border-color: ButtonText;
  }

  .home-header :is(a, button):focus-visible,
  body.home-page :is(.header-more-dialog, .header-account-dialog, .header-install-dialog, .auth-modal-overlay) :is(a, button, summary):focus-visible {
    outline-color: Highlight;
  }
}

