/* Member extras on the Float tokens: watch menu, popovers (rep, emoji, mentions), live toasts,
   draft hint, ignored posts, @mention links. Motion is CSS-first and calm under reduced motion. */

/* ---------- popovers share one floating look ---------- */
.rep-pop, .emoji-pop, .mention-pop { position: fixed; z-index: 95; border-radius: var(--r-md); box-shadow: var(--rim), var(--e-3);
  background: var(--surface-solid); transform-origin: top left; animation: pop-in var(--t-med) var(--ease-spring) both; }
.rep-pop.up, .emoji-pop.up, .mention-pop.up { transform-origin: bottom left; }
.rep-pop.out, .emoji-pop.out { opacity: 0; transform: scale(.96) translateY(-4px); transition: opacity 160ms var(--ease-glide), transform 160ms var(--ease-glide); }
@keyframes pop-in { from { opacity: 0; transform: scale(.94) translateY(-6px); } }

/* ---------- inline reputation ---------- */
.rep-pop { width: min(340px, calc(100vw - 16px)); padding: 14px 16px; }
.rep-pop-h { font: 700 var(--fs-xs)/1 var(--font-ui); letter-spacing: .06em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 10px; }
.rep-pop .rep-load { color: var(--text-muted); font-size: var(--fs-sm); padding: 6px 0; }
.rep-form { display: grid; gap: 10px; padding: 0; }
.rep-form .snippet { font-size: var(--fs-sm); color: var(--text-muted); max-height: 4.5em; overflow: hidden; }
.rep-form .rep-choice { display: flex; gap: 8px; flex-wrap: wrap; }
.rep-form .rep-choice .check { flex: 1; white-space: nowrap; display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: var(--r-pill); background: var(--surface-2); cursor: pointer; font-size: var(--fs-sm); transition: background-color var(--t-fast), box-shadow var(--t-fast); }
.rep-form .rep-choice .check:has(input:checked) { background: var(--accent-soft); box-shadow: inset 0 0 0 1.5px var(--accent); }
.rep-form label { font-size: var(--fs-sm); }
.rep-form input[name="comment"] { width: 100%; margin-top: 4px; }
.rep-form .form-actions { margin: 0; }
.rep-form .form-actions .btn { width: 100%; }
.act.rep-pop-sent svg { animation: pop 520ms var(--ease-spring); }
.act[aria-pressed="true"] { color: var(--pos); }

/* ---------- emoji ---------- */
.emoji-pop { width: min(320px, calc(100vw - 16px)); max-height: min(320px, 50vh); overflow: auto; padding: 8px 10px 10px; overscroll-behavior: contain; }
.emo-h { padding: 8px 4px 4px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.emo-g { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; }
.emo-g button { border: 0; background: none; font-size: 22px; line-height: 1; padding: 6px 0; border-radius: var(--r-sm); cursor: pointer; transition: transform var(--t-fast) var(--ease-spring), background-color var(--t-fast); }
.emo-g button:hover, .emo-g button:focus-visible { background: var(--surface-2); transform: scale(1.18); outline: none; }
.editor .toolbar .emo-btn { margin-left: auto; font-size: 16px; padding: 4px 10px; }
.dock .emo-btn { font-size: 20px; align-self: center; }

/* ---------- @mentions ---------- */
.mention-pop { min-width: 220px; max-width: min(320px, calc(100vw - 16px)); padding: 6px; }
.mention-pop button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: var(--r-sm); background: none; color: var(--text); text-align: left; cursor: pointer; font: 600 var(--fs-sm)/1.2 var(--font-ui); }
.mention-pop button .xs { margin-left: auto; }
.mention-pop button[aria-selected="true"], .mention-pop button:hover { background: var(--accent-soft); }
a.mention { font-weight: 650; color: var(--accent); background: var(--accent-soft); padding: 0 .3em; border-radius: 6px; text-decoration: none; }
a.mention:hover { text-decoration: underline; }

/* ---------- live toasts ---------- */
.mtoasts { position: fixed; z-index: 96; top: calc(84px + env(safe-area-inset-top)); right: 18px; display: grid; gap: 10px; width: min(360px, calc(100vw - 32px)); pointer-events: none; }
.mtoast { pointer-events: auto; display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; color: var(--text); text-decoration: none; font-size: var(--fs-sm); line-height: 1.4;
  box-shadow: var(--rim), var(--e-3); background: var(--surface-solid); animation: toast-in var(--t-slow) var(--ease-spring) both;
  transition: opacity 280ms var(--ease-glide), transform 280ms var(--ease-glide), box-shadow var(--t-med); }
