/* Owner: package P4 (Sign-in, My Account, theme info, notifications and toasts). Clockface Online rebrand overrides, linked last in the index.php head. */

/* Scope: the account overlays carry .cfo-acct (share profile, log in, log out, reset password,
   My Account, theme info, notifications). "body#body .cfo-acct" outranks the legacy
   "body.dark-mode .action-btn" and ".apply-comm-btn:hover" rules, so the cfo- button variants
   look the same in both themes without touching style.css outside this package's ranges. */

/* ---------- Dialog base ---------- */
body#body .cfo-acct .community-modal-content {
    font-family: var(--font-sans);
    color: var(--text-primary);
}
body#body .cfo-acct .community-modal-content a:not(.cfo-btn):not(.cfo-icon-btn) { color: var(--accent-ink); }

/* ---------- Titles and text ---------- */
body#body .cfo-acct .cfo-acct-title {
    margin: 0 0 var(--space-5);
    font-family: inherit;
    font-size: 22px;
    line-height: 30px;
    font-weight: 700;
    color: var(--ink);
    word-break: break-word;
}
body#body .cfo-acct .cfo-acct-title-md { font-size: 20px; line-height: 28px; margin-bottom: var(--space-2); }
body#body .cfo-acct .cfo-acct-title-sm { font-size: 18px; line-height: 26px; margin-bottom: 6px; }
.cfo-acct-title-icon { color: var(--accent-ink); }
#shareProfileModal .cfo-acct-title-icon { color: var(--primary-ink); }
.cfo-acct-lede { margin: 0 0 18px; font-size: 14px; line-height: 20px; color: var(--text-secondary); }
.cfo-acct-help { margin: 0; font-size: 14px; line-height: 20px; color: var(--text-secondary); }
.cfo-acct-caption { font-size: 12px; line-height: 18px; color: var(--text-secondary); }
.cfo-acct-meta { font-size: 12px; line-height: 16px; color: var(--text-secondary); }
.cfo-acct-text-danger { color: var(--danger); }
.cfo-acct-hero-icon { display: block; margin: 0 auto 15px; font-size: 40px; color: var(--accent-ink); }
.cfo-acct-spinner { font-size: 28px; color: var(--accent-ink); }

/* Messages under forms: errors in --danger, success in --primary-ink (JS writes var() strings for the tone). */
.cfo-acct-error {
    margin-top: var(--space-1);
    font-size: 13px;
    line-height: 18px;
    font-weight: 500;
    color: var(--danger);
}
.cfo-acct-msg {
    margin-top: 10px;
    font-size: 13px;
    line-height: 18px;
    font-weight: 600;
    text-align: center;
    color: var(--text-secondary);
}
.cfo-acct-msg-success { color: var(--primary-ink); }

/* ---------- Buttons inside the account overlays (both themes) ---------- */
body#body .cfo-acct .cfo-btn {
    background: var(--primary);
    color: var(--on-primary);
    border-color: transparent;
    font-family: inherit;
    text-decoration: none;
}
body#body .cfo-acct .cfo-btn:hover { background: var(--primary); }
body#body .cfo-acct .cfo-btn.cfo-btn-secondary { background: var(--surface-subtle); color: var(--text-primary); }
body#body .cfo-acct .cfo-btn.cfo-btn-secondary:hover { background: var(--surface-hover); }
body#body .cfo-acct .cfo-btn.cfo-btn-outline { background: transparent; color: var(--text-primary); border-color: var(--border-control); }
body#body .cfo-acct .cfo-btn.cfo-btn-outline:hover { background: var(--surface-subtle); }
body#body .cfo-acct .cfo-btn.cfo-btn-ghost { background: transparent; color: var(--accent-ink); }
body#body .cfo-acct .cfo-btn.cfo-btn-ghost:hover { background: var(--surface-subtle); }
body#body .cfo-acct .cfo-btn.cfo-btn-danger { background: var(--danger-tint); color: var(--danger); }
body#body .cfo-acct .cfo-btn.cfo-btn-danger:hover { background: var(--danger-tint); border-color: currentColor; }
body#body .cfo-acct .cfo-btn.cfo-btn-plus { background: var(--gold); color: var(--on-primary); }
body#body .cfo-acct .cfo-btn.cfo-btn-plus:hover { background: var(--gold); }
/* body.dark-mode .action-btn forces a hairline border with !important. */
body#body .cfo-acct .cfo-btn.action-btn { border-color: transparent !important; }
body#body .cfo-acct .cfo-btn.cfo-btn-outline.action-btn { border-color: var(--border-control) !important; }
body#body .cfo-acct .cfo-btn.cfo-btn-danger.action-btn:hover { border-color: currentColor !important; }
.cfo-acct .cfo-btn.full-width { width: 100%; }
.cfo-acct .cfo-btn i, .cfo-acct .cfo-btn svg { pointer-events: none; }

