/* Pricing page (freemium grid). Plain CSS scoped to .khp, outside the Tailwind build.
   Dark mode follows the site toggle (html.dark). Breakpoints are container queries on .khp. */

.khp {
  --bg: #f4f8f8; --s1: #ffffff; --s2: #eef5f4; --s3: #e2edeb; --line: #d4e3e0; --line-2: #bcd2ce;
  --text: #0a1c1f; --text-2: #37514f; --muted: #5e7674;
  --teal: #0c8577; --teal-2: #0a6f63; --teal-ink: #ffffff; --teal-soft: #dcf1ee; --teal-line: #9dd6cd;
  --green: #15803d; --green-soft: #dcfce7; --green-line: #8fd6a8;
  --gold: #8a6100; --gold-soft: #fdf3d8;
  --shadow: 0 1px 2px rgba(6, 26, 26, .05), 0 12px 34px rgba(6, 26, 26, .09);
  --shadow-xl: 0 30px 80px rgba(6, 26, 26, .20);
  --r: 14px; --r-l: 20px; --tap: 44px;
  container-type: inline-size;
  container-name: khp;
  /* Transparent: the site's own section gradient shows through (see templates/pricing.twig). */
  background: transparent;
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
}
html.dark .khp {
  color-scheme: dark;
  /* Surfaces and text on the site's slate palette (cards: slate-800/50, borders: slate-700). */
  --bg: #0f172a; --s1: rgba(30, 41, 59, .5); --s2: #1e293b; --s3: #334155; --line: #334155; --line-2: #475569;
  --text: #f1f5f9; --text-2: #cbd5e1; --muted: #94a3b8;
  --teal: #2fd3bd; --teal-2: #25b8a4; --teal-ink: #042420; --teal-soft: #0f322f; --teal-line: #1f5f57;
  --green: #4ade80; --green-soft: #0f2a1c; --green-line: #215f3b;
  --gold: #f5c556; --gold-soft: #2b2210;
  --shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 12px 34px rgba(0, 0, 0, .45);
  --shadow-xl: 0 34px 90px rgba(0, 0, 0, .65);
}
.khp *, .khp *::before, .khp *::after { box-sizing: border-box; }
.khp button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
.khp :focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; border-radius: 8px; }
.khp svg { flex: 0 0 auto; }
.khp .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.khp .wrap { padding: 44px 28px 56px; max-width: 1240px; margin: 0 auto; }
@container khp (max-width: 560px) { .khp .wrap { padding: 28px 16px 40px; } }

/* Heading */
.khp .head { text-align: center; margin-bottom: 28px; }
.khp .head h1 { margin: 0 0 10px; font-size: 40px; line-height: 1.1; font-weight: 760; letter-spacing: -.025em; }
.khp .head p { margin: 0 auto; color: var(--text-2); font-size: 17px; max-width: 56ch; }
@container khp (max-width: 560px) { .khp .head h1 { font-size: 28px; } .khp .head p { font-size: 15px; } }
.khp .pill { display: inline-flex; align-items: center; gap: 8px; margin-top: 18px; padding: 0 16px; min-height: 44px; border-radius: 999px; background: var(--teal-soft); color: var(--teal); border: 1px solid var(--teal-line); font-size: 14px; font-weight: 620; }

/* Controls */
.khp .controls { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: center; margin: 26px 0 8px; }
.khp .switch { display: flex; background: var(--s2); border: 1px solid var(--line); border-radius: 999px; padding: 4px; gap: 3px; }
.khp .switch button { min-height: 40px; padding: 0 18px; border-radius: 999px; font-size: 14px; font-weight: 620; color: var(--muted); transition: .16s; }
.khp .switch button[aria-pressed="true"] { background: var(--s1); color: var(--text); box-shadow: var(--shadow); }
.khp .fami { display: flex; align-items: center; gap: 10px; background: var(--s2); border: 1px solid var(--line); border-radius: 999px; padding: 5px 6px 5px 16px; min-height: 50px; }
.khp .fami .lb { font-size: 14px; font-weight: 580; color: var(--text-2); display: flex; align-items: center; gap: 7px; }
.khp .fami .lb a { color: var(--teal); text-decoration: underline; text-underline-offset: 2px; }
.khp .yn { display: flex; background: var(--s3); border-radius: 999px; padding: 3px; gap: 2px; }
.khp .yn button { min-height: 34px; padding: 0 14px; border-radius: 999px; font-size: 13.5px; font-weight: 620; color: var(--muted); }
.khp .yn button[aria-pressed="true"] { background: var(--teal); color: var(--teal-ink); }

