.account-nav-link.is-authenticated {
  width: 42px;
  height: 42px;
  min-width: 42px;
  padding: 0;
  border: 1px solid rgba(188, 137, 91, 0.55);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #f4eadf;
  background:
    radial-gradient(circle at 35% 28%, rgba(218, 174, 128, 0.28), transparent 45%),
    linear-gradient(145deg, #6f4329, #2b1a12);
  box-shadow: 0 7px 22px rgba(0, 0, 0, 0.28);
  text-decoration: none;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.account-nav-link.is-authenticated:hover,
.account-nav-link.is-authenticated:focus-visible {
  transform: translateY(-2px);
  border-color: #d8a879;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.38);
}

.account-nav-icon {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.account-nav-link.is-authenticated .account-nav-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.legal-menu .account-nav-link {
  color: inherit;
}

.global-messages-button {
  position: fixed;
  right: max(20px, env(safe-area-inset-right));
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 9000;
  width: 58px;
  height: 58px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 235, 214, 0.3);
  border-radius: 50%;
  color: #fffaf4;
  background: linear-gradient(145deg, #9b6746, #56321f);
  box-shadow: 0 14px 34px rgba(31, 17, 10, 0.38);
  text-decoration: none;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.global-chat-lock {
  overflow: hidden;
}

.global-chat-overlay[hidden] {
  display: none !important;
}

.global-chat-overlay {
  position: fixed;
  inset: 0;
  z-index: 9100;
  display: flex;
  justify-content: flex-end;
  font-family: Inter, Arial, sans-serif;
}

.global-chat-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: rgba(0, 0, 0, 0.68);
  opacity: 0;
  cursor: default;
  transition: opacity 220ms ease;
}

.global-chat-drawer {
  position: relative;
  z-index: 1;
  width: min(480px, calc(100vw - 28px));
  height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  color: #f1eee6;
  background:
    radial-gradient(circle at 88% 6%, rgba(155, 103, 70, 0.15), transparent 30%),
    #10100f;
  border-left: 1px solid rgba(198, 161, 91, 0.28);
  box-shadow: -22px 0 60px rgba(0, 0, 0, 0.55);
  transform: translateX(104%);
  transition: transform 220ms ease;
}

.global-chat-overlay.is-open .global-chat-backdrop {
  opacity: 1;
}

.global-chat-overlay.is-open .global-chat-drawer {
  transform: translateX(0);
}

.global-chat-header {
  min-height: 78px;
  padding: 15px 16px 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: #fffaf4;
  background:
    radial-gradient(circle at 82% 10%, rgba(198, 161, 91, 0.14), transparent 34%),
    linear-gradient(135deg, #0b0b0a, #21150f);
  border-bottom: 1px solid rgba(198, 161, 91, 0.24);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.32);
}

.global-chat-header h2 {
  margin: 2px 0 0;
  color: inherit;
  font: 700 23px/1.15 Georgia, serif;
}

.global-chat-kicker {
  display: block;
  color: #e9c7a7;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.global-chat-close {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  padding: 0 0 3px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  font: 300 30px/1 Arial, sans-serif;
  cursor: pointer;
}

.global-chat-close:hover,
.global-chat-close:focus-visible {
  background: rgba(255, 255, 255, 0.18);
}

.global-chat-content {
  --account-bg: #10100f;
  --account-card: #1a1a18;
  --account-line: #34342f;
  --account-line-strong: rgba(198, 161, 91, 0.42);
  --account-text: #f1eee6;
  --account-muted: #aaa69c;
  --account-gold: #c6a15b;
  --account-gold-light: #e4c98f;
  --account-danger: #ff8d82;
  --account-success: #8ed2a3;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  color: var(--account-text);
  background: transparent;
  scrollbar-color: rgba(198, 161, 91, 0.42) transparent;
}

.global-chat-content *,
.global-chat-content *::before,
.global-chat-content *::after {
  box-sizing: border-box;
}

.global-chat-content .account-chat-page {
  width: 100%;
  min-width: 0;
  padding: 16px;
}

.global-chat-content .account-page-heading {
  margin: 0 0 14px;
}

.global-chat-content .account-page-heading h1 {
  margin: 5px 0 7px;
  color: var(--account-text);
  font: 700 clamp(24px, 7vw, 32px)/1.15 Georgia, serif;
}

.global-chat-content .account-page-heading p,
.global-chat-content .muted,
.global-chat-content small {
  color: var(--account-muted);
}

.global-chat-content .account-page-heading p {
  margin: 0;
  line-height: 1.5;
}

.global-chat-content .account-eyebrow {
  color: #cba77b;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.global-chat-content .account-card {
  min-width: 0;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid rgba(198, 161, 91, 0.18);
  border-radius: 16px;
  color: var(--account-text);
  background: rgba(26, 26, 24, 0.94);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.16);
}

.global-chat-content .account-card h1,
.global-chat-content .account-card h2,
.global-chat-content .account-card h3 {
  margin-top: 0;
  color: var(--account-text);
}

.global-chat-content form {
  display: grid;
  gap: 14px;
}

.global-chat-content label {
  display: grid;
  gap: 7px;
  color: var(--account-muted);
  font-size: 13px;
}

.global-chat-content input,
.global-chat-content select,
.global-chat-content textarea {
  width: 100%;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid #45453f;
  border-radius: 10px;
  color: var(--account-text);
  background: #11110f;
  font: inherit;
}

.global-chat-content textarea {
  min-height: 100px;
}

.global-chat-content input:focus,
.global-chat-content select:focus,
.global-chat-content textarea:focus {
  outline: 2px solid var(--account-gold);
  outline-offset: 1px;
}

.global-chat-content button,
.global-chat-content .account-button {
  min-height: 42px;
  padding: 11px 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 10px;
  color: #11110f;
  background: var(--account-gold);
  font: 700 14px/1.2 Inter, Arial, sans-serif;
  text-decoration: none;
  cursor: pointer;
}

.global-chat-content .button-secondary {
  border: 1px solid var(--account-line);
  color: var(--account-text);
  background: transparent;
}

.global-chat-content .account-back-link {
  display: inline-flex;
  margin-bottom: 7px;
  color: var(--account-gold-light);
  text-decoration: none;
}

.global-chat-content .account-section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.global-chat-content .empty-state {
  padding: 30px 16px;
  text-align: center;
}

.global-chat-content .account-chat-heading-row,
.global-chat-content .account-chat-title-row,
.global-chat-content .account-chat-form-footer {
  align-items: stretch;
  flex-direction: column;
}

.global-chat-content .account-chat-heading-row .account-button,
.global-chat-content .account-chat-form-footer button {
  width: 100%;
}

.global-chat-content .account-chat-conversation {
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  padding: 13px;
}

.global-chat-content .account-chat-conversation-side {
  display: flex;
  align-items: center;
  flex-direction: row;
  justify-content: space-between;
}

.global-chat-content .workspace-chat-filters form,
.global-chat-content .workspace-chat-controls,
.global-chat-content .workspace-chat-layout,
.global-chat-content .workspace-chat-context {
  grid-template-columns: 1fr;
}

.global-chat-content .workspace-chat-context {
  position: static;
  grid-row: auto;
}

.global-chat-content .workspace-identity {
  align-self: flex-start;
}

.global-chat-content .account-chat-message {
  width: 92%;
  max-width: 92%;
}

.global-chat-failure {
  min-height: 100%;
  padding: 36px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
}

.global-chat-failure h3 {
  margin: 0 0 8px;
  color: var(--account-text);
  font: 700 24px/1.2 Georgia, serif;
}

.global-chat-failure p {
  margin: 0 0 20px;
  color: var(--account-muted);
}

.global-chat-frame {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
  background: #10100f;
}

.global-chat-loading {
  padding: 34px 24px;
  color: #aaa69c;
  text-align: center;
}

.global-chat-auth {
  min-height: 100%;
  padding: 40px 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.global-chat-auth-icon {
  width: 66px;
  height: 66px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fffaf4;
  background: linear-gradient(145deg, #9b6746, #56321f);
  border: 1px solid rgba(255, 235, 214, 0.24);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.38);
}

.global-chat-auth-icon svg {
  width: 31px;
  height: 31px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.global-chat-auth h3 {
  margin: 22px 0 8px;
  color: #f1eee6;
  font: 700 25px/1.2 Georgia, serif;
}

.global-chat-auth p {
  max-width: 310px;
  margin: 0 0 24px;
  color: #aaa69c;
  line-height: 1.55;
}

.global-chat-primary,
.global-chat-secondary {
  width: min(280px, 100%);
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
}

.global-chat-primary {
  color: #11110f;
  background: #c6a15b;
}

.global-chat-secondary {
  margin-top: 10px;
  border: 1px solid rgba(198, 161, 91, 0.3);
  color: #f1eee6;
  background: rgba(255, 255, 255, 0.025);
}

.global-chat-primary:hover,
.global-chat-primary:focus-visible {
  background: #d7b675;
}

.global-chat-secondary:hover,
.global-chat-secondary:focus-visible {
  border-color: rgba(198, 161, 91, 0.58);
  background: rgba(198, 161, 91, 0.08);
}

.global-messages-button:hover,
.global-messages-button:focus-visible {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 18px 42px rgba(31, 17, 10, 0.48);
}

.global-messages-button.has-unread {
  background: linear-gradient(145deg, #b6764e, #6d3b25);
}

.global-messages-button svg {
  width: 27px;
  height: 27px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.global-messages-label {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.global-messages-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 23px;
  height: 23px;
  padding: 0 6px;
  display: inline-grid;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 999px;
  color: #fff;
  background: #c43737;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.global-messages-badge[hidden] {
  display: none !important;
}

@media (max-width: 760px) {
  .global-messages-button {
    right: max(14px, env(safe-area-inset-right));
    bottom: max(14px, env(safe-area-inset-bottom));
    width: 54px;
    height: 54px;
  }

  .mobile-menu .account-nav-link.is-authenticated {
    width: auto;
    min-width: 0;
    height: 44px;
    padding: 0 16px;
    border-radius: 999px;
    gap: 9px;
  }

  .mobile-menu .account-nav-link.is-authenticated .account-nav-label {
    position: static;
    width: auto;
    height: auto;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
  }

  .global-chat-drawer {
    width: calc(100vw - 28px);
    height: calc(100% - 12px);
    margin: 6px 0 6px 28px;
    border: 1px solid rgba(96, 58, 35, 0.16);
    border-radius: 22px 0 0 22px;
    overflow: hidden;
  }

  .global-chat-header {
    min-height: 70px;
    padding: 12px 12px 11px 17px;
  }

  .global-chat-header h2 {
    font-size: 21px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .global-chat-backdrop,
  .global-chat-drawer {
    transition: none;
  }
}