/* ---------- Notices ---------- */
.cfo-acct-banner { margin-bottom: var(--space-5); text-align: left; }
/* js/index.js ~15805 (outside this package) shows #redirectBanner with display:block; keep the notice layout. */
#redirectBanner.cfo-notice[style*="block"] { display: flex !important; }
.cfo-acct .cfo-notice-body { color: var(--text-primary); }
.cfo-acct-notice-small { font-size: 12px; line-height: 18px; }

/* ---------- Share profile (paper) ---------- */
@media (max-width: 600px) {
    #shareProfileModal.community-modal-overlay { align-items: flex-end !important; }
}
#shareProfileModal .cfo-field-inline { align-items: center; }
#shareProfileModal .cfo-input { font-size: 13px; }
#shareProfileQrCode { border: 1px solid var(--border); }
.cfo-acct-share-row { display: flex; gap: 10px; justify-content: center; }
#shareProfileModal .cfo-icon-btn {
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 18px;
}
#shareProfileModal .cfo-icon-btn:hover { background: var(--surface-hover); }

/* ---------- Log in, sign up, forgot, QR, Google/Apple terms ---------- */
@media (max-width: 400px) {
    #loginModal .community-modal-content,
    #resetPasswordModal .community-modal-content { padding: 32px 16px 24px !important; }
}
.cfo-acct-auth-tabs { display: flex; max-width: 280px; margin: 0 auto var(--space-5); }
.cfo-acct-auth-tabs .cfo-tab { flex: 1; font-family: inherit; }
.cfo-acct-sso { min-height: 44px; }
.cfo-acct-or { margin-bottom: var(--space-5); text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; font-size: 11px; color: var(--text-secondary); }
.cfo-acct-or span { padding: 0 var(--space-1); }

#loginModal .custom-input,
#resetPasswordModal .custom-input,
#editProfileModal .custom-input { width: 100%; box-sizing: border-box; }
.cfo-acct-pw { position: relative; }
.cfo-acct-pw .custom-input { padding-right: 48px; }
.cfo-acct-pw-toggle {
    position: absolute;
    top: 0;
    right: 0;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--text-secondary);
    font: inherit;
    font-size: 15px;
    cursor: pointer;
    transition: color var(--dur-fast) var(--ease);
}
.cfo-acct-pw-toggle:hover, .cfo-acct-pw-toggle[aria-pressed="true"] { color: var(--text-primary); }

.cfo-acct-login-meta { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: var(--space-2); font-size: 14px; }
.cfo-acct-login-links { display: flex; align-items: center; gap: var(--space-1); flex-wrap: wrap; justify-content: flex-end; }
.cfo-acct-check { display: flex; align-items: center; gap: var(--space-2); margin: 0; color: var(--text-secondary); cursor: pointer; white-space: nowrap; min-height: 36px; }
.cfo-acct-check input { width: 18px; height: 18px; margin: 0; flex-shrink: 0; accent-color: var(--primary); cursor: pointer; }
.cfo-acct-check-terms { align-items: flex-start; white-space: normal; text-align: left; font-size: 12px; line-height: 18px; min-height: 0; }
.cfo-acct-check-terms input { margin-top: 0; }
.cfo-acct-check-terms .cfo-link { font-weight: 500; }

