/* online.css — online account + sync UI (js/online/account-ui.js). App Developer, Nov 17, 2026.
 * v6 look: cream surface on emerald, gold accent, calm, no images. 44px targets, visible focus ring, AA contrast,
 * no overflow at 360px (MY wraps). No inline styles needed (strict CSP). */
.pa-on { background: var(--surface, #f6f1e6); color: var(--ink, #1a1610); border-radius: 18px; padding: 18px 16px 20px;
  max-width: 480px; margin: 0 auto 16px; box-sizing: border-box; overflow-wrap: anywhere; }
.pa-on *, .pa-on *::before, .pa-on *::after { box-sizing: border-box; }
.pa-on-title { margin: 0 0 6px; font-size: 1.25rem; line-height: 1.35; color: var(--teal, #0f2e24); }
.pa-on-title:focus { outline: none; }
.pa-on-title:focus-visible { outline: 3px solid var(--teal-2, #1a4a3a); outline-offset: 3px; border-radius: 6px; }
.pa-on-lede { margin: 0 0 14px; font-size: 0.92rem; line-height: 1.55; color: var(--ink-soft, #5c5146); }
html[lang="my"] .pa-on-lede, html[lang="my"] .pa-on-hint, html[lang="my"] .pa-on-warn { line-height: 1.75; }
.pa-on-form, .pa-on-stack { display: grid; gap: 10px; }
.pa-on-field { display: grid; gap: 4px; }
.pa-on-label { font-size: 0.86rem; font-weight: 700; color: var(--ink, #1a1610); }
.pa-on-input { width: 100%; min-height: 48px; padding: 10px 12px; font: inherit; font-size: 1rem; color: var(--ink, #1a1610);
  background: #fffdf8; border: 1px solid #a8987e; border-radius: 12px; }
.pa-on-input:focus-visible { outline: 3px solid var(--teal-2, #1a4a3a); outline-offset: 1px; border-color: var(--teal-2, #1a4a3a); }
.pa-on-input[aria-invalid="true"] { border-color: var(--rose, #9f1239); border-width: 2px; }
.pa-on-input:disabled { background: var(--surface-2, #efe6d2); color: var(--ink-soft, #5c5146); }
.pa-on-hint { margin: 0; font-size: 0.82rem; line-height: 1.5; color: var(--ink-soft, #5c5146); }
.pa-on-err { margin: 0; font-size: 0.86rem; line-height: 1.5; font-weight: 600; color: var(--rose, #9f1239); }
.pa-on-form-err { padding: 8px 12px; border-radius: 10px; background: #fbeef1; border: 1px solid #e8b9c6; }
.pa-on-warn { display: flex; gap: 8px; align-items: flex-start; margin: 2px 0; padding: 10px 12px; border-radius: 12px;
  font-size: 0.86rem; line-height: 1.5; color: var(--ink, #1a1610); background: var(--surface-2, #efe6d2);
  border-left: 4px solid var(--gold, #d4a64a); }
.pa-on-warn-mark { flex: 0 0 auto; width: 8px; height: 8px; margin-top: 0.5em; border-radius: 50%; background: var(--gold-dark, #7a5c28); }
.pa-on-working { margin: 0; font-size: 0.88rem; color: var(--teal-2, #1a4a3a); font-weight: 600; }
.pa-on-challenge:empty { display: none; }
.pa-on-challenge { min-height: 65px; }
.pa-on-btn { width: 100%; min-height: 48px; padding: 10px 14px; line-height: 1.35; white-space: normal; text-align: center; }
.pa-on .btn:focus-visible, .pa-on-link:focus-visible, .pa-on-sync-pill:focus-visible { outline: 3px solid var(--teal-2, #1a4a3a); outline-offset: 2px; }
.pa-on .btn-ghost.pa-on-btn { color: var(--teal-2, #1a4a3a); text-decoration: underline; text-underline-offset: 3px; }
.pa-on-danger { color: var(--rose, #9f1239) !important; border-color: #e8b9c6 !important; }
/* Filled danger (Delete my account): rose-on-rose was 1:1. Keep white text on the maroon fill (≥4.5:1). Light danger actions stay rose. */
.btn-danger.pa-on-danger { color: #fff !important; border-color: var(--rose, #9f1239) !important; }
.pa-on-links { display: flex; flex-wrap: wrap; gap: 4px 16px; justify-content: space-between; }
.pa-on-link { min-height: 44px; min-width: 44px; padding: 8px 2px; font: inherit; font-size: 0.92rem; font-weight: 600;
  color: var(--teal-2, #1a4a3a); background: none; border: 0; text-align: start; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.pa-on-link:disabled { color: var(--ink-soft, #5c5146); cursor: default; }
.pa-on-who { margin: 0; font-weight: 600; overflow-wrap: anywhere; }

/* sync pill: dot colour + text (never colour alone) */
.pa-on-sync { display: inline-flex; max-width: 100%; }
.pa-on-sync-pill { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; max-width: 100%; padding: 6px 14px;
  font: inherit; font-size: 0.82rem; font-weight: 600; line-height: 1.35; text-align: start; cursor: pointer;
  color: var(--ink-on-dark, #f6f1e6); background: rgba(8, 24, 20, 0.6); border: 1px solid color-mix(in srgb, var(--gold, #d4a64a) 45%, transparent); border-radius: 999px; }
.pa-on .pa-on-sync-pill, .pa-on-sync-pill.is-static { color: var(--ink, #1a1610); background: var(--surface-2, #efe6d2); border-color: var(--line, #e0d6c4); cursor: default; }
.pa-on-sync-pill:disabled { opacity: 1; }
.pa-on-sync-dot { flex: 0 0 auto; width: 9px; height: 9px; border-radius: 50%; background: #8fbf9f; box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.12); }
.pa-on-sync[data-status="synced"] .pa-on-sync-dot { background: #3fa36b; }
.pa-on-sync[data-status="pending"] .pa-on-sync-dot { background: var(--gold, #d4a64a); }
.pa-on-sync[data-status="syncing"] .pa-on-sync-dot { background: var(--gold, #d4a64a); animation: pa-on-pulse 1.2s ease-in-out infinite; }
.pa-on-sync[data-status="offline"] .pa-on-sync-dot, .pa-on-sync[data-status="signedOut"] .pa-on-sync-dot { background: #9a8f80; }
.pa-on-sync[data-status="conflict"] .pa-on-sync-dot, .pa-on-sync[data-status="error"] .pa-on-sync-dot { background: #e0607e; border-radius: 2px; }
@keyframes pa-on-pulse { 50% { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) { .pa-on-sync[data-status="syncing"] .pa-on-sync-dot { animation: none; } }

/* recovery words
 * PAO-C-013: 3 columns kicked in at 420px, so at 430px each cell had ~76px for the
 * word after padding, the number gutter and gap. 8-letter BIP39 words (remember,
 * mushroom) overflowed and the next cell painted over them (Firefox/WebKit; also
 * Chromium with a worst-case list). IT's pa-online-min.css also forces
 * white-space:nowrap on #pa-rec words (C-001: never split a word), so the track
 * has to be wide enough. Keep 2 columns below 560px; min-width:0 so grid tracks
 * can shrink; word text does not wrap. Print stays 3 columns. */
.pa-on-words { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
@media (min-width: 560px) { .pa-on-words { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.pa-on-word { display: flex; align-items: center; gap: 6px; min-height: 40px; min-width: 0; padding: 4px 8px; border-radius: 10px;
  background: var(--surface-2, #efe6d2); border: 1px solid var(--line, #e0d6c4); font-weight: 600; }
.pa-on-word-n { flex: 0 0 auto; min-width: 1.6em; font-size: 0.78rem; color: var(--gold-dark, #7a5c28); font-variant-numeric: tabular-nums; }
.pa-on-word-text { min-width: 0; flex: 1 1 auto; overflow-wrap: normal; word-break: keep-all; }
@media (max-width: 359px) {
  .pa-on-word { padding: 4px 6px; gap: 4px; }
  .pa-on-word-text { font-size: 0.9rem; }
}
.pa-on-words-in .pa-on-word { padding: 2px 4px 2px 6px; min-width: 0; }
/* Tighter horizontal padding + min-width:0 so 8-letter BIP39 words fit in a 2-col 360px cell without clipping (~4px was cut). 44px target kept. */
.pa-on-word-in { min-height: 44px; min-width: 0; flex: 1 1 auto; padding: 6px 4px; font-size: 0.9rem; }

/* v2: in-app sign-out dialog (confirmSignOutUnsynced) + calm notice (showNotice). No inline styles. */
/* Above IT .pa-auth (z-index 10000). openModal appends this to body, so 95 would paint behind the conflict overlay. */
.pa-on-backdrop { position: fixed; inset: 0; z-index: 10050; display: flex; align-items: flex-end; justify-content: center;
  padding: 0; background: rgba(12, 20, 16, 0.55); }
@media (min-width: 560px) { .pa-on-backdrop { align-items: center; padding: 16px; } }
.pa-on-dialog { width: 100%; max-width: 480px; max-height: 92dvh; overflow: auto; margin: 0; border-radius: 20px 20px 0 0;
  padding: 18px 16px calc(20px + env(safe-area-inset-bottom, 0px)); }
@media (min-width: 560px) { .pa-on-dialog { border-radius: 20px; } }
.pa-on-lede-p { margin: 0 0 6px; }
.pa-on-notice { position: fixed; left: 12px; right: 12px; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); z-index: 96;
  max-width: 480px; margin: 0 auto; display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 14px;
  background: var(--surface, #f6f1e6); color: var(--ink, #1a1610); border: 1px solid var(--line, #e0d6c4); border-left: 4px solid #3fa36b;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25); font-size: 0.92rem; line-height: 1.5; animation: pa-on-rise 0.2s ease; }
html[lang="my"] .pa-on-notice { line-height: 1.7; }
.pa-on-notice-mark { flex: 0 0 auto; width: 9px; height: 9px; margin-top: 0.5em; border-radius: 50%; background: #3fa36b; }
@keyframes pa-on-rise { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .pa-on-notice { animation: none; } }


/* Real-use 25 Nov 2026: recovery print layout + danger/warn dialogs */
.pa-on-sub { font-size: 1.05rem; margin: 0 0 8px; }
.pa-on-dialog-danger { border-top: 4px solid var(--rose, #9f1239); }
.pa-on-dialog-warn { border-top: 4px solid var(--gold, #d4a64a); }
@media print {
  .pa-on-sync, .pa-on-backdrop, .pa-on-notice, .pa-on-btn, .pa-on-link, .app-header, #splash, #pill-host, .pa-test-banner { display: none !important; }
  .pa-on-recovery { max-width: none; margin: 0; box-shadow: none; background: #fff; color: #000; }
  .pa-on-words { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pa-on-rec-confirm { display: none !important; }
}

/* rc4 25 Nov 2026: change-passphrase, Turnstile wrap, privacy/terms links */
.pa-on-challenge-wrap[hidden] { display: none; }
.pa-on-challenge-wrap:not(.is-required):has(.pa-on-challenge:empty) { display: none; }
.pa-on-challenge-label { margin: 0 0 4px; }
.pa-on-ok { margin: 0; padding: 8px 12px; border-radius: 10px; font-size: 0.86rem; line-height: 1.5; font-weight: 600;
  color: #1e6b3a; background: #e8f6ec; border: 1px solid #b7dfc3; }
.pa-on-legal-block { padding: 8px 12px; margin: 0; }
.pa-on-legal { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 10px 0 0; align-items: center; }
.pa-on-legal[hidden] { display: none; }
.pa-on-legal-lead { width: 100%; margin: 0; }
a.pa-on-link, a.pa-on-legal-link { display: inline-flex; align-items: center; }

/* PAO-C-011 (rc4.4)
 * Root cause: auth-gate.js appends #pa-sync-status to document.body after #app.
 * styles.css sets html,body{height:100%} and .tabbar{position:fixed;bottom:0;z-index:40}.
 * pa-online-min.css already adds body/main padding-bottom for C-004, but with
 * height:100% and box-sizing:border-box that padding cannot grow the document.
 * The in-flow 44px pill is then the last slice of the viewport (Me tab: 596–640)
 * and the 64px tab bar (576–640) paints over it. elementFromPoint at the pill
 * centre returns a tab button; Playwright clicks on #tab-me time out at the
 * end of long pages.
 * Fix: pin the pill just above the tab bar. z-index 45 is above .tabbar (40)
 * and far below .pa-auth (10000) and .pa-on-backdrop (10050), so confirm
 * stacking and the conflict trap stay as they are. The wrapper has
 * pointer-events:none so only the 44px button, not a full-width strip,
 * captures clicks. */
#pa-sync-status.pa-on-sync {
  position: fixed;
  z-index: 45;
  left: 0;
  right: 0;
  bottom: calc(var(--tab-h, 64px) + env(safe-area-inset-bottom, 0px) + 8px);
  display: flex;
  justify-content: center;
  width: auto;
  max-width: none;
  margin: 0;
  padding: 0 12px;
  pointer-events: none;
  box-sizing: border-box;
}
#pa-sync-status.pa-on-sync .pa-on-sync-pill { pointer-events: auto; max-width: min(100%, 36rem); }
body.onboarding-mode #pa-sync-status.pa-on-sync,
body.lock-mode #pa-sync-status.pa-on-sync {
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
}
/* Keep the last in-page content clear of the fixed pill (44px + 8px gap above the tab bar). */
body:not(.onboarding-mode):not(.lock-mode) main {
  padding-bottom: calc(var(--tab-h, 64px) + env(safe-area-inset-bottom, 0px) + 60px);
}
