[hidden] {
  display: none !important;
}

.nav-account-link,
.chat-account-link,
.text-button {
  border: 0;
  background: none;
  color: var(--primary);
  cursor: pointer;
  font: inherit;
  font-weight: 600;
}

.nav-account-link {
  padding: 0;
  font-size: 0.95rem;
}

.support-launcher {
  position: fixed;
  right: 24px;
  bottom: 88px;
  z-index: 1001;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 0 18px;
  border: 0;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  box-shadow: 0 8px 24px rgba(6, 42, 92, 0.24);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.support-launcher span:first-child {
  color: #f0c96a;
  font-size: 1.4rem;
}

.support-panel {
  position: fixed;
  right: 24px;
  bottom: 148px;
  z-index: 1002;
  display: flex;
  flex-direction: column;
  width: min(390px, calc(100vw - 32px));
  height: min(590px, calc(100dvh - 172px));
  overflow: hidden;
  border: 1px solid rgba(6, 42, 92, 0.14);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 56px rgba(15, 31, 49, 0.2);
}

.support-header,
.account-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px;
  background: var(--primary);
  color: #fff;
}

.support-header h2,
.account-header h2 {
  font-size: 1.05rem;
  line-height: 1.3;
}

.support-header p,
.account-header p {
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.82rem;
}

.icon-button {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 6px;
  background: transparent;
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 1.5rem;
  line-height: 1;
}

.guest-start {
  display: grid;
  gap: 12px;
  padding: 22px;
}

.guest-start > p:first-child {
  margin-bottom: 4px;
  color: #4d5964;
  font-size: 0.92rem;
}

.guest-start label,
.account-form label {
  color: #34414d;
  font-size: 0.88rem;
  font-weight: 600;
}

.guest-start input,
.account-form input,
.chat-form input {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #ccd4dd;
  border-radius: 5px;
  background: #fff;
  color: #222d36;
  font: inherit;
}

.guest-start input:focus,
.account-form input:focus,
.chat-form input:focus {
  border-color: var(--primary);
  outline: 2px solid rgba(6, 42, 92, 0.15);
}

.support-submit {
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 5px;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.support-submit:disabled {
  cursor: wait;
  opacity: 0.65;
}

.form-feedback {
  min-height: 1.2em;
  color: #315c3d;
  font-size: 0.82rem;
}

.form-feedback.is-error {
  color: #a12727;
}

.chat-content {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  padding: 14px;
}

.chat-messages {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  padding: 4px 2px 12px;
}

.chat-message {
  align-self: flex-start;
  max-width: 85%;
  padding: 9px 11px;
  border-radius: 7px 7px 7px 2px;
  background: #f0f3f6;
  color: #26333f;
  overflow-wrap: anywhere;
}

.chat-message.is-mine {
  align-self: flex-end;
  border-radius: 7px 7px 2px 7px;
  background: #e6eef8;
}

.chat-message p {
  white-space: pre-wrap;
}

.chat-message time {
  display: block;
  margin-top: 4px;
  color: #66727d;
  font-size: 0.7rem;
  text-align: right;
}

.chat-form {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid #e4e8ec;
}

.chat-form .support-submit {
  flex: 0 0 auto;
}

.chat-account-link {
  align-self: center;
  margin-top: 10px;
  font-size: 0.82rem;
}

.account-overlay {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(17, 29, 40, 0.54);
}

.account-dialog {
  width: min(460px, 100%);
  max-height: min(680px, calc(100dvh - 32px));
  overflow-y: auto;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 22px 64px rgba(0, 0, 0, 0.24);
}

.account-form,
.account-signed-in {
  display: grid;
  gap: 12px;
  padding: 22px;
}

.account-email {
  color: #4d5964;
  overflow-wrap: anywhere;
}

.account-signed-in h3 {
  margin-top: 6px;
  color: var(--primary);
  font-size: 1rem;
}

.account-rewards {
  display: grid;
  gap: 10px;
}

.reward-item {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid #d9e0e6;
  border-left: 3px solid var(--accent);
  border-radius: 5px;
}

.reward-item p,
.account-empty {
  color: #596570;
  font-size: 0.88rem;
}

.reward-item code {
  width: fit-content;
  padding: 4px 7px;
  background: #f0f3f6;
  color: var(--primary);
  font-size: 0.9rem;
  font-weight: 700;
}

.reward-item small {
  color: #66727d;
}

.text-button {
  justify-self: center;
  padding: 6px;
  font-size: 0.88rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

@media (max-width: 600px) {
  .support-launcher {
    right: 16px;
    bottom: 88px;
  }

  .support-panel {
    right: 8px;
    bottom: 148px;
    width: calc(100vw - 16px);
    height: min(620px, calc(100dvh - 172px));
  }

  .account-overlay {
    padding: 10px;
  }
}