/* Free banner */
.khp .free { position: relative; margin: 26px 0 18px; display: grid; grid-template-columns: auto 1fr auto; gap: 22px; align-items: center; padding: 20px 24px; border-radius: var(--r-l); border: 1px solid var(--line-2); background: var(--s1); box-shadow: var(--shadow); overflow: hidden; }
.khp .free::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: linear-gradient(180deg, var(--teal), transparent); }
.khp .free .ico { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--teal-soft); color: var(--teal); border: 1px solid var(--teal-line); }
.khp .free h2 { margin: 0; font-size: 20px; font-weight: 720; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.khp .free .tag { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; background: var(--teal); color: var(--teal-ink); }
.khp .free p { margin: 4px 0 0; color: var(--text-2); font-size: 14.5px; }
.khp .free .feats { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.khp .free .price { text-align: right; white-space: nowrap; }
.khp .free .price b { font-size: 34px; font-weight: 760; letter-spacing: -.02em; display: block; line-height: 1; }
.khp .free .price span { font-size: 12.5px; color: var(--muted); }
.khp .free .cta { margin-top: 10px; width: auto; padding: 0 20px; }
.khp .free .up { margin: 10px 0 0; font-size: 13px; color: var(--muted); }
.khp .free .up b { color: var(--teal); font-weight: 640; }
@container khp (max-width: 820px) {
  .khp .free { grid-template-columns: auto 1fr; gap: 16px; }
  .khp .free .price { grid-column: 1 / -1; text-align: left; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
  .khp .free .price .cta { margin-top: 0; }
}
@container khp (max-width: 560px) { .khp .free { grid-template-columns: 1fr; padding: 18px; } .khp .free .ico { width: 46px; height: 46px; } }
.khp .feat { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 560; color: var(--text-2); background: var(--s2); border: 1px solid var(--line); border-radius: 999px; padding: 5px 11px; }
.khp .feat svg { color: var(--teal); }

/* Offer grid */
.khp .grid { display: grid; grid-template-columns: repeat(var(--khp-cols, 4), 1fr); gap: 16px; align-items: start; margin-top: 8px; }
@container khp (max-width: 1080px) { .khp .grid { grid-template-columns: repeat(2, 1fr); } }
@container khp (max-width: 620px) { .khp .grid { grid-template-columns: 1fr; } }
.khp .card { position: relative; display: flex; flex-direction: column; background: var(--s1); border: 1px solid var(--line); border-radius: var(--r-l); padding: 24px 22px; box-shadow: var(--shadow); min-height: 100%; transition: transform .18s, box-shadow .18s, border-color .18s; }
.khp .card:hover { transform: translateY(-3px); box-shadow: var(--shadow-xl); border-color: var(--line-2); }
.khp .card.pop { border-color: var(--teal); box-shadow: 0 0 0 1px var(--teal), var(--shadow-xl); }
.khp .card .ribbon { position: absolute; top: -13px; left: 50%; transform: translateX(-50%); background: var(--teal); color: var(--teal-ink); font-size: 11.5px; font-weight: 700; letter-spacing: .03em; padding: 5px 14px; border-radius: 999px; white-space: nowrap; }
.khp .card h3 { margin: 0; font-size: 21px; font-weight: 730; letter-spacing: -.01em; }
.khp .card .sub { margin: 6px 0 0; color: var(--muted); font-size: 13.5px; min-height: 38px; }
.khp .price-box { margin: 18px 0 6px; min-height: 92px; }
.khp .strike { font-size: 13px; color: var(--muted); text-decoration: line-through; display: block; min-height: 19px; }
.khp .amount { display: flex; align-items: baseline; gap: 7px; flex-wrap: wrap; }
.khp .amount b { font-size: 38px; font-weight: 770; letter-spacing: -.03em; line-height: 1; }
.khp .amount .per { font-size: 14px; color: var(--text-2); font-weight: 560; }
.khp .sec-price { font-size: 13px; color: var(--muted); margin-top: 5px; min-height: 19px; }
.khp .fami-badge { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; background: var(--green-soft); color: var(--green); border: 1px solid var(--green-line); border-radius: 999px; padding: 5px 11px; font-size: 11.5px; font-weight: 700; letter-spacing: .02em; }
.khp .fami-badge[hidden] { display: none; }
.khp .inherit { display: flex; align-items: center; gap: 8px; margin: 14px 0 2px; padding: 9px 12px; border-radius: 10px; background: var(--s2); border: 1px solid var(--line); font-size: 13px; color: var(--text-2); }
.khp .inherit b { color: var(--text); font-weight: 620; }
.khp .inherit svg { color: var(--teal); }
.khp ul.list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 9px; flex: 1; }
.khp ul.list li { display: grid; grid-template-columns: 18px 1fr; gap: 9px; font-size: 14px; color: var(--text-2); align-items: start; }
.khp ul.list li svg { margin-top: 3px; color: var(--teal); }
.khp ul.list li.star { color: var(--text); font-weight: 600; }
.khp ul.list li.star svg { color: var(--gold); }
.khp .btn { margin-top: 20px; min-height: var(--tap); border-radius: 12px; font-size: 15px; font-weight: 650; display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; border: 1px solid transparent; transition: .16s; text-decoration: none; }
.khp .btn.pri { background: var(--teal); color: var(--teal-ink); }
.khp .btn.pri:hover { background: var(--teal-2); }
.khp .btn.sec { background: transparent; color: var(--text); border-color: var(--line-2); }
.khp .btn.sec:hover { background: var(--s2); border-color: var(--teal); }
.khp .foot { margin: 10px 0 0; text-align: center; font-size: 12.5px; color: var(--muted); }

/* FAMI note */
.khp .note { margin-top: 26px; border: 1px solid var(--line); background: var(--s1); border-radius: var(--r); padding: 16px 18px; display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: start; }
.khp .note .i { width: 34px; height: 34px; border-radius: 10px; background: var(--gold-soft); color: var(--gold); display: grid; place-items: center; }
.khp .note p { margin: 0; font-size: 13.5px; color: var(--text-2); }
.khp .note p[hidden] { display: none; }
.khp .note b { color: var(--text); }

/* Comparison table */
.khp .cmp { margin-top: 34px; border: 1px solid var(--line); border-radius: var(--r-l); background: var(--s1); overflow: hidden; }
.khp .cmp > summary { cursor: pointer; list-style: none; padding: 16px 20px; font-size: 15.5px; font-weight: 650; display: flex; align-items: center; gap: 10px; min-height: var(--tap); }
.khp .cmp > summary::-webkit-details-marker { display: none; }
.khp .cmp > summary .chev { margin-left: auto; color: var(--muted); transition: transform .18s; }
.khp .cmp[open] > summary { border-bottom: 1px solid var(--line); }
.khp .cmp[open] > summary .chev { transform: rotate(180deg); }
.khp .cmp-scroll { overflow-x: auto; }
.khp table { border-collapse: collapse; width: 100%; min-width: 760px; }
.khp th, .khp td { padding: 12px 14px; text-align: left; font-size: 13.5px; border-top: 1px solid var(--line); }
.khp thead th { background: var(--s2); font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); border-top: 0; white-space: nowrap; }
.khp thead th.plan { color: var(--text); font-size: 13.5px; letter-spacing: 0; text-transform: none; text-align: center; }
.khp thead th.plan em { display: block; font-style: normal; font-size: 11.5px; color: var(--muted); font-weight: 500; margin-top: 2px; }
.khp tbody th { font-weight: 560; color: var(--text-2); }
.khp tbody tr.sect th { background: var(--s2); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.khp td { text-align: center; }
.khp td .y { color: var(--teal); }
.khp td .n { color: var(--muted); opacity: .5; }
.khp td .txt { font-size: 12.5px; color: var(--text-2); }
.khp .cmp .hint { margin: 0; padding: 12px 20px; font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--line); }
.khp .picker { display: none; gap: 8px; flex-wrap: wrap; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.khp .picker .lbl { font-size: 12.5px; color: var(--muted); align-self: center; }
.khp .picker button { min-height: 38px; padding: 0 13px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--s2); font-size: 13px; font-weight: 600; color: var(--text-2); }
.khp .picker button[aria-pressed="true"] { background: var(--teal); border-color: var(--teal); color: var(--teal-ink); }
@container khp (max-width: 620px) {
  .khp .picker { display: flex; }
  .khp table { min-width: 0; }
  .khp th[data-col], .khp td[data-col] { display: none; }
  .khp th[data-col].keep, .khp td[data-col].keep { display: table-cell; }
}

@media (prefers-reduced-motion: reduce) { .khp * { animation: none !important; transition: none !important; } }
