/* Plan cards for pinsay.dev/pricing and the home page's #pricing section. Loaded after landing.css; reuses its tokens and the
   .pricing-grid / .plan-* classes. Logical properties only, so dir="rtl" mirrors. */
.pricing-page .section-head h1 {
  font-size: clamp(2.25rem, 1.5rem + 3vw, 3.5rem);
  line-height: 1.06;
  letter-spacing: -0.03em;
  font-weight: 800;
}
.pricing-grid--all { max-width: 1200px; }
@media (min-width: 640px) {
  .pricing-grid--all { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
}

/* Plan cards (pricing comments #335, #339, #340): six slots per card — head, price, meta, features, comment types,
   button (pricing.js). With subgrid every card shares the grid's rows, so the slots line up across a row of cards. */
.pricing-grid--all .plan-card { gap: 16px; }
/* Typical card height, shared by the skeleton cards and the real ones so the grid never changes height when cards
   arrive: 640px = padding 24+24 (48) + 5 gaps of 16 (80) + head 28 + price 2rem*1.6 (51) + meta 2 notes 14px*1.6
   (22+22) + 6 (51) + features 8 rows 15px*1.6 (24) + 7 gaps of 8 (248) + comment types label 21 + 8 + 2 rows of
   pills 26 + 6 + 26 (87) + button 44 = 637, rounded up. Mobile stacks the cards, so 4 skeletons stack too. */
.pricing-grid--all .plan-card { min-height: 640px; }
.plan-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 28px;
}
.plan-head .plan-badge { flex: none; padding: 3px 10px; font-size: 12px; line-height: 1.4; }
.plan-meta { display: grid; gap: 6px; justify-items: start; align-content: start; }
.pricing-grid--all .plan-features { align-content: start; gap: 8px; }
.pricing-grid--all .plan-features li { display: grid; grid-template-columns: 1.4em 1fr; }
.pricing-grid--all .plan-features li::before { content: "✓"; margin: 0; color: var(--success-ink); font-weight: 700; }
.plan-types { display: grid; gap: 8px; align-content: start; width: 100%; }
.plan-types-label { color: var(--muted); font-size: 13px; font-weight: 600; }
.plan-types ul { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.plan-types li {
  padding: 2px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-full);
  color: var(--ink);
  font-size: 13px;
  line-height: 1.5;
}
.pricing-grid--all .plan-card > .btn, .pricing-grid--all .plan-soon { align-self: center; }
/* A card never grows past its column (QA-BUG-01): it may shrink, and a long button label wraps. */
.pricing-grid--all .plan-card { min-width: 0; }
.pricing-grid--all .plan-card > .btn { max-width: 100%; white-space: normal; text-align: center; line-height: 1.25; }
@supports (grid-template-rows: subgrid) {
  .pricing-grid--all > [role="listitem"] { display: grid; grid-row: span 6; grid-template-rows: subgrid; }
  .pricing-grid--all .plan-card { display: grid; grid-row: span 6; grid-template-rows: subgrid; }
  .pricing-grid--all .plan-card > .btn, .pricing-grid--all .plan-soon { justify-self: center; align-self: end; }
  /* Skeletons are empty, so they do not join the subgrid: a subgrid card ignores min-height when it sizes the
     parent rows (the loading grid was 158px tall, the real one ~640px). One plain row each keeps the 640px. */
  .pricing-grid--all > [data-plans-loading] { display: flex; grid-row: auto; grid-template-rows: none; }
  .pricing-grid--all .plan-card--skeleton { display: flex; flex: 1; grid-row: auto; grid-template-rows: none; }
}
.plan-save {
  padding: 2px 10px;
  background: var(--tint);
  border-radius: var(--radius-full);
  color: var(--success-ink);
  font-size: 13px;
  font-weight: 600;
}
.plans-error { margin-top: 16px; text-align: center; color: var(--danger-ink); font-size: 14px; }

/* Billing period switch */
.interval-switch {
  display: flex;
  width: max-content;
  max-width: 100%;
  margin: 0 auto 28px;
  padding: 4px;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-full);
}
.interval-switch { min-height: 50px; } /* 50 = padding 4+4, border 1+1, option 40: the row keeps its box while empty/pending */
.interval-switch.is-pending { visibility: hidden; }
.interval-option {
  min-height: 40px;
  padding: 0 18px;
  border: 0;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--muted);
  font: 600 15px/1 var(--font-sans);
  cursor: pointer;
}
.interval-option:hover { color: var(--ink); background: var(--hover); }
.interval-option[aria-checked="true"] { background: var(--ink); color: var(--canvas); }

/* Comparison table: scrolls sideways on small screens with the feature column pinned. */
.compare-wrap {
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--surface);
}
.compare-table { width: 100%; min-width: 640px; border-collapse: separate; border-spacing: 0; font-size: 15px; }
.compare-table th, .compare-table td {
  padding: 12px 16px;
  border-block-end: 1px solid var(--line-soft);
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.compare-table thead th {
  position: sticky;
  top: 0;
  background: var(--surface);
  font-weight: 650;
}
.compare-table th[scope="row"], .compare-table thead th:first-child {
  position: sticky;
  inset-inline-start: 0;
  z-index: 1;
  background: var(--surface);
  text-align: start;
  font-weight: 500;
  min-width: 180px;
}
.compare-table thead th:first-child { z-index: 2; color: var(--muted); }
.compare-section th {
  padding: 0;
  text-align: start;
  color: var(--brand-ink);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--surface);
}
.compare-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 20px 16px 10px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  text-align: start;
  cursor: pointer;
}
.compare-toggle:hover { background: var(--hover); }
.compare-toggle:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.compare-toggle::before {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  margin-block-start: -4px;
  /* Physical borders on purpose: the corner must stay bottom-right so the rotations below point the same way in RTL. */
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
}
.compare-toggle[aria-expanded="false"]::before { margin-block-start: 0; transform: rotate(-45deg); }
[dir="rtl"] .compare-toggle[aria-expanded="false"]::before { transform: rotate(135deg); }
.compare-table tr[hidden] { display: none; }
@media (prefers-reduced-motion: no-preference) {
  .compare-toggle::before { transition: transform var(--dur) var(--ease-out); }
}
.compare-table td.is-yes { color: var(--success-ink); font-weight: 700; }
.compare-table td.is-no { color: var(--muted); }
.compare-table td.is-custom { color: var(--muted); font-style: italic; }
.compare-table tbody:last-child tr:last-child > * { border-block-end: 0; }

.site-footer .footer-bottom a { color: inherit; }
/* Contact-sales modal styles live in landing.css (.cs-*), shared with the home page. */

/* Home page #pricing (pricing.js compact mode): the same cards with at most 5 lines and no comment types.
   500px = padding 48 + 5 gaps of 16 (80) + head 28 + price 51 + meta 3 notes (78) + 5 lines (152) + button 44 = 481, plus one wrapped line (24) =
   505, rounded up to 520; skeletons and real cards share it so the section keeps its height when the plans arrive. */
.pricing-grid--compact .plan-card { min-height: 520px; }
.pricing-more { margin-top: 20px; text-align: center; }
