.telegram-auth {
  display: grid;
  gap: .65rem;
  margin-top: .75rem;
}

.telegram-auth-button {
  display: inline-flex;
  width: 100%;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: .65rem;
  padding: .75rem 1rem;
  border: 1px solid #229ed9;
  border-radius: .75rem;
  background: #229ed9;
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease, opacity 150ms ease;
}

.telegram-auth-button:hover:not(:disabled),
.telegram-auth-button:focus-visible:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(34, 158, 217, .24);
  outline: none;
}

.telegram-auth-button:disabled {
  opacity: .48;
  cursor: not-allowed;
}

.telegram-auth-button svg { width: 22px; height: 22px; fill: currentColor; }

.telegram-auth-status {
  min-height: 1.25rem;
  margin: 0;
  color: var(--text-secondary, #64748b);
  font-size: .72rem;
  line-height: 1.55;
  text-align: center;
}

.telegram-auth-status[data-state="success"] { color: #15803d; }
.telegram-auth-status[data-state="error"] { color: #dc2626; }
.telegram-auth-status[data-state="pending"] { color: #0369a1; }

.telegram-auth-panel {
  position: relative;
  display: grid;
  justify-items: center;
  gap: .8rem;
  padding: 1rem;
  border: 1px solid color-mix(in srgb, #229ed9 30%, var(--border-color, #d9e0ea));
  border-radius: 1rem;
  background: color-mix(in srgb, #229ed9 5%, var(--background-secondary, #fff));
  text-align: center;
}

.telegram-auth-panel.hidden { display: none; }
.telegram-auth-panel h3 { margin: 0; color: var(--text-primary, #172033); font-size: .95rem; }
.telegram-auth-panel p { margin: 0; color: var(--text-secondary, #64748b); font-size: .72rem; line-height: 1.55; }

.telegram-auth-qr-link {
  display: block;
  width: min(248px, 100%);
  padding: .45rem;
  border-radius: .85rem;
  background: #fff;
  box-shadow: 0 8px 26px rgba(15, 23, 42, .12);
}

.telegram-auth-qr-link img { display: block; width: 100%; height: auto; }

.telegram-auth-open {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: .65rem .9rem;
  border-radius: .7rem;
  background: #172033;
  color: #fff !important;
  font-size: .75rem;
  font-weight: 750;
  text-decoration: none !important;
}

.telegram-auth-close {
  position: absolute;
  top: .55rem;
  right: .55rem;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--text-primary, #172033) 8%, transparent);
  color: var(--text-primary, #172033);
  font: inherit;
  cursor: pointer;
}

.telegram-auth-countdown { font-variant-numeric: tabular-nums; font-weight: 700; }

.telegram-registration-consent {
  display: grid;
  gap: .75rem;
  padding: 1rem;
  border: 1px solid color-mix(in srgb, #229ed9 30%, var(--border-color, #d9e0ea));
  border-radius: 1rem;
  background: color-mix(in srgb, #229ed9 6%, var(--background-secondary, #fff));
  color: var(--text-primary, #172033);
}

.telegram-registration-consent[hidden] { display: none; }
.telegram-registration-consent h3,
.telegram-registration-consent p { margin: 0; }
.telegram-registration-consent h3 { font-size: .95rem; }
.telegram-registration-consent p { color: var(--text-secondary, #64748b); font-size: .74rem; line-height: 1.55; }
.telegram-registration-consent label {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: start;
  gap: .6rem;
  color: var(--text-primary, #172033);
  font-size: .72rem;
  line-height: 1.55;
}
.telegram-registration-consent input { width: 18px; height: 18px; margin: .08rem 0 0; accent-color: #229ed9; }
.telegram-registration-consent a { color: var(--primary-color, #f97316); font-weight: 700; }

.telegram-account-auth { margin: 0; }
.telegram-account-auth .telegram-auth-button { min-height: 42px; font-size: .62rem; }
.telegram-account-actions { display: grid; gap: .55rem; }
.telegram-account-unlink {
  min-height: 40px;
  padding: .6rem;
  border: 1px solid var(--member-line, #d9e0ea);
  border-radius: 12px;
  background: var(--member-card, #fff);
  color: #dc2626;
  font: inherit;
  font-size: .6rem;
  font-weight: 750;
  cursor: pointer;
}
.telegram-account-unlink:disabled { opacity: .5; cursor: not-allowed; }

@media (max-width: 520px) {
  .telegram-auth-panel { margin-inline: -.2rem; padding: .85rem; }
  .telegram-auth-qr-link { width: min(220px, 88vw); }
}
