/* ═══════════════════════════════════════════════════════════
   CLOUD  —  account menu state, sign-in modal, sync indicator.
   Uses the app's warm-paper tokens; terracotta accent.
   Only appears when cloud is configured + not in read-only view.
   ═══════════════════════════════════════════════════════════ */

/* account chip injected into the overflow menu (desktop) + mobile menu sheet */
#btn-account .acct-dot,
.m-menu-item.m-account .acct-dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--ink-mute); margin-right: 8px; vertical-align: middle;
}
#btn-account.signed-in .acct-dot,
.m-menu-item.m-account.signed-in .acct-dot { background: var(--teal); }

/* ─── SIGN-IN MODAL ────────────────────────────────── */
.cl-backdrop {
  position: fixed; inset: 0; z-index: 1450;
  background: rgba(26,24,20,0.55); backdrop-filter: blur(4px);
  display: none; align-items: center; justify-content: center; padding: 24px;
}
.cl-backdrop.show { display: flex; }
.cl-card {
  background: var(--paper); border: 1px solid var(--line); border-radius: 15px;
  width: 420px; max-width: 100%; box-shadow: 0 30px 80px rgba(26,24,20,0.4);
  overflow: hidden; position: relative;
  animation: cl-in 0.26s cubic-bezier(0.2,0.8,0.3,1);
}
@keyframes cl-in { from { opacity: 0; transform: translateY(14px) scale(0.98); } to { opacity: 1; transform: none; } }
.cl-x {
  position: absolute; top: 14px; right: 14px; border: none; background: transparent;
  font-size: 19px; line-height: 1; color: var(--ink-mute); cursor: pointer; padding: 6px; z-index: 2;
}
.cl-x:hover { color: var(--ink); }

.cl-head {
  padding: 30px 30px 22px; text-align: center; border-bottom: 1px solid var(--line-soft);
  background: var(--paper-warm);
}
.cl-mark {
  width: 50px; height: 50px; margin: 0 auto 14px; border-radius: 13px;
  background: var(--accent); color: var(--paper);
  display: flex; align-items: center; justify-content: center; font-size: 22px;
  font-family: var(--display); font-weight: 600;
}
.cl-head h3 { font-family: var(--display); font-style: italic; font-weight: 500; font-size: 22px; color: var(--ink); margin-bottom: 7px; }
.cl-head p { font-size: 13px; color: var(--ink-soft); line-height: 1.5; max-width: 320px; margin: 0 auto; }

.cl-body { padding: 22px 30px 26px; }
.cl-label { display: block; font-size: 11px; font-weight: 600; letter-spacing: 0.02em; color: var(--ink-soft); margin-bottom: 7px; text-transform: uppercase; font-family: var(--mono); }
.cl-input {
  width: 100%; border: 1px solid var(--line); border-radius: 9px; padding: 12px 14px;
  font-family: var(--body); font-size: 14.5px; color: var(--ink); background: var(--paper);
}
.cl-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.cl-btn {
  width: 100%; margin-top: 14px; border: none; border-radius: 9px; padding: 13px;
  font-family: var(--body); font-size: 14px; font-weight: 600; cursor: pointer;
  background: var(--ink); color: var(--paper);
}
.cl-btn:hover { background: var(--ink-soft); }
.cl-btn[disabled] { opacity: 0.5; cursor: default; }
.cl-msg { margin-top: 13px; font-size: 12.5px; line-height: 1.5; text-align: center; min-height: 16px; }
.cl-msg.err { color: var(--accent); }
.cl-msg.ok { color: var(--teal); }
.cl-foot { margin-top: 16px; font-size: 11px; color: var(--ink-mute); text-align: center; line-height: 1.5; }

/* sent / check-inbox state */
.cl-sent { text-align: center; padding: 4px 0 2px; }
.cl-sent .cl-sent-ic {
  width: 54px; height: 54px; margin: 0 auto 16px; border-radius: 50%;
  background: var(--teal-soft); color: var(--teal);
  display: flex; align-items: center; justify-content: center; font-size: 24px;
}
.cl-sent h4 { font-family: var(--display); font-style: italic; font-weight: 500; font-size: 19px; margin-bottom: 8px; color: var(--ink); }
.cl-sent p { font-size: 13px; color: var(--ink-soft); line-height: 1.55; }
.cl-sent p b { color: var(--ink); }
.cl-link { background: none; border: none; color: var(--accent); font-family: var(--body); font-size: 12.5px; cursor: pointer; text-decoration: underline; padding: 4px; margin-top: 10px; }

/* signed-in account panel */
.cl-account { padding: 4px 0; }
.cl-acct-row { display: flex; align-items: center; gap: 13px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.cl-acct-row:last-of-type { border-bottom: none; }
.cl-acct-avatar {
  width: 40px; height: 40px; border-radius: 50%; flex: none;
  background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--display); font-weight: 600; font-size: 17px; text-transform: uppercase;
}
.cl-acct-info { flex: 1; min-width: 0; }
.cl-acct-email { font-size: 14px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-acct-status { font-family: var(--mono); font-size: 10.5px; color: var(--ink-mute); margin-top: 2px; }
.cl-acct-status.synced { color: var(--teal); }
.cl-acct-actions { display: flex; gap: 9px; margin-top: 18px; }
.cl-acct-actions button {
  flex: 1; border-radius: 9px; padding: 11px; font-family: var(--body); font-size: 13px; font-weight: 600; cursor: pointer;
  border: 1px solid var(--line); background: var(--paper); color: var(--ink);
}
.cl-acct-actions button:hover { background: var(--paper-warm); }
.cl-acct-actions button.danger { color: var(--accent); border-color: var(--accent-soft); }
.cl-acct-actions button.danger:hover { background: var(--accent-soft); }

/* tiny sync state pill near the header save indicator */
.cl-syncing { display: inline-flex; align-items: center; gap: 6px; }
.cl-spin {
  width: 11px; height: 11px; border: 2px solid var(--line); border-top-color: var(--accent);
  border-radius: 50%; animation: cl-spin 0.7s linear infinite;
}
@keyframes cl-spin { to { transform: rotate(360deg); } }

@media (max-width: 560px) {
  .cl-head { padding: 26px 22px 20px; }
  .cl-body { padding: 20px 22px 22px; }
}