.cfo-acct-checklist { display: none; flex-wrap: wrap; gap: 12px; margin-top: -4px; padding: 0 2px; font-size: 12px; line-height: 16px; color: var(--text-secondary); }
.cfo-acct-checklist span { display: inline-flex; align-items: center; gap: var(--space-1); }
.cfo-acct-checklist .fa-circle { font-size: 8px; }
.cfo-acct-checklist .fa-check-circle { font-size: 12px; }
.cfo-acct-checklist .is-met { color: var(--primary-ink); }

.cfo-acct-footnote { margin-top: -2px; text-align: center; font-size: 12px; line-height: 16px; color: var(--text-tertiary); }
.cfo-acct-footnote i, .cfo-acct-footnote svg { color: var(--primary-ink); }
.cfo-acct-back { align-self: center; margin-top: var(--space-1); }

.cfo-acct-qr { border: 1px solid var(--border); border-radius: var(--radius-lg); transition: opacity var(--dur-base) var(--ease); }
.cfo-acct-qr-status { display: flex; align-items: center; gap: 6px; font-size: 13px; line-height: 18px; font-weight: 600; color: var(--text-secondary); }

/* ---------- My Account ---------- */
@media (max-width: 600px) {
    #editProfileModal .community-modal-content { padding: 28px 16px 20px !important; }
}
#editProfileModal .cfo-acct-tabs { justify-content: center; flex-wrap: wrap; gap: var(--space-1); margin-bottom: var(--space-5); }
#editProfileModal .cfo-acct-tabs .theme-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 40px;
    padding: 0 var(--space-4);
    font-family: inherit;
    font-size: 14px;
}

/* Panels: wells on --surface-subtle, nested rows on --surface (beats body.dark-mode .pref-panel). */
#editProfileModal .pref-panel.cfo-acct-row { background: var(--surface) !important; border-color: var(--border) !important; border-radius: var(--radius-md); }
#editProfileModal .danger-zone-panel { background: var(--danger-tint) !important; border-color: var(--danger-line) !important; }
#editProfileModal h4.cfo-acct-danger-title { color: var(--danger) !important; }

.cfo-acct-group {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 var(--space-2) var(--space-1);
    font-size: 11px;
    line-height: 16px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--text-secondary);
}
.cfo-acct-group i, .cfo-acct-group svg { color: var(--primary-ink); }
body#body .cfo-acct .cfo-acct-h3 { margin: 0; font-size: 18px; line-height: 26px; font-weight: 600; color: var(--ink); }
body#body .cfo-acct .cfo-acct-h4 { font-size: 15px; line-height: 22px; font-weight: 600; color: var(--ink); }
body#body .cfo-acct .cfo-acct-h5 { margin: 0 0 6px; font-size: 14px; line-height: 20px; font-weight: 600; color: var(--ink); }
.cfo-acct-icon { color: var(--primary-ink); }
.cfo-acct-icon-gold { color: var(--gold-ink); }
.cfo-acct-icon-dot { font-size: 10px; vertical-align: middle; }
.cfo-acct-provider-icon { width: 20px; flex-shrink: 0; text-align: center; font-size: 18px; color: var(--ink); }

/* 2FA status badges: neutral when off, sage with navy text when on (is-active, set by cfoAcctBadge). */
.cfo-acct-status.is-active { background: var(--primary); color: var(--on-primary); box-shadow: none; }

.cfo-acct-subactions { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border); }
.cfo-acct-subactions > .cfo-btn + .cfo-btn { margin-left: var(--space-2); }

