/* nzura-plan-cards.css — ONE plan card, everywhere a plan is shown.
 *
 * Owner, 2026-11-24: plans on Billing, nzura.co.tz, the renewal page and
 * sign-up look like the Business app's package sheet (nzura-iap.js):
 *
 *   Name [Most popular] ................ TSh 353,000/yr
 *   one line on what the plan is for .............. 10 GB
 *   ✓ CRM                       ✓ Accounting
 *   ✓ Social Media Manager      +13 more apps
 *
 * you pick a card (accent ring + a faint tint) and ONE button below acts on
 * it. On the web "Most popular" is a green chip and "+N more apps" is a
 * brand-blue text link (owner, same day). The words come from
 * nzura-plan-cards.js (facts / enhance); a page opts in by putting `nzp-grid`
 * on the element that holds the cards. The cards keep the class names the
 * price scripts read (`.plan-card` on the marketing pages, `.plan-opt` on the
 * pickers). Without the catalogue or without JavaScript the hand-written card
 * still reads: period · apps … action, notes, "Included apps" ⌄.
 *
 * Rules of the house: flat colours (no gradients, no drop shadows), nothing
 * heavier than 600, sentence case, chevrons from a mask — never a text glyph
 * — and ONE column on a phone, so nothing wraps into a sliver.
 * Guard: apps/web/plan-cards-design.test.cjs.
 */
