/* ------------------------------------------------------------------ Plaid updates (pu-)
   The "updated by Plaid" dot (PlaidUpdateDot) and the Let Plaid update / Keep mine choice (PlaidModeChoice), shared by
   the transaction popup and the liabilities editors and lists. The same look as the mobile app's PlaidUpdateDot and
   PlaidModeChoice: a small green dot with a soft ring and a tooltip; a two-option segmented control on the form scale.
   Neutral surfaces; the green is the dot's only color. Light and dark. */

:root {
    --pu-green: #16A34A;
    --pu-green-ring: rgba(22, 163, 74, .22);
    --pu-tip-bg: #0B0F19;
    --pu-tip-text: #F3F5FA;
    --pu-track: var(--tx-surface, #F3F5FA);
    --pu-border: var(--tx-border, #E2E5F1);
    --pu-text: var(--tx-text, #0B0F19);
    --pu-muted: var(--tx-muted, #565973);
    --pu-selected: #FFFFFF;
}

[data-bs-theme="dark"] {
    --pu-green: #22C55E;
    --pu-green-ring: rgba(34, 197, 94, .24);
    --pu-tip-bg: #F3F5FA;
    --pu-tip-text: #0B0F19;
    --pu-selected: rgba(255, 255, 255, .1);
}

/* The dot */
.pu-dot-wrap { position: relative; display: inline-flex; align-items: center; vertical-align: middle; }
.pu-dot { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; padding: 0; border: 0; border-radius: 50%; background: transparent; cursor: pointer; }
.pu-dot:focus-visible { outline: 2px solid var(--pu-green); outline-offset: 1px; }
.pu-dot-mark { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--pu-green); box-shadow: 0 0 0 3px var(--pu-green-ring); }
.pu-dot-mark::after { content: ""; position: absolute; inset: -3px; border-radius: 50%; border: 2px solid var(--pu-green); opacity: 0; animation: pu-ping 2.4s ease-out 3; }
@keyframes pu-ping { 0% { transform: scale(.6); opacity: .55; } 80%, 100% { transform: scale(1.9); opacity: 0; } }

.pu-tip { position: absolute; left: 50%; bottom: calc(100% + 8px); z-index: 30; display: flex; flex-direction: column; gap: 3px; width: max-content; max-width: 260px; padding: 9px 11px; border-radius: 10px; background: var(--pu-tip-bg); color: var(--pu-tip-text); font-family: var(--tx-font-text, inherit); font-size: 12px; font-weight: 500; line-height: 1.4; text-align: left; white-space: normal; box-shadow: 0 10px 28px rgba(11, 15, 25, .22); opacity: 0; visibility: hidden; transform: translate(-50%, 4px); transition: opacity .15s ease, transform .15s ease, visibility 0s linear .15s; pointer-events: none; }
.pu-dot-wrap.is-below .pu-tip { top: calc(100% + 8px); bottom: auto; transform: translate(-50%, -4px); }
.pu-dot-wrap:hover .pu-tip, .pu-dot-wrap:focus-within .pu-tip, .pu-dot-wrap.is-open .pu-tip { opacity: 1; visibility: visible; transform: translate(-50%, 0); transition-delay: 0s; }
.pu-tip { text-transform: none; letter-spacing: normal; }
.pu-tip-title { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 11.5px; letter-spacing: .01em; }
.pu-tip-title .fa-solid { color: var(--pu-green); font-size: 10px; }
.pu-tip-text { font-weight: 500; }

/* The choice */
.pu-choice { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.pu-choice-track { display: inline-flex; align-self: flex-start; max-width: 100%; gap: 2px; padding: 3px; border: 1px solid var(--pu-border); border-radius: 12px; background: var(--pu-track); }
.pu-choice-opt { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 4px 11px; border: 1px solid transparent; border-radius: 9px; background: transparent; color: var(--pu-muted); font-family: var(--tx-font, inherit); font-size: var(--ci-fs-btn-xs, 12px); font-weight: 600; white-space: nowrap; cursor: pointer; transition: background-color .15s ease, color .15s ease, border-color .15s ease; }
.pu-choice-opt .fa-solid { font-size: 10.5px; }
.pu-choice-opt:hover:not(:disabled) { color: var(--pu-text); }
.pu-choice-opt.is-selected { border-color: var(--pu-border); background: var(--pu-selected); color: var(--pu-text); box-shadow: 0 1px 2px rgba(11, 15, 25, .06); }
.pu-choice-opt.is-selected .fa-solid { color: var(--tx-primary, #5A45E6); }
.pu-choice-opt:focus-visible { outline: 2px solid var(--tx-primary, #5A45E6); outline-offset: 1px; }
.pu-choice-opt:disabled { opacity: .55; cursor: default; }
.pu-choice-hint { margin: 0; font-size: var(--ci-fs-help, 12px); line-height: 1.4; color: var(--pu-muted); }
.pu-choice.is-compact .pu-choice-opt { min-height: 26px; padding: 3px 9px; font-size: 11.5px; }

@media (max-width: 420px) {
    .pu-choice-opt { padding: 4px 8px; }
    .pu-choice-opt span { white-space: normal; text-align: left; }
}


/* Liabilities: beside a detail's label (flyout facts and tiles, loan sheet, field editor), and the choice under a field. */
.lbf-pu-dot, .ln-pu-dot, .lb-fx-pu-dot { margin-left: 2px; }
.ln-eyebrow .pu-dot-wrap { margin-left: 2px; vertical-align: -3px; }
.ln-field-head .pu-dot-wrap { flex: 0 0 auto; }
.lb-fx-head .pu-dot-wrap { flex: 0 0 auto; margin-right: auto; }
.ln-plaid-choice { margin-top: 8px; }

@media (prefers-reduced-motion: reduce) {
    .pu-dot-mark::after { animation: none; }
    .pu-tip, .pu-choice-opt { transition: none; }
}