/* Avatar picker */
.cfo-acct-avatar {
    position: relative;
    display: block;
    width: 80px;
    height: 80px;
    margin: 0 0 var(--space-2);
    padding: 0;
    overflow: hidden;
    border: 3px solid var(--border);
    border-radius: 50%;
    background: var(--surface-subtle);
    font: inherit;
    cursor: pointer;
    transition: border-color var(--dur-fast) var(--ease);
}
.cfo-acct-avatar:hover { border-color: var(--accent); }
.cfo-acct-avatar-initial { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; font-size: 30px; font-weight: 700; color: var(--on-primary); }
.cfo-acct-avatar-edit {
    position: absolute;
    left: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-1);
    width: 100%;
    padding: 4px 0 6px;
    background: var(--scrim);
    color: var(--on-glass);
    font-size: 11px;
    line-height: 14px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
#editProfileModal .custom-input.cfo-acct-readonly {
    background: var(--surface-hover) !important;
    color: var(--text-secondary) !important;
    cursor: not-allowed;
}
.cfo-acct-divider { border-top: 1px solid var(--border); }
.cfo-acct-overline-note { font-weight: 400; text-transform: none; letter-spacing: 0; }

/* Subscription tab chrome */
.cfo-acct-select {
    min-height: 36px;
    padding: 0 var(--space-2);
    border: 1px solid var(--border-control);
    border-radius: var(--radius-md);
    background: var(--surface-subtle);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}
.cfo-acct-loading { padding: 35px 20px; text-align: center; font-size: 13px; color: var(--text-secondary); }
.cfo-acct-loading .cfo-acct-spinner { display: block; margin: 0 auto var(--space-2); font-size: 26px; color: var(--gold-ink); }

/* Subscription view (renderManageSubView). !important beats the body.dark-mode .msub-* rules in style.css. */
#manageSubBody .msub-card {
    margin-bottom: var(--space-4);
    padding: 14px 16px;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-lg);
    background: var(--surface) !important;
    color: var(--text-primary) !important;
    text-align: left;
}
#manageSubBody .msub-card.msub-card-subtle { background: var(--surface-subtle) !important; }
#manageSubBody .msub-status { padding: 18px 20px; }
#manageSubBody .msub-status-success { border-color: var(--primary-line) !important; }
#manageSubBody .msub-status-plus { border-color: var(--gold-line) !important; }
#manageSubBody .msub-status-info { border-color: var(--info-line) !important; }
#manageSubBody .msub-status-danger { border-color: var(--danger-line) !important; }
#manageSubBody .msub-status-row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-3); }
#manageSubBody .msub-heading { color: var(--ink) !important; }
#manageSubBody .msub-subtext { color: var(--text-secondary) !important; }
#manageSubBody .msub-headline { margin-bottom: var(--space-1); font-size: 18px; line-height: 26px; font-weight: 700; }
#manageSubBody .msub-title { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; font-size: 15px; line-height: 22px; font-weight: 600; }
#manageSubBody .msub-overline { display: flex; align-items: center; gap: 6px; margin-bottom: var(--space-2); font-size: 11px; line-height: 16px; font-weight: 600; letter-spacing: 0.5px; text-transform: uppercase; color: var(--text-secondary) !important; }
#manageSubBody .msub-body { font-size: 13px; line-height: 20px; }
#manageSubBody .msub-caption { font-size: 12px; line-height: 16px; color: var(--text-secondary); }
#manageSubBody .msub-icon { width: 14px; margin-right: var(--space-1); color: var(--primary-ink); }
#manageSubBody .msub-icon-gold { color: var(--gold-ink); }
#manageSubBody .msub-danger-text { color: var(--danger) !important; }
#manageSubBody .msub-info-text { color: var(--info); }
#manageSubBody .msub-success-text { color: var(--primary-ink); font-weight: 600; }
#manageSubBody .msub-badge-danger { background: var(--danger-tint); color: var(--danger); box-shadow: none; }
#manageSubBody .msub-dates {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-md);
    background: var(--surface-subtle) !important;
    font-size: 14px;
}
#manageSubBody .msub-dates .msub-overline { display: block; margin-bottom: 2px; }
#manageSubBody .msub-meter { display: flex; justify-content: space-between; align-items: center; gap: var(--space-2); flex: 1; min-width: 130px; margin: 0; padding: 8px 12px; border-radius: var(--radius-md); font-size: 13px; }
#manageSubBody .msub-benefit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; font-size: 12px; line-height: 18px; color: var(--text-primary) !important; }
#manageSubBody .msub-divider { padding-top: var(--space-4); border-top: 1px solid var(--border) !important; }
#manageSubBody .msub-milestones { margin: 0; padding-left: 18px; }
#manageSubBody .msub-milestones li + li { margin-top: 6px; }
#manageSubBody .msub-warn-box { margin-bottom: var(--space-4); text-align: left; }
#manageSubBody .msub-warn-text { font-size: 13px; line-height: 20px; color: var(--text-primary) !important; }
#manageSubBody .msub-warn-title { color: var(--danger) !important; }

