.sm-auth-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-left: 0;
  flex: 0 0 auto;
}

.sm-account-wrap {
  position: relative;
}

.sm-account-menu {
  position: absolute;
  z-index: 1100;
  top: calc(100% + 10px);
  right: 0;
  width: 176px;
  overflow: hidden;
  border: 1px solid #d8e0eb;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 20px 55px rgb(18 30 49 / 20%);
}

.sm-account-menu[hidden] {
  display: none;
}

.sm-account-menu a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 40px;
  border-bottom: 1px solid #e2e8f0;
  color: #33435c;
  font-size: 0.9rem;
  font-weight: 750;
  padding: 0 13px;
  white-space: nowrap;
}

.sm-account-menu a:last-child {
  border-bottom: 0;
}

.sm-account-menu a:hover,
.sm-account-menu a:focus-visible {
  background: #f5f7fb;
  color: #315dff;
}

.sm-account-menu [hidden] {
  display: none !important;
}

.sm-account-menu b {
  display: inline-grid;
  min-width: 18px;
  height: 18px;
  margin-left: 3px;
  border-radius: 9px;
  background: #c64a3e;
  color: #fff;
  font-size: 0.7rem;
  place-items: center;
  vertical-align: middle;
}

.sm-account-menu b[hidden] {
  display: none;
}

.sm-auth-button {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid #c9d4e5;
  border-radius: 6px;
  background: #ffffff;
  color: #243248;
  cursor: pointer;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 750;
  white-space: nowrap;
}

.sm-auth-button:hover,
.sm-auth-button:focus-visible {
  border-color: #315dff;
  color: #315dff;
}

.sm-auth-button.is-primary {
  border-color: #243248;
  background: #243248;
  color: #ffffff;
}

.sm-auth-button.is-primary:hover,
.sm-auth-button.is-primary:focus-visible {
  border-color: #172338;
  background: #172338;
  color: #ffffff;
}

.sm-auth-button[hidden] {
  display: none;
}

.sm-auth-modal[hidden] {
  display: none;
}

.sm-auth-modal {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgb(18 30 49 / 44%);
}

.sm-auth-dialog {
  position: relative;
  width: min(100%, 520px);
  max-height: min(760px, calc(100vh - 48px));
  overflow: auto;
  border: 1px solid #d8e0eb;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 24px 70px rgb(18 30 49 / 22%);
  padding: 30px;
}

.sm-auth-dialog h2 {
  margin: 0 0 8px;
  color: #1d2b40;
  font-size: 1.55rem;
  line-height: 1.2;
}

.sm-auth-kicker {
  margin: 0 0 9px;
  color: #315dff;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.sm-auth-copy {
  margin: 0 0 22px;
  color: #66758c;
  font-size: 0.92rem;
  line-height: 1.55;
}

.sm-auth-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: #66758c;
  cursor: pointer;
  font-size: 1.35rem;
  line-height: 1;
}

.sm-auth-close:hover,
.sm-auth-close:focus-visible {
  border-color: #d8e0eb;
  background: #f5f7fb;
  color: #1d2b40;
}

.sm-auth-form[hidden] {
  display: none;
}

.sm-auth-field {
  display: grid;
  gap: 7px;
  margin-top: 16px;
}

.sm-auth-field label {
  color: #33435c;
  font-size: 0.86rem;
  font-weight: 750;
}

.sm-auth-field input {
  min-height: 42px;
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #cbd6e5;
  border-radius: 6px;
  background: #ffffff;
  color: #1d2b40;
  font: inherit;
  padding: 0 12px;
}

.sm-auth-field input:focus {
  border-color: #315dff;
  outline: 3px solid rgb(49 93 255 / 15%);
}

.sm-auth-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 22px;
}

.sm-auth-status {
  min-height: 1.4em;
  color: #66758c;
  font-size: 0.86rem;
  line-height: 1.45;
}

.sm-auth-status.is-error {
  color: #a33d36;
}

.sm-auth-status.is-success {
  color: #14755d;
}

.sm-auth-support {
  margin: 18px 0 0;
  padding-top: 16px;
  border-top: 1px solid #d8e0eb;
  color: #66758c;
  font-size: 0.8rem;
  line-height: 1.55;
}

.sm-auth-support a {
  color: #315dff;
  font-weight: 750;
  overflow-wrap: anywhere;
}

/* Account controls intentionally stay compact so they do not shift the main nav. */
.sm-account-menu {
  width: 168px;
  border-color: #dcd8cf;
  border-radius: 6px;
  background: #fffefb;
  box-shadow: 0 18px 42px rgb(32 36 38 / 16%);
}

.sm-account-menu a {
  min-height: 38px;
  color: #3e4947;
  font-size: 0.82rem;
  font-weight: 760;
}

.sm-account-menu a:hover,
.sm-account-menu a:focus-visible {
  background: #f7ece8;
  color: #b94e3c;
}

.sm-account-menu b {
  background: #e56a52;
}

.sm-auth-modal {
  background: rgb(32 36 38 / 48%);
}

.sm-auth-dialog {
  border-color: #dcd8cf;
  border-radius: 8px;
  background: #fffefb;
  box-shadow: 0 28px 72px rgb(32 36 38 / 22%);
}

.sm-auth-kicker {
  color: #b94e3c;
}

.sm-auth-dialog h2 {
  color: #202426;
}

.sm-auth-copy,
.sm-auth-note {
  color: #697170;
}

.sm-auth-consent {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: #526071;
  font-size: 0.82rem;
  line-height: 1.5;
}

.sm-auth-consent input {
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
  flex: 0 0 auto;
}

.sm-auth-consent a {
  color: #2458d3;
}

.sm-auth-note {
  margin: 12px 0 0;
  color: #78869a;
  font-size: 0.8rem;
  line-height: 1.45;
}

body.sm-auth-lock {
  overflow: hidden;
}

@media (max-width: 760px) {
  .header-inner .nav,
  .topbar-inner .nav {
    flex: 0 0 100% !important;
    justify-content: flex-start !important;
    margin-left: 0 !important;
  }

  .sm-auth-actions {
    width: 100%;
    margin-left: 0;
    justify-content: flex-start;
  }

  .sm-account-menu {
    position: fixed;
    top: 108px;
    right: 12px;
    left: 12px;
    width: 176px;
  }

  .sm-auth-modal {
    padding: 12px;
  }

  .sm-auth-dialog {
    padding: 24px 20px;
  }
}
