/* Dialogs, sheets and the account menu built by auth.ts, on the workspace
   pages and on the site. Every colour comes from the active theme, so Paper
   gets a light dialog with light fields and the dark palettes get dark ones.
   On the workspace pages the older styles sit in a lower cascade layer; on
   the site they are plain stylesheets, so the few rules they mark !important
   are answered here with a more specific !important. */
.redaxa-landing {
  --card: var(--theme-surface);
  --field: var(--theme-inset);
  --field-border: color-mix(in srgb, var(--theme-strong) 62%, var(--theme-text));
  --sev-critical: #b4233a;
  --font-display: "Bahnschrift", "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
  --font-text: "Redaxa Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, sans-serif;
}
html[data-theme]:not([data-theme="paper"]) .redaxa-landing { --sev-critical: #ff7a8a; }
:is(.rx-shell, .redaxa-landing) .ps-auth-backdrop { background: color-mix(in srgb, #1b1724 34%, transparent); backdrop-filter: blur(3px); }
html[data-theme]:not([data-theme="paper"]) :is(.rx-shell, .redaxa-landing) .ps-auth-backdrop { background: color-mix(in srgb, #0b0910 55%, transparent); }
:is(.rx-shell, .redaxa-landing) .ps-auth-dialog { padding: 26px; border: 1px solid var(--theme-line); border-radius: 16px; background: var(--card); color: var(--theme-text); box-shadow: 0 24px 70px color-mix(in srgb, #000 28%, transparent); }
:is(.rx-shell, .redaxa-landing) .ps-auth-dialog h2 { margin: 0 0 8px; color: var(--theme-text); font: 600 24px/1.2 var(--font-display); letter-spacing: -.01em; }
:is(.rx-shell, .redaxa-landing) .ps-auth-dialog p { color: var(--theme-muted); font-size: 13.5px; line-height: 1.55; }
:is(.rx-shell, .redaxa-landing) .ps-auth-field { display: grid; gap: 7px; margin: 14px 0; color: var(--theme-text); font-size: 13px; font-weight: 600; }
:is(.rx-shell, .redaxa-landing) .ps-auth-field input, .rx-shell .ps-auth-pw-wrap input {
  width: 100%; min-height: 44px; padding: 10px 12px;
  border: 1px solid var(--field-border); border-radius: 8px;
  background: var(--field); color: var(--theme-text); font: 500 14px/1.3 var(--font-text);
}
:is(.rx-shell, .redaxa-landing) .ps-auth-field input::placeholder { color: var(--theme-muted); opacity: 1; }
:is(.rx-shell, .redaxa-landing) .ps-auth-field input:focus { border-color: var(--theme-accent); outline: 0; box-shadow: 0 0 0 1px var(--theme-accent); }
:is(.rx-shell, .redaxa-landing) .ps-auth-field input[aria-invalid="true"] { border-color: var(--sev-critical); }
:is(.rx-shell, .redaxa-landing) .ps-auth-field input:disabled { opacity: .6; cursor: not-allowed; }
:is(.rx-shell, .redaxa-landing) .ps-auth-submit { min-height: 44px; border: 0; border-radius: 8px; background: var(--theme-accent); color: var(--theme-ink); font: 650 14px/1 var(--font-text); }
:is(.rx-shell, .redaxa-landing) .ps-auth-submit:hover:not(:disabled) { filter: brightness(1.08); }
:is(.rx-shell, .redaxa-landing) .ps-auth-submit:disabled { opacity: .6; }
:is(.rx-shell, .redaxa-landing) :is(.ps-auth-close, .ps-auth-toggle-pw, [data-sheet-close], [data-invite-cancel][aria-label]) { color: var(--theme-muted); background: transparent; }
:is(.rx-shell, .redaxa-landing) :is(.ps-auth-close, .ps-auth-toggle-pw, [data-sheet-close]):hover { color: var(--theme-text); }
:is(.rx-shell, .redaxa-landing) .ps-auth-toggle-pw { border-radius: 6px; }
:is(.rx-shell, .redaxa-landing) .ps-auth-toggle-pw:focus-visible { outline: 2px solid var(--theme-accent); }
:is(.rx-shell, .redaxa-landing) :is(.ps-auth-link, .ps-auth-forgot, .ps-auth-legal a) { color: var(--theme-accent); text-decoration: underline; text-underline-offset: 3px; }
:is(.rx-shell, .redaxa-landing) .ps-auth-remember { color: var(--theme-text); }
:is(.rx-shell, .redaxa-landing) .ps-auth-remember input { accent-color: var(--theme-accent); }
:is(.rx-shell, .redaxa-landing) .ps-account-sheet { border: 1px solid var(--theme-line); background: var(--card); color: var(--theme-text); box-shadow: 0 24px 70px color-mix(in srgb, #000 28%, transparent); }
:is(.rx-shell, .redaxa-landing) .ps-account-sheet::backdrop { background: color-mix(in srgb, #1b1724 34%, transparent); }
html[data-theme]:not([data-theme="paper"]) :is(.rx-shell, .redaxa-landing) .ps-account-sheet::backdrop { background: color-mix(in srgb, #0b0910 55%, transparent); }
:is(.rx-shell, .redaxa-landing) .ps-account-sheet :is(h2, dd) { color: var(--theme-text); }
:is(.rx-shell, .redaxa-landing) .ps-account-sheet :is(header p, dt, .ps-account-message) { color: var(--theme-muted); }
:is(.rx-shell, .redaxa-landing) .ps-account-actions button { min-height: 38px; padding: 0 14px; border: 1px solid var(--theme-strong); border-radius: 8px; background: transparent; color: var(--theme-text); font: 600 13px/1 var(--font-text); cursor: pointer; }
:is(.rx-shell, .redaxa-landing) .ps-account-actions button:first-child { border-color: var(--theme-accent); background: var(--theme-accent); color: var(--theme-ink); }
:is(.rx-shell, .redaxa-landing) .ps-account-actions button:hover:not(:disabled) { filter: brightness(1.06); }
:is(.rx-shell, .redaxa-landing) .ps-account-menu { border: 1px solid var(--theme-line); background: var(--card); color: var(--theme-text); box-shadow: 0 18px 44px color-mix(in srgb, #000 22%, transparent); }
:is(.rx-shell, .redaxa-landing) .ps-account-menu-head { border-bottom-color: var(--theme-line); }
:is(.rx-shell, .redaxa-landing) :is(.ps-account-email, .ps-menu-link) { color: var(--theme-text); }
:is(.rx-shell, .redaxa-landing) .ps-signout { border: 0; background: transparent; color: var(--sev-critical); }
:is(.rx-shell, .redaxa-landing) .ps-signout:hover { background: color-mix(in srgb, var(--sev-critical) 12%, transparent); color: var(--sev-critical); }
:is(.rx-shell, .redaxa-landing) .ps-avatar-btn { border-color: var(--theme-strong); background: var(--card); }
:is(.rx-shell, .redaxa-landing) .ps-avatar { background: var(--theme-accent); color: var(--theme-ink); }

:is(.rx-shell, .redaxa-landing) .ps-auth-legal { color: var(--theme-muted) !important; }
:is(.rx-shell, .redaxa-landing) .ps-auth-message { color: var(--theme-muted) !important; }
:is(.rx-shell, .redaxa-landing) .ps-auth-message.error { color: var(--sev-critical) !important; }

/* Delete account: the workspace's one destructive action, in the critical colour. */
.rx-shell .delete-account #delete-account-open { color: var(--sev-critical); border-color: color-mix(in srgb, var(--sev-critical) 50%, var(--theme-strong)); }
.rx-shell .delete-account-dialog > p { color: var(--theme-muted); font-size: 13.5px; line-height: 1.55; margin: 10px 0 4px; }
.rx-shell .delete-account-dialog > p#delete-account-done { color: var(--theme-text); font-size: 14.5px; }
.rx-shell .delete-account-dialog .ps-account-message.error { color: var(--sev-critical); }
.rx-shell .delete-account-dialog .ps-account-actions .delete-account-confirm { border-color: var(--sev-critical); background: var(--sev-critical); color: var(--theme-bg); }
.rx-shell .delete-account-dialog .ps-account-actions .delete-account-confirm:disabled { opacity: .6; cursor: progress; }

/* Manage subscription (auth.ts): the plan in one card, its dates as facts,
   cancel quieter than resume, card and invoices as a plain link. */
:is(.rx-shell, .redaxa-landing) .ps-menu-link b { font-weight: inherit; }
:is(.rx-shell, .redaxa-landing) .ps-sub-sheet { --sub-alert: var(--rx-alert, #b4232f); --sub-ok: var(--ok, #146c45); }
html[data-theme]:not([data-theme="paper"]) :is(.rx-shell, .redaxa-landing) .ps-sub-sheet { --sub-alert: #ff9ca7; --sub-ok: #6fdcae; }
:is(.rx-shell, .redaxa-landing) .ps-sub-card { padding: 16px 16px 4px; border: 1px solid var(--theme-line); border-radius: 12px; background: var(--theme-inset); }
:is(.rx-shell, .redaxa-landing) .ps-sub-empty { padding-bottom: 16px; }
:is(.rx-shell, .redaxa-landing) .ps-sub-card h3 { margin: 0; color: var(--theme-text); font: 650 17px/1.3 var(--font-display, inherit); }
:is(.rx-shell, .redaxa-landing) .ps-sub-card p { margin: 6px 0 0; color: var(--theme-muted); font-size: 13.5px; line-height: 1.55; }
:is(.rx-shell, .redaxa-landing) .ps-sub-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
:is(.rx-shell, .redaxa-landing) .ps-sub-card .ps-sub-price { margin-top: 4px; color: var(--theme-text); font: 700 20px/1.2 var(--font-display, inherit); font-variant-numeric: tabular-nums; }
:is(.rx-shell, .redaxa-landing) .ps-sub-price small { color: var(--theme-muted); font: 500 12px/1.2 var(--font-text, inherit); }
:is(.rx-shell, .redaxa-landing) .ps-sub-pill { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 24px; padding: 0 10px; border: 1px solid var(--theme-line); border-radius: 999px; background: var(--theme-surface, var(--card)); color: var(--theme-text); font-size: 12px; font-weight: 650; white-space: nowrap; }
:is(.rx-shell, .redaxa-landing) .ps-sub-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--sub-ok); }
:is(.rx-shell, .redaxa-landing) .ps-sub-pill.is-ending::before { background: var(--theme-accent); }
:is(.rx-shell, .redaxa-landing) .ps-sub-pill.is-alert { border-color: color-mix(in srgb, var(--sub-alert) 50%, var(--theme-line)); }
:is(.rx-shell, .redaxa-landing) .ps-sub-pill.is-alert::before { background: var(--sub-alert); }
:is(.rx-shell, .redaxa-landing) .ps-sub-card .ps-sub-warn { margin: 0 0 10px; color: var(--sub-alert); font-weight: 600; }
:is(.rx-shell, .redaxa-landing) .ps-sub-card .ps-account-facts > div { grid-template-columns: 130px minmax(0, 1fr); }
:is(.rx-shell, .redaxa-landing) .ps-sub-actions { align-items: center; }
:is(.rx-shell, .redaxa-landing) .ps-sub-actions .ps-sub-cancel, :is(.rx-shell, .redaxa-landing) .ps-sub-actions .ps-sub-cancel:first-child { border-color: color-mix(in srgb, var(--sub-alert) 55%, var(--theme-line)); background: transparent; color: var(--sub-alert); }
:is(.rx-shell, .redaxa-landing) .ps-sub-actions .ps-sub-cancel:hover { background: color-mix(in srgb, var(--sub-alert) 8%, transparent); filter: none; }
/* Step 2 of cancelling: Back on the left, then "Keep" as a plain choice (not the highlighted one) and the confirmation tinted like the other apps' danger button. */
:is(.rx-shell, .redaxa-landing) .ps-sub-actions .ps-sub-back:first-child { margin-right: auto; border-color: var(--theme-strong); background: transparent; color: var(--theme-text); }
:is(.rx-shell, .redaxa-landing) .ps-sub-actions .ps-sub-confirm { background: color-mix(in srgb, var(--sub-alert) 10%, transparent); }
:is(.rx-shell, .redaxa-landing) .ps-sub-actions .ps-sub-link, :is(.rx-shell, .redaxa-landing) .ps-sub-actions .ps-sub-link:first-child { margin-left: auto; padding: 0 4px; border-color: transparent; background: transparent; color: var(--theme-text); text-decoration: underline; text-underline-offset: 3px; }
:is(.rx-shell, .redaxa-landing) .ps-sub-actions button:disabled { opacity: .55; cursor: progress; }
:is(.rx-shell, .redaxa-landing) .ps-sub-loading { margin: 0; padding: 22px 0; color: var(--theme-muted); font-size: 13.5px; }
:is(.rx-shell, .redaxa-landing) .ps-sub-message:empty { display: none; }
:is(.rx-shell, .redaxa-landing) .ps-sub-message { margin: 12px 0 0; color: var(--theme-text); font-size: 13px; line-height: 1.5; }
@media (max-width: 420px) { :is(.rx-shell, .redaxa-landing) .ps-sub-actions .ps-sub-link { margin-left: 0; } }
/* Phones: step 2 reads Back | Keep, then the cancellation across the full width. */
@media (max-width: 480px) { :is(.rx-shell, .redaxa-landing) .ps-sub-actions:has(.ps-sub-back) { display: grid; grid-template-columns: 1fr 1fr; } :is(.rx-shell, .redaxa-landing) .ps-sub-actions .ps-sub-back:first-child { margin-right: 0; } :is(.rx-shell, .redaxa-landing) .ps-sub-actions .ps-sub-confirm { grid-column: 1 / -1; } }
/* Cancel, step 1: the optional reason, as one-tap tiles in two columns, and the comment it opens. */
:is(.rx-shell, .redaxa-landing) .ps-sub-card .ps-sub-step { margin: 0 0 4px; color: var(--theme-muted); font: 650 11px/1.3 var(--font-text, inherit); letter-spacing: .06em; text-transform: uppercase; }
:is(.rx-shell, .redaxa-landing) .ps-sub-reasons { padding-bottom: 14px; }
/* A little wider than the other account sheets, so each reason fits on one line in two columns. */
:is(.rx-shell, .redaxa-landing) .ps-account-sheet.ps-sub-sheet { width: min(540px, calc(100vw - 32px)); }
:is(.rx-shell, .redaxa-landing) .ps-sub-reasons fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
:is(.rx-shell, .redaxa-landing) .ps-sub-reasons legend { padding: 0; }
:is(.rx-shell, .redaxa-landing) .ps-sub-reason-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin-top: 10px; }
:is(.rx-shell, .redaxa-landing) .ps-sub-reason { position: relative; display: flex; align-items: center; gap: 9px; min-height: 36px; padding: 6px 10px; border: 1px solid var(--theme-line); border-radius: 8px; background: var(--theme-surface, var(--card)); color: var(--theme-text); font-size: 13px; line-height: 1.3; cursor: pointer; }
:is(.rx-shell, .redaxa-landing) .ps-sub-reason:hover { border-color: var(--theme-strong); }
:is(.rx-shell, .redaxa-landing) .ps-sub-reason input { flex: none; width: 15px; height: 15px; margin: 0; accent-color: var(--theme-accent); }
:is(.rx-shell, .redaxa-landing) .ps-sub-reason:has(input:checked) { border-color: var(--theme-accent); box-shadow: 0 0 0 1px var(--theme-accent); }
:is(.rx-shell, .redaxa-landing) .ps-sub-reason:has(input:focus-visible) { outline: 2px solid var(--theme-accent); outline-offset: 2px; }
:is(.rx-shell, .redaxa-landing) .ps-sub-comment { position: relative; margin-top: 10px; }
:is(.rx-shell, .redaxa-landing) .ps-sub-comment[hidden] { display: none; }
:is(.rx-shell, .redaxa-landing) .ps-sub-comment label { display: block; margin-bottom: 6px; color: var(--theme-text); font-size: 13px; font-weight: 600; }
:is(.rx-shell, .redaxa-landing) .ps-sub-comment textarea { display: block; box-sizing: border-box; width: 100%; min-height: 52px; padding: 8px 10px 18px; border: 1px solid var(--theme-line); border-radius: 8px; background: var(--theme-surface, var(--card)); color: var(--theme-text); font: 13px/1.45 var(--font-text, inherit); resize: vertical; }
:is(.rx-shell, .redaxa-landing) .ps-sub-comment textarea:focus { border-color: var(--theme-accent); outline: 0; box-shadow: 0 0 0 1px var(--theme-accent); }
:is(.rx-shell, .redaxa-landing) .ps-sub-count { position: absolute; right: 10px; bottom: 5px; color: var(--theme-muted); font-size: 11px; font-variant-numeric: tabular-nums; pointer-events: none; }
@media (max-width: 480px) { :is(.rx-shell, .redaxa-landing) .ps-sub-reason-grid { grid-template-columns: minmax(0, 1fr); } }
/* One type for every row of the account menu, links and buttons alike, and a
   close button large enough to hit. */
.rx-shell .ps-account-menu .ps-menu-link, .redaxa-landing .ps-account-menu .ps-menu-link { font: 450 13.5px/1.3 var(--font-text, inherit); }
:is(.rx-shell, .redaxa-landing) .ps-account-sheet [data-sheet-close] { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border-radius: 8px; font-size: 22px; line-height: 1; }
:is(.rx-shell, .redaxa-landing) .ps-account-sheet [data-sheet-close]:hover { background: var(--theme-hover); color: var(--theme-text); }