/* Term chips: selected is a 2px accent ring (is-active + aria-pressed, set by selectManageSubTerm). */
#manageSubBody .msub-terms { display: grid; grid-template-columns: repeat(auto-fit, minmax(88px, 1fr)); gap: var(--space-2); margin-bottom: 14px; padding-top: var(--space-2); }
#manageSubBody .msub-term-btn {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 76px;
    padding: 12px 4px 8px;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-lg);
    background: var(--surface) !important;
    color: var(--text-primary);
    font-family: inherit;
    text-align: center;
    cursor: pointer;
    transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
#manageSubBody .msub-term-btn:hover { border-color: var(--border-control) !important; }
#manageSubBody .msub-term-btn.is-active { border-color: var(--accent) !important; box-shadow: 0 0 0 2px var(--accent); }
#manageSubBody .msub-term-name { font-size: 12px; line-height: 16px; font-weight: 600; }
#manageSubBody .msub-term-plus { margin-bottom: 2px; }
#manageSubBody .msub-term-price { font-size: 15px; line-height: 22px; font-weight: 700; }
#manageSubBody .msub-term-per { font-size: 11px; line-height: 14px; }
#manageSubBody .msub-term-tag { position: absolute; top: -10px; right: 4px; }
#manageSubSubtitle .msub-heading { color: var(--ink); }

/* ---------- Theme info ---------- */
.cfo-acct-info-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    margin: 0 auto 10px;
    overflow: hidden;
    border-radius: 50%;
    font-size: 24px;
    font-weight: 700;
}
.cfo-acct-info-initial { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; background: var(--accent); color: var(--on-primary); font-size: 22px; font-weight: 700; }
.cfo-acct-info-title { display: flex; align-items: center; justify-content: center; gap: var(--space-1); margin-bottom: 2px; }
body#body .cfo-acct .cfo-acct-info-title .cfo-acct-title { margin: 0; }
#infoModalRenameToggleBtn { align-items: center; justify-content: center; }
#infoModalRenameBox .cfo-input { height: 44px; font-size: 14px; }
.cfo-acct-info-date { margin: 0 0 var(--space-5); font-size: 12px; line-height: 16px; font-weight: 500; color: var(--text-tertiary); }
#infoModalActions .apply-comm-btn.cfo-btn {
    padding: 0 var(--space-4) !important;
    font-size: 14px !important;
    font-weight: 600;
    border-radius: var(--radius-pill);
}
#infoModalActions .apply-comm-btn.cfo-btn i,
#infoModalActions .apply-comm-btn.cfo-btn svg { font-size: 14px; }
body#body #infoModalActions .cfo-btn.cfo-acct-locked { color: var(--text-secondary); }
#infoModalPrefsList { font-size: 13px; }
.cfo-acct-pref-row { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); padding: var(--space-2) 0; border-bottom: 1px solid var(--border); }
.cfo-acct-pref-row:last-child { border-bottom: 0; }

