/* =========================================================================
   views/seo — SEO partner access: the invitation page (Seo.html, /seo#invite=…: src/features/seo/seoInvite.js), and
   the agency's "SEO partner access" sheet (seoAccess.js) and its activity list (seoActivity.js). A partner works in
   the client portal itself (server/services/partnerPortal), so there is no workspace of its own here.
   Linked by Seo.html, Magnet CRM.html and Client App.html.
   Prefix: seo- (seo-gate- the invitation's card, seo-acc- the access sheet, seo-log- the activity list).
   ========================================================================= */

body.seo-body { min-height: 100vh; min-height: 100dvh; background: var(--surface-sunk); }
.seo-brand { display: inline-flex; align-items: center; gap: var(--space-2); flex: none; font-weight: var(--fw-semibold); color: var(--text-strong); }
.seo-brand img { display: block; width: 20px; height: 20px; }

/* ---- the invitation's card ---- */
.seo-gate { display: flex; align-items: center; justify-content: center; min-height: 100vh; min-height: 100dvh; padding: var(--space-6) var(--space-4); }
.seo-gate-card {
  display: flex; flex-direction: column; gap: var(--space-4); width: 100%; max-width: 440px; padding: var(--space-8);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-2xl); box-shadow: var(--shadow-lg);
}
.seo-gate-title { margin: 0; font-size: var(--text-2xl); font-weight: var(--fw-semibold); line-height: var(--leading-tight); color: var(--text-strong); }
.seo-gate-text { margin: 0; font-size: var(--text-md); line-height: var(--leading-normal); color: var(--text-muted); }
.seo-gate-text b { font-weight: var(--fw-medium); color: var(--text-strong); }
.seo-gate-note { display: flex; align-items: flex-start; gap: var(--space-2); margin: 0; padding: var(--space-3); border-radius: var(--radius-md); background: var(--surface-sunk); font-size: var(--text-sm); color: var(--text); }
.seo-gate-note svg { flex: none; width: 16px; height: 16px; margin-top: 2px; color: var(--text-soft); }
.seo-gate-cta { width: 100%; }
.seo-gate-foot { margin: 0; font-size: var(--text-xs); color: var(--text-soft); }
.seo-gate-form { display: flex; flex-direction: column; gap: var(--space-3); }
.seo-gate-form .field-msg { margin: 0; }
.seo-field { display: flex; flex-direction: column; gap: var(--space-1-5); min-width: 0; }
.seo-label { font-size: var(--text-sm); font-weight: var(--fw-medium); color: var(--text-strong); }
.seo-gate-load { display: flex; align-items: center; justify-content: center; gap: var(--space-2); font-size: var(--text-sm); color: var(--text-muted); }
.seo-pin { display: flex; justify-content: center; gap: var(--space-2); }
.seo-pin span {
  display: grid; place-items: center; width: 44px; height: 52px;
  border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface-sunk);
  font-size: var(--text-2xl); font-weight: var(--fw-semibold); font-variant-numeric: tabular-nums; color: var(--text-strong);
}
.seo-pin-copy { align-self: center; }

