/* ==========================================================================
   Account & cloud sync styles — tokens only, 150ms transitions, a11y
   ========================================================================== */

/* ---------------------------------------------------------------------------
   Header avatar trigger & sync status indicator
   --------------------------------------------------------------------------- */
.acct-trigger {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-1);
  transition: background-color var(--dur-hover) var(--ease),
              border-color var(--dur-hover) var(--ease),
              transform var(--dur-fast) var(--ease);
}

.acct-trigger:hover {
  background: var(--surface-2);
  border-color: var(--border-strong);
}

.acct-trigger:focus-visible {
  box-shadow: var(--focus-ring);
  border-radius: var(--radius-full);
}

.acct-trigger .avatar {
  --avatar-size: 28px;
  background: var(--surface-3);
  color: var(--text-1);
  border: 1px solid var(--border-strong);
  font-size: var(--fs-12);
  font-weight: var(--fw-semibold);
}

.acct-status-dot {
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 9px;
  height: 9px;
  border-radius: var(--radius-full);
  border: 2px solid var(--bg);
  background: var(--seen);
  transition: background-color var(--dur-hover) var(--ease);
}

.acct-status-dot--syncing {
  background: var(--accent);
}

.acct-status-dot--offline,
.acct-status-dot--error {
  background: var(--danger);
}

/* ---------------------------------------------------------------------------
   Account Dialog
   --------------------------------------------------------------------------- */
.acct-dlg {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  color: var(--text-1);
}

.acct-lead {
  margin: 0;
  font-size: var(--fs-14);
  line-height: var(--lh-14);
  color: var(--text-2);
}

.acct-perks {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-2);
  padding: var(--space-3);
  border-radius: var(--radius-lg);
  background: var(--surface-1);
  border: 1px solid var(--border);
}

.acct-perk {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.acct-perk__val {
  font-size: var(--fs-16);
  line-height: var(--lh-16);
  font-weight: var(--fw-semibold);
  color: var(--text-1);
  font-variant-numeric: tabular-nums;
}

.acct-perk__lbl {
  font-size: var(--fs-12);
  line-height: var(--lh-12);
  color: var(--text-3);
}

/* Google sign-in button (official G mark on clean light/neutral surface) */
.acct-google-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  width: 100%;
  height: 42px;
  padding: 0 var(--space-4);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--text-1);
  color: var(--bg);
  font-size: var(--fs-14);
  font-weight: var(--fw-semibold);
  transition: opacity var(--dur-hover) var(--ease),
              transform var(--dur-fast) var(--ease);
}

.acct-google-btn:hover:not(:disabled) {
  opacity: 0.92;
}

.acct-google-btn:active:not(:disabled) {
  transform: translateY(0.5px);
}

.acct-google-btn:disabled {
  opacity: 0.55;
  cursor: default;
}

.acct-google-btn__mark {
  width: 18px;
  height: 18px;
  flex: none;
}

/* Divider */
.acct-divider {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--text-3);
  font-size: var(--fs-12);
  line-height: var(--lh-12);
}

.acct-divider::before,
.acct-divider::after {
  content: '';
  flex: 1 1 auto;
  height: 1px;
  background: var(--border);
}

/* Email link form */
.acct-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.acct-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.acct-label {
  font-size: var(--fs-12);
  line-height: var(--lh-12);
  font-weight: var(--fw-medium);
  color: var(--text-2);
}

.acct-submit {
  width: 100%;
  height: 40px;
}

/* Alert / Error state */
.acct-alert {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  border: 1px solid color-mix(in srgb, var(--danger) 45%, transparent);
  background: color-mix(in srgb, var(--danger) 10%, var(--surface-1));
  color: var(--text-1);
  font-size: var(--fs-14);
  line-height: var(--lh-14);
}

.acct-alert__icon {
  color: var(--danger);
  flex: none;
  margin-top: 2px;
}

/* Check your inbox state */
.acct-inbox {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-4);
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  background: var(--surface-1);
  border: 1px solid var(--border);
}

