/* PixJot pricing and member pages. Every rule is scoped under .pj-m so the site layout can include it
   safely. Colours come from the site's tokens (--bg, --surface, --accent, …, as on the coming-soon page)
   with light-mode fallbacks for a page that does not define them. */
.pj-m {
  --m-surface: var(--surface, #fff); --m-surface-2: var(--surface-2, #faf7f2); --m-surface-3: var(--surface-3, #f1ece4);
  --m-border: var(--border, #e8e1d7); --m-text: var(--text, #1f1a15); --m-muted: var(--muted, #6b6158); --m-faint: var(--faint, #9a8f84);
  --m-accent: var(--accent, #ea6a1f); --m-accent-soft: var(--accent-soft, #fdeadb); --m-on-accent: var(--on-accent, #fff);
  --m-ok: var(--ok, #1f8a4c); --m-ok-soft: var(--ok-soft, #e2f5e9); --m-grad: var(--grad, linear-gradient(135deg, #f2711c, #f9a43a));
  --m-shadow: var(--shadow, 0 1px 2px rgb(41 30 20 / .06), 0 12px 32px -12px rgb(41 30 20 / .18));
  color: var(--m-text); display: block; padding: 8px 0 56px;
}
.pj-m *, .pj-m *::before, .pj-m *::after { box-sizing: border-box; }
.pj-m h1 { font-size: clamp(32px, 4.4vw, 48px); line-height: 1.05; letter-spacing: -.03em; font-weight: 800; margin: 0 0 12px; }
.pj-m h2 { font-size: 21px; letter-spacing: -.015em; margin: 40px 0 14px; }
.pj-m h3 { font-size: 19px; margin: 0; letter-spacing: -.01em; }
.pj-m p { margin: 0 0 12px; }
.pj-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.pj-m .pj-head { text-align: center; max-width: 720px; margin: 0 auto 24px; }
.pj-m .pj-head-left { text-align: left; max-width: none; margin: 0 0 18px; }
.pj-m .pj-lede { color: var(--m-muted); font-size: 17px; margin-bottom: 22px; }
.pj-m .pj-fine { color: var(--m-muted); font-size: 13.5px; }
.pj-m .pj-ph { background: repeating-linear-gradient(-45deg, var(--m-accent-soft) 0 6px, transparent 6px 12px); border: 1px dashed var(--m-accent); border-radius: 6px; padding: 1px 6px; color: var(--m-text); font-size: .92em; }

/* Billing toggle: radios, so it works without JavaScript. */
.pj-toggle { display: inline-flex; gap: 4px; padding: 4px; margin: 0; border: 1px solid var(--m-border); border-radius: 99px; background: var(--m-surface); }
.pj-seg { position: relative; cursor: pointer; }
.pj-seg input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.pj-seg span { display: inline-flex; align-items: center; gap: 8px; padding: 8px 18px; border-radius: 99px; font-weight: 650; font-size: 14.5px; color: var(--m-muted); }
.pj-seg input:checked + span { background: var(--m-text); color: var(--m-surface); }
.pj-seg input:focus-visible + span { outline: 2px solid var(--m-accent); outline-offset: 2px; }
.pj-save { font-size: 11.5px; font-weight: 750; padding: 2px 7px; border-radius: 99px; background: var(--m-ok-soft); color: var(--m-ok); }
[data-pj-billing-root]:has(input[value="yearly"]:checked) [data-when="monthly"],
[data-pj-billing-root]:has(input[value="monthly"]:checked) [data-when="yearly"] { display: none; }

/* Notes and banners */
.pj-note { border: 1px dashed var(--m-accent); background: var(--m-accent-soft); border-radius: 12px; padding: 10px 14px; font-size: 14px; margin: 0 0 22px; }
.pj-preview { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; font-size: 13.5px; padding: 8px 12px; border-radius: 10px; background: var(--m-surface-3); margin: 0 0 18px; }
.pj-preview a { color: var(--m-text); padding: 3px 10px; border-radius: 99px; text-decoration: none; border: 1px solid var(--m-border); background: var(--m-surface); }
.pj-preview a[aria-current] { background: var(--m-text); color: var(--m-surface); border-color: var(--m-text); }

/* Plan cards */
.pj-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; align-items: stretch; }
.pj-card { display: flex; flex-direction: column; background: var(--m-surface); border: 1px solid var(--m-border); border-radius: 18px; padding: 22px; box-shadow: var(--m-shadow); }
.pj-card.pj-featured { border: 2px solid var(--m-accent); }
.pj-card.pj-current { border-color: var(--m-ok); }
.pj-card header { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 28px; }
.pj-badge { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 99px; background: var(--m-surface-3); color: var(--m-muted); white-space: nowrap; }
.pj-badge-hot { background: var(--m-grad); color: #fff; }
.pj-badge-current { background: var(--m-ok-soft); color: var(--m-ok); }
.pj-tagline { color: var(--m-muted); font-size: 14.5px; min-height: 44px; margin-top: 6px; }
.pj-price { display: flex; align-items: baseline; gap: 6px; }
.pj-amount { font-size: 40px; font-weight: 800; letter-spacing: -.03em; }
.pj-unit { color: var(--m-muted); font-size: 14px; }
.pj-billed { color: var(--m-muted); font-size: 13.5px; min-height: 22px; }
.pj-billed s { color: var(--m-faint); }
.pj-credits { font-weight: 650; font-size: 14px; margin: 16px 0 8px; padding-top: 14px; border-top: 1px solid var(--m-border); }
.pj-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; font-size: 14.5px; }
.pj-list li { display: grid; grid-template-columns: 18px 1fr; gap: 9px; align-items: start; }
.pj-i { width: 18px; height: 18px; color: var(--m-ok); margin-top: 2px; }
.pj-no { color: var(--m-faint); }

/* Buttons */
.pj-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 650; font-size: 15px; padding: 11px 18px; border-radius: 12px; border: 1px solid var(--m-border); background: var(--m-surface-2); color: var(--m-text); cursor: pointer; text-decoration: none; white-space: nowrap; }
.pj-btn:hover { border-color: var(--m-accent); }
.pj-btn:focus-visible, .pj-link:focus-visible, .pj-tabs a:focus-visible { outline: 2px solid var(--m-accent); outline-offset: 2px; }
.pj-btn-primary { background: var(--m-accent); color: var(--m-on-accent); border-color: var(--m-accent); }
.pj-btn-primary:hover { filter: brightness(1.06); }
.pj-btn[disabled] { opacity: .55; cursor: default; border-color: var(--m-border); filter: none; }
.pj-btn-small { padding: 7px 13px; font-size: 14px; }
.pj-card .pj-btn { width: 100%; margin-top: 12px; }
.pj-link { font: inherit; background: none; border: 0; padding: 0; color: var(--m-accent); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* Credit pack strip */
.pj-pack { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 18px; padding: 18px 22px; border-radius: 16px; background: var(--m-surface-2); border: 1px solid var(--m-border); }
.pj-pack p { color: var(--m-muted); margin: 4px 0 0; font-size: 14.5px; }

/* Tables */
.pj-scroll { overflow-x: auto; border: 1px solid var(--m-border); border-radius: 14px; background: var(--m-surface); }
.pj-table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.pj-table th, .pj-table td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--m-border); vertical-align: top; }
.pj-table thead th { font-size: 13px; color: var(--m-muted); font-weight: 650; }
.pj-table tbody tr:last-child > * { border-bottom: 0; }
.pj-table td small { color: var(--m-muted); }
.pj-compare th[scope="row"] { font-weight: 500; }
.pj-compare td, .pj-compare thead th:not(:first-child) { text-align: center; width: 22%; }
.pj-compare .pj-i { margin: 0 auto; display: block; }
.pj-costs td:last-child, .pj-costs th:last-child, .pj-num { text-align: right; }
.pj-split { display: grid; grid-template-columns: 1fr 1fr; gap: 36px; }
.pj-split .pj-table { background: var(--m-surface); border: 1px solid var(--m-border); border-radius: 12px; border-collapse: separate; border-spacing: 0; }
.pj-faq { border-bottom: 1px solid var(--m-border); padding: 12px 0; }
.pj-faq summary { cursor: pointer; font-weight: 650; }
.pj-faq p { color: var(--m-muted); margin: 8px 0 0; }

/* Account */
.pj-who { color: var(--m-muted); }
.pj-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--m-border); margin: 0 0 20px; overflow-x: auto; }
.pj-tabs a { padding: 10px 14px; color: var(--m-muted); text-decoration: none; font-weight: 650; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.pj-tabs a[aria-current] { color: var(--m-text); border-bottom-color: var(--m-accent); }
.pj-view { display: grid; gap: 16px; }
.pj-panel { background: var(--m-surface); border: 1px solid var(--m-border); border-radius: 16px; padding: 20px 22px; }
.pj-panel.pj-flat { background: none; border: 0; padding: 0; }
.pj-panel h2 { margin: 0 0 12px; }
.pj-panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
.pj-panel-head h2 { margin: 2px 0 4px; }
.pj-panel-head p { color: var(--m-muted); margin: 0; }
.pj-kicker { font-size: 12.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--m-muted); font-weight: 700; }
.pj-meter { margin: 6px 0 14px; }
.pj-meter-top { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 6px; font-size: 14.5px; }
.pj-meter-top small { color: var(--m-muted); font-weight: 500; }
.pj-bar { height: 10px; border-radius: 99px; background: var(--m-surface-3); overflow: hidden; }
.pj-bar i { display: block; height: 100%; background: var(--m-grad); border-radius: inherit; }
.pj-dl { display: grid; gap: 0; margin: 0 0 12px; }
.pj-dl div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--m-border); font-size: 14.5px; }
.pj-dl dt { color: var(--m-muted); }
.pj-dl dd { margin: 0; font-weight: 650; text-align: right; }
.pj-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 6px 0 12px; }
.pj-danger { border-color: color-mix(in srgb, #c2410c 35%, var(--m-border)); }
.pj-signin { max-width: 520px; }
.pj-signin input { flex: 1; min-width: 200px; font: inherit; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--m-border); background: var(--m-surface-2); color: var(--m-text); }
.pj-account .pj-cards { margin-top: 4px; }

/* Placeholder dialog opened by membership.js */
.pj-dialog { border: 1px solid var(--m-border); border-radius: 18px; padding: 22px 24px; max-width: 440px; width: calc(100% - 32px); background: var(--m-surface); color: var(--m-text); box-shadow: var(--m-shadow); }
.pj-dialog::backdrop { background: rgb(20 15 10 / .45); }
.pj-dialog h2 { margin: 0 0 8px; font-size: 20px; }
.pj-dialog p { color: var(--m-muted); }
.pj-dialog .pj-row { justify-content: flex-end; margin-bottom: 0; }

@media (max-width: 900px) {
  .pj-cards { grid-template-columns: 1fr; max-width: 480px; margin: 0 auto; }
  .pj-split { grid-template-columns: 1fr; gap: 8px; }
  .pj-tagline { min-height: 0; }
}
@media (max-width: 560px) {
  .pj-pack { flex-direction: column; align-items: stretch; }
  .pj-pack .pj-btn { white-space: normal; }
  .pj-panel { padding: 16px; }
  .pj-table th, .pj-table td { padding: 9px 10px; }
  .pj-seg span { padding: 8px 14px; }
  .pj-compare { font-size: 13px; }
  .pj-compare th, .pj-compare td { padding: 8px 6px; }
  .pj-compare th[scope="row"] { padding-left: 10px; width: 34%; }
  .pj-compare td, .pj-compare thead th:not(:first-child) { width: 22%; }
}
.pj-dialog:not([open]) { display: none; }

/* Account tab: profile form, sessions, delete. */
.pj-form { display: grid; gap: 14px; max-width: 520px; }
.pj-field { display: grid; gap: 6px; font-weight: 650; font-size: 14.5px; }
.pj-field small { font-weight: 400; color: var(--m-muted); }
.pj-field input { font: inherit; font-weight: 400; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--m-border); background: var(--m-surface); color: var(--m-text); }
.pj-field input:focus { outline: 2px solid var(--m-accent); outline-offset: 1px; }
.pj-m .pj-btn-danger { color: #c2333d; border-color: currentColor; }
.pj-code { font: 13px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; padding: 2px 8px; border-radius: 6px; background: var(--m-surface-3); }
.pj-scroll { overflow-x: auto; }
