/* ---- Magic-link auth (ui/auth.js — mock in stub mode, real Supabase Auth in live mode) ---- */
.auth-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.auth-chip {
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-chip:hover {
  border-color: var(--accent);
  color: var(--text);
}

.auth-chip.signed-in {
  cursor: default;
  border-color: var(--green-chip);
  color: var(--accent-2);
}

.auth-chip.signed-in:hover {
  border-color: var(--green-chip);
  color: var(--accent-2);
}

.auth-sign-out {
  flex: none;
  padding: 4px 8px;
  font-size: 10px;
}

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 2100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: var(--scrim);
}

.auth-modal.hidden {
  display: none;
}

.auth-step-email.hidden,
.auth-step-sent.hidden {
  display: none;
}

.auth-modal-card {
  width: min(100%, 380px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow);
}

.auth-modal-card h2 {
  margin: 0 0 6px;
  font-size: 16px;
}

.auth-modal-card p {
  margin: 0 0 12px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}

.auth-modal-close {
  float: right;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  margin: -12px -12px 0 8px;
  padding: 0;
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.auth-modal-close:hover {
  color: var(--text);
}

.auth-modal label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
}

#authEmailInput {
  width: 100%;
  padding: 9px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  font-size: 14px;
}

#authEmailInput:focus {
  outline: none;
  border-color: var(--accent);
}

.auth-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}

.auth-modal-actions button {
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.auth-modal-actions button:hover {
  border-color: var(--accent);
}

.auth-modal-actions .primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--amber-ink);
}

.auth-modal-actions .primary:hover {
  background: var(--amber-2);
  border-color: var(--amber-2);
}

.auth-step-sent .auth-sent-email {
  color: var(--accent);
  font-weight: 600;
  word-break: break-all;
}

.auth-mock-note {
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--accent-softer);
  border: 1px solid var(--accent-soft);
  font-size: 11px;
  color: var(--muted);
  line-height: 1.4;
}