/* Like contract (shared with the library cards, P2): .is-liked on every .global-like-btn-<id>, heart in --danger. */
[class*="global-like-btn-"].is-liked i,
[class*="global-like-btn-"].is-liked svg { color: var(--danger); }
body#body #infoModalActions [class*="global-like-btn-"].cfo-btn.is-liked { background: var(--danger-tint); color: var(--text-primary); }
/* copyThemeLink: brief confirmation, beats the buttons' own inline backgrounds. */
.is-copied { background: var(--primary) !important; color: var(--on-primary) !important; }

/* ---------- Notifications ---------- */
body#body .cfo-acct .notif-modal-header .cfo-acct-title { display: flex; align-items: center; gap: var(--space-2); min-width: 0; margin: 0; font-size: 18px; line-height: 26px; white-space: nowrap; word-break: normal; }
.notif-icon { flex-shrink: 0; width: 20px; margin-top: 2px; text-align: center; font-size: 16px; }
.notif-icon-like { color: var(--danger); }
.notif-icon-friend { color: var(--primary-ink); }
.notif-icon-announce { color: var(--gold-ink); }
.notif-item .notif-rich { color: var(--text-primary); overflow-wrap: anywhere; }
.notif-item .notif-rich a { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 2px; }
body#body .cfo-acct .notif-cta { margin-top: var(--space-2); }
body#body .cfo-acct .notif-cta i, body#body .cfo-acct .notif-cta svg { font-size: 12px; }
.notif-empty { padding: 40px 20px; text-align: center; font-size: 14px; line-height: 20px; color: var(--text-secondary); }
.notif-empty i, .notif-empty svg { margin-bottom: 10px; font-size: 30px; color: var(--text-tertiary); }
.notif-empty.notif-error, .notif-empty.notif-error i, .notif-empty.notif-error svg { color: var(--danger); }
@media (prefers-reduced-motion: reduce) {
    .notif-skeleton-icon, .notif-skeleton-line { animation: none !important; opacity: 0.7; }
}

/* ---------- Toasts (design-system Toast: inverse pill, bottom right, above the dock) ----------
   z-index stays 999999 (above every modal). The region clears the bottom dock (about 86px tall). */
body#body #clockToastContainer.clock-toast-container {
    top: auto;
    left: auto;
    right: var(--space-6);
    bottom: calc(96px + env(safe-area-inset-bottom, 0px));
    transform: none;
    z-index: 999999;
    align-items: flex-end;
    gap: var(--space-2);
    max-width: calc(100vw - 2 * var(--space-4));
    transition: bottom var(--dur-base) var(--ease);
}
/* When the theme-applied toast is up, plain toasts stack above it. */
body#body #themeAppliedToast.show ~ #clockToastContainer.clock-toast-container { bottom: calc(160px + env(safe-area-inset-bottom, 0px)); }
body#body #clockToastContainer .clock-toast.cfo-toast {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    max-width: 420px;
    min-height: 48px;
    padding: var(--space-1) var(--space-5) var(--space-1) var(--space-3);
    border: 0;
    border-radius: var(--radius-pill);
    background: var(--ink);
    color: var(--surface);
    box-shadow: var(--shadow-float);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 20px;
    font-weight: 500;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity var(--dur-base) var(--ease), transform var(--dur-base) var(--ease);
}
body#body #clockToastContainer .clock-toast.cfo-toast.show { opacity: 1; transform: translateY(0); }
/* Icons take the toast's text colour; success sits in a sage disc with a navy tick (design-system Toast). */
body#body #clockToastContainer .clock-toast.cfo-toast i,
body#body #clockToastContainer .clock-toast.cfo-toast svg { color: inherit; font-size: 16px; }
body#body #clockToastContainer .clock-toast.cfo-toast .cfo-toast-icon-success { background: var(--primary); color: var(--on-primary); }
body#body #clockToastContainer .clock-toast.cfo-toast .cfo-toast-icon-success i,
body#body #clockToastContainer .clock-toast.cfo-toast .cfo-toast-icon-success svg { font-size: 12px; }
body#body #clockToastContainer .clock-toast.cfo-toast .cfo-toast-text { flex: 1; min-width: 0; }