.acct-inbox__head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.acct-inbox__badge {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--accent-soft);
  color: var(--accent);
  flex: none;
}

.acct-inbox__title {
  font-size: var(--fs-16);
  line-height: var(--lh-16);
  font-weight: var(--fw-semibold);
  color: var(--text-1);
}

.acct-inbox__body {
  margin: 0;
  font-size: var(--fs-14);
  line-height: var(--lh-14);
  color: var(--text-2);
}

.acct-inbox__body strong {
  color: var(--text-1);
  font-weight: var(--fw-semibold);
}

.acct-inbox__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
}

/* Signed-in profile card inside account dialog */
.acct-profile {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  background: var(--surface-1);
  border: 1px solid var(--border);
}

.acct-profile__meta {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.acct-profile__name {
  font-size: var(--fs-16);
  line-height: var(--lh-16);
  font-weight: var(--fw-semibold);
  color: var(--text-1);
}

.acct-profile__email {
  font-size: var(--fs-14);
  line-height: var(--lh-14);
  color: var(--text-2);
}

.acct-sync-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  background: var(--surface-1);
  border: 1px solid var(--border);
  font-size: var(--fs-14);
  color: var(--text-2);
}

.acct-sync-row__status {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.acct-sync-row__dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--seen);
}

.acct-sync-row__dot--syncing {
  background: var(--accent);
}

.acct-sync-row__dot--offline,
.acct-sync-row__dot--error {
  background: var(--danger);
}

.acct-actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

/* Dialog footer note */
.acct-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--hairline);
  font-size: var(--fs-12);
  line-height: var(--lh-12);
  color: var(--text-3);
}

/* ---------------------------------------------------------------------------
   Privacy Page (privacy.html)
   --------------------------------------------------------------------------- */
.privacy-page {
  max-width: 720px;
  margin: 0 auto;
  padding: var(--space-8) var(--space-4) var(--space-16);
}

.privacy-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  padding: var(--space-8);
  border-radius: var(--radius-xl);
  background: var(--surface-1);
  border: 1px solid var(--border);
}

.privacy-card__header {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border);
}

.privacy-card__title {
  font-size: var(--fs-28);
  line-height: var(--lh-28);
  color: var(--text-1);
}

.privacy-card__lead {
  font-size: var(--fs-16);
  line-height: var(--lh-16);
  color: var(--text-2);
}

.privacy-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.privacy-section h2 {
  font-size: var(--fs-16);
  line-height: var(--lh-16);
  color: var(--text-1);
}

.privacy-section p {
  font-size: var(--fs-14);
  line-height: var(--lh-16);
  color: var(--text-2);
}

.privacy-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding-left: var(--space-5);
  color: var(--text-2);
  font-size: var(--fs-14);
  line-height: var(--lh-16);
}

.privacy-list strong {
  color: var(--text-1);
}

@media (max-width: 899px), (max-height: 500px) and (orientation: landscape) and (pointer: coarse) {
  .privacy-card {
    padding: var(--space-5);
  }

  [data-dialog-close],
  button[data-dialog-close],
  .dialog__close,
  .sheet__close {
    width: var(--hit, 44px) !important;
    height: var(--hit, 44px) !important;
    min-width: var(--hit, 44px) !important;
    min-height: var(--hit, 44px) !important;
  }

  .acct-dlg a.link,
  .acct-foot a.link,
  .acct-foot a,
  .acct-foot .link {
    display: inline !important;
  }

  .acct-trigger {
    width: var(--hit, 44px);
    height: var(--hit, 44px);
  }

  .acct-google-btn {
    min-height: var(--hit, 44px);
    height: auto;
    padding-block: var(--space-3);
  }

  .acct-submit {
    min-height: var(--hit, 44px);
    height: auto;
  }

  .acct-field input,
  .acct-form input {
    font-size: var(--fs-16, 16px) !important;
    min-height: var(--hit, 44px);
  }

  .acct-inbox__actions .btn,
  .acct-actions-row .btn {
    min-height: var(--hit, 44px);
  }
}