/* ---- the access sheet (seoAccess.js) ---- */
.seo-acc { display: flex; flex-direction: column; gap: var(--space-6); }
.seo-acc-lead { margin: 0; font-size: var(--text-sm); line-height: var(--leading-normal); color: var(--text-muted); }
.seo-acc-h { display: flex; align-items: center; gap: var(--space-2); margin: 0 0 var(--space-3); font-size: var(--text-md); font-weight: var(--fw-semibold); color: var(--text-strong); }
/* (how many have access, beside the heading: Plane's "Pending invites 3") */
.seo-acc-count { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 var(--space-1-5); border-radius: var(--radius-full); background: var(--surface-sunk); font-size: var(--text-xs); font-weight: var(--fw-medium); font-variant-numeric: tabular-nums; color: var(--text-muted); }
.seo-acc-count[hidden] { display: none; }
.seo-acc-invite { display: flex; flex-direction: column; gap: var(--space-3); }
.seo-acc-invite[hidden] { display: none; }
.seo-acc-invite .seo-acc-h { margin: 0; }
.seo-acc-field { display: flex; flex-direction: column; gap: var(--space-1-5); min-width: 0; }
.seo-acc-field > span { font-size: var(--text-sm); font-weight: var(--fw-medium); color: var(--text-strong); }
.seo-acc-field i { font-style: normal; font-weight: var(--fw-regular); color: var(--text-soft); }
.seo-acc-pair { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
/* Create an account: its button on the fields' line (an empty caption above it keeps it level with the boxes, whatever
   line a field's message adds under them) */
.seo-acc-create .seo-acc-pair { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; }
.seo-acc-go .btn { height: var(--control-md); white-space: nowrap; }   /* (as tall as the boxes beside it) */
.seo-acc-hint { margin: calc(-1 * var(--space-1)) 0 0; font-size: var(--text-xs); color: var(--text-soft); }
.seo-acc-send { display: flex; justify-content: flex-end; }
.seo-acc-link { display: flex; flex-direction: column; gap: var(--space-2); }
.seo-acc-link[hidden] { display: none; }
.seo-acc-link .field-msg { margin: 0; }
.seo-acc-link .field-msg svg { color: var(--text-soft); }
.seo-acc-copy { display: flex; gap: var(--space-2); }
.seo-acc-copy .input { flex: 1 1 auto; min-width: 0; }
.seo-acc-sec { padding-top: var(--space-6); border-top: 1px solid var(--border-faint); }
/* a person's or an actor's initial: a quiet disc, the name beside it in ink (one colour for all: the sheet stays calm) */
.seo-av { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; background: var(--surface-sunk); box-shadow: inset 0 0 0 1px var(--border-faint); font-size: var(--text-xs); font-weight: var(--fw-semibold); color: var(--text-muted); }
.seo-acc-sec[hidden] { display: none; }
.seo-acc-list { margin: 0; padding: 0; list-style: none; border: 1px solid var(--border); border-radius: var(--radius-lg); }
.seo-acc-row { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-3) var(--space-3) var(--space-3-5); }
/* (revoked: kept for the record, read past) */
.seo-acc-row.is-revoked .seo-av, .seo-acc-row.is-revoked .seo-acc-who b { color: var(--text-soft); }
.seo-acc-row + .seo-acc-row { border-top: 1px solid var(--border-faint); }
.seo-acc-who { display: flex; flex: 1 1 auto; flex-direction: column; gap: var(--space-0-5); min-width: 0; }
.seo-acc-who b { font-size: var(--text-sm); font-weight: var(--fw-medium); color: var(--text-strong); overflow-wrap: anywhere; }
.seo-acc-who small { font-size: var(--text-xs); color: var(--text-soft); overflow-wrap: anywhere; }
.seo-acc-acts { display: inline-flex; flex: none; gap: var(--space-0-5); }
.seo-acc-none { margin: 0; font-size: var(--text-sm); color: var(--text-soft); }
/* the revoke dialog's "also take their verification code off" (inside the shared confirm's description) */
.seo-acc-drop { display: flex; align-items: flex-start; gap: var(--space-2); margin-top: var(--space-3); font-size: var(--text-sm); color: var(--text-strong); cursor: pointer; }
.seo-acc-drop .checkbox { flex: none; margin-top: 1px; }
/* the sign-in PIN, shown once after Create account or New PIN: one quiet box under the form (one border level) */
.seo-acc-pin { display: flex; flex-direction: column; gap: var(--space-2-5); padding: var(--space-4); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.seo-acc-pin[hidden] { display: none; }
.seo-acc-pin p { margin: 0; }
.seo-acc-pin-title { display: flex; align-items: flex-start; gap: var(--space-2); font-size: var(--text-sm); font-weight: var(--fw-medium); color: var(--text-strong); }
.seo-acc-pin-title svg { flex: none; width: 16px; height: 16px; margin-top: 2px; color: var(--success-600); }
.seo-acc-pin-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.seo-acc-pin-num { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: var(--text-2xl); font-weight: var(--fw-semibold); font-variant-numeric: tabular-nums; letter-spacing: 0.22em; color: var(--text-strong); user-select: all; }
.seo-acc-pin-how { font-size: var(--text-sm); line-height: var(--leading-normal); color: var(--text-muted); overflow-wrap: anywhere; }
.seo-acc-pin-how b { font-weight: var(--fw-medium); color: var(--text-strong); }
.seo-acc-pin-once { display: flex; align-items: flex-start; gap: var(--space-2); font-size: var(--text-xs); color: var(--text-soft); }
.seo-acc-pin-once svg { flex: none; width: 14px; height: 14px; margin-top: 1px; }
.seo-acc-acts .btn-sm { gap: var(--space-1-5); }

/* ---- the activity list (seoActivity.js) ---- */
/* grouped by day (Coda's and Vercel's activity): the day a caption, its entries under it, each led by who did it */
.seo-log, .seo-log-rows { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.seo-log { gap: var(--space-5); }
.seo-log-day[hidden], .seo-log-row[hidden] { display: none; }
.seo-log-date { margin: 0 0 var(--space-1); font-size: var(--text-xs); font-weight: var(--fw-medium); color: var(--text-soft); }
.seo-log-row { display: flex; align-items: flex-start; gap: var(--space-3); padding: var(--space-2) 0; }
.seo-log-row .seo-av { width: 24px; height: 24px; font-size: var(--text-3xs); }
.seo-log-body { flex: 1 1 auto; min-width: 0; padding-top: var(--space-0-5); }
.seo-log-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); }
.seo-log-line { min-width: 0; font-size: var(--text-sm); line-height: var(--leading-snug); color: var(--text-muted); overflow-wrap: anywhere; }
.seo-log-line b { font-weight: var(--fw-medium); color: var(--text-strong); }
.seo-log-more { align-self: flex-start; margin-top: var(--space-2); }
.seo-log-when { flex: none; font-size: var(--text-xs); color: var(--text-soft); white-space: nowrap; }
.seo-log-changes { display: flex; flex-direction: column; gap: var(--space-1); margin: var(--space-1-5) 0 0; }
.seo-log-changes > div { display: grid; grid-template-columns: minmax(96px, max-content) 1fr; gap: var(--space-2); font-size: var(--text-xs); }
.seo-log-changes dt { color: var(--text-soft); }
.seo-log-changes dd { margin: 0; min-width: 0; color: var(--text-muted); overflow-wrap: anywhere; }
.seo-log-from { color: var(--text-soft); text-decoration: line-through; }
.seo-log-arrow { margin: 0 var(--space-1); color: var(--text-soft); }
.seo-log-to { color: var(--text-strong); }
.seo-log-none { margin: 0; font-size: var(--text-sm); color: var(--text-soft); }

@media (max-width: 640px) {
  .seo-gate-card { padding: var(--space-6) var(--space-5); }
  .seo-acc-pair, .seo-acc-create .seo-acc-pair { grid-template-columns: 1fr; }
  .seo-acc-go > span { display: none; }
  .seo-acc-go .btn { width: 100%; }
  /* (a row's name and details take the whole line; its status and New PIN / Revoke go under them) */
  .seo-acc-row { flex-wrap: wrap; row-gap: var(--space-2); }
  .seo-acc-who { flex-basis: calc(100% - 32px - var(--space-3)); }
  .seo-acc-acts { margin-left: auto; }
  .seo-log-changes > div { grid-template-columns: 1fr; gap: 0; }
}
@media (pointer: coarse) {
  .seo-pin span { width: 46px; height: 56px; }
}