/* Theme applied: the same pill, with Undo and Dismiss, and the countdown as a hairline along the bottom. */
body#body #themeAppliedToast.theme-applied-toast {
    top: auto;
    left: auto;
    right: var(--space-6);
    bottom: calc(96px + env(safe-area-inset-bottom, 0px));
    min-width: 0;
    max-width: min(420px, calc(100vw - 2 * var(--space-4)));
    padding: 0;
    border: 0;
    border-radius: var(--radius-pill);
    background: var(--ink);
    color: var(--surface);
    box-shadow: var(--shadow-float);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 20px;
    font-weight: 500;
    z-index: 999999;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity var(--dur-base) var(--ease), transform var(--dur-base) var(--ease);
}
body#body #themeAppliedToast.theme-applied-toast.show { opacity: 1; transform: translateY(0); }
#themeAppliedToast .toast-content { display: flex; align-items: center; gap: var(--space-3); min-height: 48px; padding: var(--space-1) var(--space-1) var(--space-1) var(--space-3); }
body#body #themeAppliedToast .toast-icon { width: 24px; height: 24px; border-radius: var(--radius-pill); background: var(--primary); color: var(--on-primary); font-size: 12px; }
body#body #themeAppliedToast .toast-title { color: var(--surface); font-family: inherit; font-size: 14px; line-height: 20px; font-weight: 500; }
body#body #themeAppliedToast .toast-undo-btn {
    gap: 6px;
    height: 40px;
    padding: 0 var(--space-4);
    border: 0;
    border-radius: var(--radius-pill);
    background: var(--surface-14);
    color: var(--surface);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    transition: background-color var(--dur-fast) var(--ease);
}
body#body #themeAppliedToast .toast-undo-btn:hover { background: var(--surface-24); transform: none; }
body#body #themeAppliedToast .toast-undo-btn:active { transform: none; }
body#body #themeAppliedToast .toast-close {
    position: relative;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: var(--radius-pill);
    background: transparent;
    color: var(--surface);
    font: inherit;
    font-size: 15px;
    cursor: pointer;
    transition: background-color var(--dur-fast) var(--ease);
}
body#body #themeAppliedToast .toast-close::after { content: ""; position: absolute; inset: -2px; }
body#body #themeAppliedToast .toast-close:hover { background: var(--surface-14); color: var(--surface); }
body#body #themeAppliedToast .toast-progress-bar {
    position: absolute;
    left: var(--space-5);
    right: var(--space-5);
    bottom: 0;
    width: auto;
    height: 3px;
    overflow: hidden;
    border-radius: var(--radius-pill);
    background: var(--surface-14);
}
body#body #themeAppliedToast .toast-progress-fill { background: var(--primary); }

/* Phones: full-width toasts with 16px gutters, still above the dock. */
@media (max-width: 600px) {
    body#body #clockToastContainer.clock-toast-container { left: var(--space-4); right: var(--space-4); max-width: none; align-items: stretch; }
    body#body #clockToastContainer .clock-toast.cfo-toast { max-width: none; }
    body#body #themeAppliedToast.theme-applied-toast { left: var(--space-4); right: var(--space-4); max-width: none; }
    body#body #themeAppliedToast.show ~ #clockToastContainer.clock-toast-container { bottom: calc(156px + env(safe-area-inset-bottom, 0px)); }
}

/* Reduced motion: toasts fade without moving; the countdown bar is hidden (the timer still runs). */
@media (prefers-reduced-motion: reduce) {
    body#body #clockToastContainer .clock-toast.cfo-toast,
    body#body #themeAppliedToast.theme-applied-toast {
        transform: none !important;
        transition: opacity var(--dur-fast) linear !important;
    }
    body#body #clockToastContainer.clock-toast-container { transition: none !important; }
    body#body #themeAppliedToast .toast-progress-bar { display: none; }
}