a.mtoast:hover { box-shadow: var(--rim), var(--e-3), 0 0 0 1.5px var(--accent); }
.mtoast.out { opacity: 0; transform: translateX(24px) scale(.98); }
.mt-ico { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); font-size: 15px; }
.mt-text { flex: 1; padding-top: 5px; }
.mt-x { flex: none; border: 0; background: none; color: var(--text-faint); font-size: 18px; line-height: 1; padding: 4px 6px; border-radius: 50%; cursor: pointer; }
.mt-x:hover { background: var(--surface-2); color: var(--text); }
@keyframes toast-in { from { opacity: 0; transform: translateX(32px) scale(.96); } }
@media (max-width: 720px) {
  .mtoasts { top: auto; bottom: calc(150px + env(safe-area-inset-bottom)); left: 16px; right: 16px; width: auto; }
  @keyframes toast-in { from { opacity: 0; transform: translateY(18px) scale(.97); } }
  .mtoast.out { transform: translateY(12px) scale(.98); }
}

/* ---------- drafts ---------- */
.draft-hint { margin: 6px 4px 0; min-height: 1.2em; }
.draft-hint .linkish { border: 0; background: none; padding: 0; color: var(--accent); font: inherit; cursor: pointer; }
.draft-hint .linkish:hover { text-decoration: underline; }

/* ---------- watch ---------- */
.watch-menu .menu-pop { min-width: 260px; }
.thead-tools .watch-menu .menu-pop { right: 0; left: auto; }
.watch-hint { padding: 6px 12px 6px; }
.watch-menu .menu-item[aria-pressed="true"]::after { content: "✓"; float: right; color: var(--accent); }
.watch-menu summary.btn.on { color: var(--accent); box-shadow: var(--rim), var(--e-1), inset 0 0 0 1.5px color-mix(in oklab, var(--accent) 40%, transparent); }
.watch-row, .ignore-row { align-items: center; }
.watch-row form, .ignore-row form { margin: 0 0 0 auto; }
.settings-links { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- ignored posts ---------- */
details.ignored { margin: 0 0 var(--gap-float); }
details.ignored > summary { list-style: none; display: flex; align-items: center; gap: 12px; padding: 12px 18px; cursor: pointer; color: var(--text-muted); font-size: var(--fs-sm); opacity: .85; transition: opacity var(--t-fast); }
details.ignored > summary::-webkit-details-marker { display: none; }
details.ignored > summary:hover { opacity: 1; }
details.ignored > summary .show { margin-left: auto; color: var(--accent); font-weight: 650; }
details.ignored[open] > summary .show::before { content: "Hide · "; color: var(--text-faint); font-weight: 500; }
details.ignored.compact > summary { padding: 6px 12px; background: none; box-shadow: none; }

@media (prefers-reduced-motion: reduce) {
  .rep-pop, .emoji-pop, .mention-pop, .mtoast { animation: none; }
  .emo-g button:hover { transform: none; }
}

/* An open header menu (Watch, Moderate) floats above the cards below it: the header's entry animation
   gives it its own stacking layer, so lift the whole header while a menu is open. */
.thead:has(details.menu[open]) { position: relative; z-index: 30; }

/* Settings > Security: two-factor setup, recovery codes, signed-in browsers (twofactor.py) */
.twofa-setup { display: flex; gap: var(--s-4, 16px); align-items: flex-start; flex-wrap: wrap; margin-top: 12px; }
.twofa-qr { flex: none; padding: 10px; border-radius: 16px; background: #fff; box-shadow: 0 1px 2px hsl(var(--sh) / .08), 0 8px 24px hsl(var(--sh) / .08); line-height: 0; }
.twofa-qr svg { width: 184px; height: 184px; }
.twofa-setup > div:last-child { flex: 1 1 260px; min-width: 0; }
.twofa-key { display: inline-block; font-family: var(--font-mono); letter-spacing: .04em; overflow-wrap: break-word; padding: 2px 8px; border-radius: 8px; background: var(--surface-2); }
.recovery-codes { columns: 2; gap: 24px; padding-left: 1.4em; font-family: var(--font-mono); font-size: var(--fs-md); }
.recovery-codes li { padding: 3px 0; }
.session-list { list-style: none; margin: 0 0 12px; padding: 0; }
.session-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.session-row:last-child { border-bottom: 0; }
.session-row .btn { white-space: nowrap; }
.session-row .pill { font-size: var(--fs-xs); padding: 3px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); white-space: nowrap; }
@media (max-width: 520px) { .twofa-qr { margin: 0 auto; } .recovery-codes { columns: 1; } }