.nzp-grid {
  --nzp-line: var(--line, var(--panel-border, #dfe3ec));
  --nzp-text: var(--text, var(--text-primary, #0f1f3a));
  --nzp-muted: var(--muted, var(--text-muted, #6a7a8a));
  --nzp-accent: var(--accent, #195afe);
  --nzp-soft: var(--accent-lt, var(--accent-soft, #eef2ff));
  --nzp-surface: var(--white, var(--panel-bg, #fff));
  --nzp-tint: color-mix(in srgb, var(--nzp-accent) 5%, var(--nzp-surface));
  --nzp-soft-text: var(--text-secondary, #475569);
  --nzp-quiet: var(--surface-2, rgba(148, 163, 184, .14));
  /* Owner, 2026-11-24 (web): brand-blue links, green "Most popular". */
  --nzp-brand: #195afe;
  --nzp-green: #047857;
  --nzp-green-soft: rgba(16, 185, 129, .12);
  --nzp-chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9.5l6 6 6-6'/%3E%3C/svg%3E");
  gap: .6rem;
  align-items: start;
}

/* ── Columns ──────────────────────────────────────────────────────────── */
.plan-cat-group.nzp-grid.active { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 1020px; gap: .7rem; }
.plan-cat-group.nzp-grid[data-cols].active { grid-template-columns: repeat(4, minmax(0, 1fr)); max-width: 1180px; }
@media (max-width: 1100px) {
  .plan-cat-group.nzp-grid[data-cols].active { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .plan-cat-group.nzp-grid.active,
  .plan-cat-group.nzp-grid[data-cols].active { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* A phone gets a list: one plan per row, read top to bottom. */
@media (max-width: 640px) {
  .nzp-grid,
  .plan-cat-group.nzp-grid.active,
  .plan-cat-group.nzp-grid[data-cols].active { grid-template-columns: minmax(0, 1fr) !important; max-width: 100%; gap: .5rem; }
  /* Specialty cards carry a chip on their top edge; it needs the room. */
  .plan-cat-group.nzp-grid[data-cols].active { gap: .8rem; }
}

/* Sign-up, checkout and billing: as many columns as fit, never under 230px. */
.plan-select-grid.nzp-grid,
.plan-select-grid-2.nzp-grid,
.plan-options.nzp-grid,
.upgrade-options.nzp-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); margin: 0 0 .9rem;
}
.auth-layout.plans-step .plan-select-grid.nzp-grid,
.auth-layout.plans-step .plan-select-grid-2.nzp-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 860px) {
  .auth-layout.plans-step .plan-select-grid.nzp-grid,
  .auth-layout.plans-step .plan-select-grid-2.nzp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* The line above a second group of cards ("Specialty plans"). */
.plan-group-label { margin: .2rem 0 .45rem; font-size: .72rem; font-weight: 600; color: var(--muted, var(--text-muted, #6a7a8a)); }

/* The Companies / Specialty switch stays on one row; it scrolls, it never wraps. */
.plan-cat-switch { flex-wrap: nowrap; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.plan-cat-switch::-webkit-scrollbar { display: none; }
.plan-cat-switch .plan-cat-btn { flex: 0 0 auto; white-space: nowrap; }

/* ── The card ─────────────────────────────────────────────────────────── */
.nzp-grid .plan-card,
.nzp-grid .plan-opt {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: .22rem .6rem;
  min-width: 0;
  margin: 0;
  padding: .6rem .7rem;
  border: 1px solid var(--nzp-line);
  border-radius: 12px;
  background: var(--nzp-surface);
  box-shadow: none;
  transform: none;
  text-align: left;
  overflow: visible;
  transition: border-color .15s, background-color .15s;
}
.nzp-grid .plan-opt,
.nzp-pick .nzp-grid .plan-card { cursor: pointer; }
.nzp-grid .plan-card:hover,
.nzp-grid .plan-opt:hover { border-color: var(--nzp-accent); box-shadow: none; transform: none; }
.nzp-grid .plan-card:focus-visible,
.nzp-grid .plan-opt:focus-visible { outline: 2px solid var(--nzp-accent); outline-offset: 1px; }
/* Featured (no script) / picked / chosen: the app's ring — accent border, a
   1px inset line, a faint accent tint. Inset, so the card does not move. */
.nzp-grid .plan-card.featured,
.nzp-grid .plan-card.featured:hover,
.nzp-grid .plan-opt.featured { border-color: var(--nzp-accent); box-shadow: inset 0 0 0 1px var(--nzp-accent); transform: none; }
.nzp-grid .plan-opt.selected,
.nzp-grid .plan-card.is-picked,
.nzp-grid .plan-card.is-picked:hover,
.nzp-grid .plan-card.trial-selected-plan,
.nzp-grid .plan-card.trial-selected-plan:hover {
  border-color: var(--nzp-accent);
  background: var(--nzp-tint);
  box-shadow: inset 0 0 0 1px var(--nzp-accent);
}
/* With a picker on the page, only the picked card carries the ring. */
.nzp-pick .nzp-grid .plan-card.featured:not(.is-picked) { border-color: var(--nzp-line); box-shadow: none; background: var(--nzp-surface); }
.nzp-pick .nzp-grid .plan-card.featured:not(.is-picked):hover { border-color: var(--nzp-accent); }
.nzp-grid .plan-opt.is-current { cursor: default; }

/* ── Row 1: name [chip] … price ───────────────────────────────────────── */
.nzp-grid .plan-name,
.nzp-grid .plan-opt-name {
  grid-column: 1; min-width: 0; margin: 0;
  font-size: .86rem; font-weight: 600; line-height: 1.25; letter-spacing: 0; text-transform: none;
  color: var(--nzp-text); overflow-wrap: break-word; word-break: normal;
}
.nzp-grid .plan-price,
.nzp-grid .plan-opt-price {
  grid-column: 2; justify-self: end; margin: 0; padding: 0;
  display: block; width: auto; border: 0; border-radius: 0; background: none; box-shadow: none;
  font-size: .86rem; font-weight: 600; line-height: 1.25; text-align: right; white-space: nowrap;
  color: var(--nzp-text);
}
.nzp-grid .plan-price span { color: inherit; }
.nzp-grid .plan-price sub,
.nzp-grid .plan-opt-price small {
  font-size: .68rem; font-weight: 400; color: var(--nzp-muted); vertical-align: baseline; bottom: 0; white-space: nowrap;
}
.nzp-grid .plan-price sub { margin-right: .15rem; }
.nzp-grid .plan-opt-price small { margin-left: .1rem; }
/* The pickers keep name and price in one head row. */
.nzp-grid .plan-opt-head {
  grid-column: 1 / -1; display: flex; flex-direction: row; flex-wrap: wrap;
  align-items: baseline; justify-content: space-between; gap: .1rem .6rem; min-width: 0;
}
/* A long name keeps its words whole; the price drops under it, still on the right. */
.nzp-grid .plan-opt-head .plan-opt-name { flex: 0 1 auto; }
.nzp-grid .plan-opt-head .plan-opt-price { flex: 0 0 auto; margin-left: auto; }

/* "Most popular" beside the name: green on the web (owner, 2026-11-24).
   "Current" is a fact, not a recommendation: a quiet grey chip. */
.nzp-grid [data-nzp-chip]::after {
  content: attr(data-chip-en);
  display: inline-block; margin-left: .35rem; padding: .05rem .42rem; border-radius: 999px;
  font-size: .62rem; font-weight: 500; line-height: 1.5; letter-spacing: 0; text-transform: none; vertical-align: 1px; white-space: nowrap;
  background: var(--nzp-green-soft); color: var(--nzp-green);
}
html.lang-sw .nzp-grid [data-nzp-chip]::after { content: attr(data-chip-sw); }
.nzp-grid [data-nzp-chip="current"]::after { background: var(--nzp-quiet); color: var(--nzp-muted); }

/* ── Row 2: period · apps … action (the action only without a picker) ─── */
.nzp-grid .plan-period,
.nzp-grid .plan-opt-tag,
.nzp-grid .plan-opt-sub {
  grid-column: 1 / -1; margin: 0;
  font-size: .7rem; font-weight: 400; line-height: 1.35; letter-spacing: 0; text-transform: none; text-align: left;
  color: var(--nzp-muted);
}
.nzp-grid .plan-card .plan-name { grid-row: 1; }
.nzp-grid .plan-card .plan-price { grid-row: 1; }
.nzp-grid .plan-card .plan-period { grid-column: 1; grid-row: 2; align-self: center; }
.nzp-grid .plan-cta {
  grid-column: 2; grid-row: 2; justify-self: end; align-self: center;
  display: inline-flex; align-items: center; justify-content: center;
  width: auto; min-height: 30px; margin: 0; padding: 0 .7rem;
  border-width: 1px; border-style: solid; border-radius: 8px; box-shadow: none;
  font-size: .72rem; font-weight: 600; line-height: 1; letter-spacing: 0; white-space: nowrap; text-decoration: none;
}
.nzp-grid .plan-cta:hover { box-shadow: none; transform: none; }
/* Picker on the page: the one button below the cards acts; the per-card
   links stay in the markup (that is where the button takes its link from). */
.nzp-pick .nzp-grid .plan-cta { display: none; }
.nzp-pick .nzp-grid .plan-card .plan-period { grid-column: 1 / -1; }

/* ── Quiet notes ──────────────────────────────────────────────────────── */
.nzp-grid .plan-flat-note,
.nzp-grid .plan-opt-addon {
  grid-column: 1 / -1; justify-self: start; margin: 0; padding: .1rem .45rem;
  border: 0; border-radius: 6px; background: var(--nzp-quiet);
  font-size: .66rem; font-weight: 500; line-height: 1.4; letter-spacing: 0; text-transform: none;
  color: var(--nzp-soft-text);
}
.nzp-grid .plan-opt-chips { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: .3rem; }
.nzp-grid .plan-opt-chip {
  padding: .1rem .42rem; border-radius: 6px; background: var(--nzp-quiet);
  font-size: .64rem; font-weight: 500; line-height: 1.4; color: var(--nzp-soft-text); white-space: nowrap;
}

/* ── Summary (hand-written; replaced by the purpose line once enhanced) ─ */
.nzp-grid .plan-summary,
.nzp-grid .plan-opt-summary {
  grid-column: 1 / -1; margin: 0;
  font-size: .72rem; font-weight: 400; line-height: 1.4; color: var(--nzp-muted);
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
}
@media (max-width: 640px) {
  .nzp-grid .plan-summary,
  .nzp-grid .plan-opt-summary { display: none; }
}

/* ── The app's facts: purpose … storage, ticked apps, "+N more apps" ─── */
.nzp-grid .nzp-facts { grid-column: 1 / -1; display: flex; flex-direction: column; gap: .3rem; min-width: 0; }
.nzp-grid .plan-opt > .nzp-uvp,
.nzp-grid .plan-opt > .nzp-feats,
.nzp-grid .plan-opt > .nzp-all { grid-column: 1 / -1; }
.nzp-grid .nzp-uvp {
  display: flex; align-items: baseline; justify-content: space-between; gap: .5rem;
  font-size: .73rem; line-height: 1.35; color: var(--nzp-soft-text);
}
.nzp-grid .nzp-side { flex: 0 0 auto; font-size: .66rem; color: var(--nzp-muted); white-space: nowrap; }
.nzp-grid .nzp-feats {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: .1rem .6rem;
  margin: .15rem 0 0; padding: 0; list-style: none;
  font-size: .7rem; line-height: 1.35; color: var(--nzp-soft-text);
}
.nzp-grid .nzp-feats li { position: relative; min-width: 0; padding-left: .85rem; overflow-wrap: anywhere; }
.nzp-grid .nzp-feats li::before {
  content: ""; position: absolute; left: .1rem; top: .38em; width: .42rem; height: .22rem;
  border-left: 1.5px solid var(--nzp-accent); border-bottom: 1.5px solid var(--nzp-accent); transform: rotate(-45deg);
}
.nzp-grid .nzp-feats li.is-link { padding-left: 0; }
.nzp-grid .nzp-feats li.is-link::before { display: none; }
/* "+N more apps" is a link that looks like one: brand-blue text, no box. */
.nzp-grid .nzp-more {
  display: inline; min-height: 0; margin: 0; padding: 0; border: 0; border-radius: 4px; background: none; box-shadow: none;
  font: inherit; font-weight: 500; line-height: inherit; color: var(--nzp-brand); text-align: left; cursor: pointer;
}
.nzp-grid .nzp-more:hover { text-decoration: underline; text-underline-offset: 2px; }
.nzp-grid .nzp-more:focus-visible { outline: 2px solid var(--nzp-accent); outline-offset: 1px; }
.nzp-grid .nzp-more .nzp-more-open,
.nzp-grid .nzp-more[aria-expanded="true"] .nzp-more-closed { display: none; }
.nzp-grid .nzp-more[aria-expanded="true"] .nzp-more-open { display: inline; }
.nzp-grid .nzp-all[hidden] { display: none !important; }
.nzp-grid .nzp-all { display: flex; flex-direction: column; gap: .4rem; margin-top: .2rem; padding-top: .45rem; border-top: 1px solid var(--nzp-line); cursor: default; }
.nzp-grid .nzp-meta { display: flex; flex-wrap: wrap; gap: .3rem; }
.nzp-grid .nzp-meta span { padding: .08rem .5rem; border-radius: 999px; background: var(--nzp-quiet); font-size: .66rem; color: var(--nzp-soft-text); }
.nzp-grid .nzp-meta span span { padding: 0; background: none; }
.nzp-grid .nzp-group h5 { margin: 0 0 .2rem; font-size: .66rem; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--nzp-muted); }
.nzp-grid .nzp-group .nzp-feats { margin: 0; }
/* Enhanced: the app's facts replace the hand-written summary, badges and list. */
.nzp-grid .nzp-card .plan-summary,
.nzp-grid .nzp-card .plan-opt-summary,
.nzp-grid .nzp-card .plan-app-details,
.nzp-grid .nzp-card .plan-badge,
.nzp-grid .nzp-card .plan-opt-flag { display: none; }
.nzp-grid .plan-opt.nzp-card.featured::before { content: none; }

/* ── No script: "Most popular" / "Current" chip on the top edge ───────── */
.nzp-grid .plan-badge,
.nzp-grid .plan-opt.featured::before,
.nzp-grid .plan-opt .plan-opt-flag {
  position: absolute; top: -9px; left: 12px; right: auto; transform: none;
  padding: 1px 8px; border-radius: 999px; box-shadow: none;
  background: var(--nzp-green); color: #fff;
  font-size: .6rem; font-weight: 600; line-height: 1.5; letter-spacing: 0; text-transform: none; white-space: nowrap;
}
.nzp-grid .plan-opt.featured::before { content: "Most popular"; }
.nzp-grid .plan-opt.is-current .plan-opt-flag { background: var(--nzp-text); }
.nzp-grid .plan-opt.is-current::after { content: none; }

/* ── Included apps (no script) ────────────────────────────────────────── */
.nzp-grid .plan-app-details,
.nzp-grid .plan-opt .plan-app-details {
  grid-column: 1 / -1; margin: .1rem 0 0; padding: .4rem 0 0; border: 0; border-top: 1px solid var(--nzp-line);
}
.nzp-grid .plan-app-details summary,
.nzp-grid .plan-opt .plan-app-details summary {
  display: flex; align-items: center; justify-content: space-between; gap: .4rem;
  margin: 0; padding: 0; list-style: none; cursor: pointer;
  font-size: .7rem; font-weight: 500; line-height: 1.4; letter-spacing: 0; text-transform: none;
  color: var(--nzp-brand);
}
.nzp-grid .plan-app-details summary::-webkit-details-marker { display: none; }
.nzp-grid .plan-app-details summary::after,
.nzp-grid .plan-app-details[open] summary::after {
  content: ''; flex: none; width: .95em; height: .95em; margin: 0; padding: 0;
  border: 0; border-radius: 0; background: currentColor;
  -webkit-mask: var(--nzp-chev) center / contain no-repeat; mask: var(--nzp-chev) center / contain no-repeat;
  transition: transform .15s;
}
.nzp-grid .plan-app-details[open] summary::after { transform: rotate(180deg); }
.nzp-grid .plan-feat-divider { display: none; }
.nzp-grid .plan-feat-label {
  margin: .4rem 0 .25rem; font-size: .66rem; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--nzp-muted);
}
.nzp-grid .plan-feats,
.nzp-grid .plan-opt-apps {
  display: flex; flex-direction: column; gap: .12rem; margin: .35rem 0 0; padding: 0; list-style: none; opacity: 1;
}
.nzp-grid .plan-feat-label + .plan-feats { margin-top: 0; }
.nzp-grid .plan-feats li,
.nzp-grid .plan-opt-apps li,
.nzp-grid .plan-opt-apps li.hl {
  font-size: .7rem; font-weight: 400; line-height: 1.4; color: var(--nzp-text);
  white-space: normal; overflow: visible; text-overflow: clip;
}
.nzp-grid .plan-feats li strong { font-weight: 600; color: var(--nzp-accent); }

/* ── The one button (home, pricing, renewal) ──────────────────────────── */
.nzp-action { display: flex; justify-content: center; margin: .9rem auto 0; max-width: 420px; }
.nzp-action .nzp-buy {
  display: flex; align-items: center; justify-content: center; gap: .25rem; width: 100%; min-height: 44px; box-sizing: border-box;
  padding: .55rem 1rem; border: 0; border-radius: 12px; box-shadow: none;
  background: var(--accent, #195afe); color: #fff;
  font-size: .9rem; font-weight: 600; line-height: 1.2; text-align: center; text-decoration: none; cursor: pointer;
}
.nzp-action .nzp-buy:hover { opacity: .92; color: #fff; }
.nzp-action .nzp-buy:focus-visible { outline: 2px solid var(--accent, #195afe); outline-offset: 2px; }
.nzp-action .nzp-buy[aria-disabled="true"] { opacity: .55; cursor: default; }

/* ── Billing period: the app's segmented switch ───────────────────────── */
.pricing-section .pricing-toggle {
  display: flex; gap: 2px; width: max-content; max-width: 100%; margin: 0 auto 1.1rem; padding: 2px;
  border-radius: 10px; background: var(--surface-2, rgba(148, 163, 184, .14));
}
.pricing-section .pricing-toggle .p-tab {
  flex: 0 0 auto; min-height: 30px; padding: .25rem .9rem; border: 1px solid transparent; border-radius: 8px;
  background: none; box-shadow: none; color: var(--muted, #6a7a8a);
  font-size: .78rem; font-weight: 500; line-height: 1;
}
.pricing-section .pricing-toggle .p-tab.active { background: var(--white, #fff); border-color: var(--line, #dfe3ec); color: var(--text, #0f1f3a); box-shadow: none; }

/* Dark app pages: the tint must stay readable on a dark surface. */
:root[data-theme="dark"] .nzp-grid .plan-opt.selected { background: var(--accent-soft, rgba(255, 255, 255, .06)); }
:root[data-theme="dark"] .nzp-grid { --nzp-brand: #7aa2ff; --nzp-green: #34d399; --nzp-green-soft: rgba(52, 211, 153, .14); }
