.auth-trigger {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  min-height: 32px;
  margin-left: 2px;
  padding: 5px 11px;
  color: var(--text-secondary);
  font: 600 0.72rem/1 "Inter", sans-serif;
  border: 1px solid #cfd9e6;
  border-radius: 8px;
  background: #f8fafc;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.auth-trigger::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-muted);
  box-shadow: 0 0 0 3px rgba(132, 153, 183, 0.12);
}

.auth-trigger:hover {
  color: var(--text-primary);
  border-color: rgba(59, 130, 246, 0.7);
}

.auth-trigger.authenticated {
  color: var(--green);
  border-color: rgba(95, 208, 160, 0.35);
  background: rgba(95, 208, 160, 0.08);
}

.auth-trigger.authenticated::before {
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(95, 208, 160, 0.13);
}

[data-auth-required].auth-locked,
[data-auth-required]:disabled {
  opacity: 0.45 !important;
  cursor: not-allowed !important;
  filter: saturate(0.45);
}

.auth-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(31, 41, 55, 0.42);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.auth-modal-overlay.open { display: flex; }

.auth-modal {
  position: relative;
  width: min(100%, 410px);
  padding: 30px;
  color: var(--text-primary);
  border: 1px solid #d7e0eb;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 30px 80px rgba(24, 47, 78, 0.2);
}

.auth-modal h2 {
  margin: 4px 0 8px;
  color: var(--text-primary);
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}

.auth-kicker {
  color: #78a8ed;
  font: 600 0.65rem/1 "Montserrat", sans-serif;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.auth-copy {
  margin: 0 0 22px;
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.55;
}

.auth-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 30px;
  height: 30px;
  padding: 0;
  color: var(--text-muted);
  font-size: 1.25rem;
  line-height: 1;
  border: 0;
  border-radius: 7px;
  background: transparent;
  cursor: pointer;
}

.auth-close:hover { color: var(--text-primary); background: #eef3f8; }

.auth-form label {
  display: block;
  margin: 12px 0 5px;
  color: var(--text-secondary);
  font-size: 0.74rem;
  font-weight: 600;
}

.auth-form input {
  width: 100%;
  height: 42px;
  padding: 8px 11px;
  color: var(--text-primary);
  font: 0.86rem "Inter", sans-serif;
  border: 1px solid #cfd9e6;
  border-radius: 8px;
  outline: none;
  background: #f8fafc;
}

.auth-submit {
  width: 100%;
  min-height: 42px;
  margin-top: 18px;
  color: #fff;
  font: 600 0.82rem "Inter", sans-serif;
  border: 1px solid #3b82f6;
  border-radius: 8px;
  background: linear-gradient(135deg, #3b82f6, #2563d8);
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.2);
  cursor: pointer;
}

.auth-submit:disabled { cursor: wait; opacity: 0.65; }
.auth-error { min-height: 18px; margin-top: 9px; color: var(--red); font-size: 0.75rem; }

@media (max-width: 720px) {
  .auth-trigger { margin-left: auto; }
  .auth-modal { padding: 26px 22px; }
}
