/* ══════════════════════════════════════════════════════════════════════════
   COZY — the pricing page (pricing.html) and the homepage teaser   2026-10-26
   ─────────────────────────────────────────────────────────────────────────
   Cozy's palette, face and rounded forms (D-043), laid out by the Taste
   skill's rules: one idea from the subject (a shop's day, refilled at
   midnight, is the measure), one live thing (the day meter), a big type
   contrast, a heading on every section and no eyebrow label above it, no
   numbered steps, surfaces separated by a step in tone rather than an outline
   or a resting shadow, pill buttons decided once, and the name returning at
   full width as the close. Loads after variables.css and cozy-home.css (nav,
   footer base, theme).

   Each package keeps one hue everywhere it appears (the day meter, its card,
   its column): ร้านเล็ก olive, ร้านประจำ teal, ร้านขายดี ochre, ร้านเจ้าใหญ่
   clay, free sky. A mid-tone hue never carries text (~3.4:1 against both inks):
   text sits on the -t tint, bars and fills use the mid tone.
   ══════════════════════════════════════════════════════════════════════════ */

.pr-hue-small { --pk: var(--cz-olive); --pk-t: var(--cz-olive-t); --pk-d: var(--cz-olive-d); }
.pr-hue-local { --pk: var(--cz-teal);  --pk-t: var(--cz-teal-t);  --pk-d: var(--cz-teal-d); }
.pr-hue-busy  { --pk: var(--cz-ochre); --pk-t: var(--cz-ochre-t); --pk-d: var(--cz-ochre-d); }
.pr-hue-big   { --pk: var(--cz-clay);  --pk-t: var(--cz-clay-t);  --pk-d: var(--cz-clay-d); }
.pr-hue-free  { --pk: var(--cz-sky);   --pk-t: var(--cz-sky-t);   --pk-d: var(--cz-sky-d); }

.nw { white-space: nowrap; }

/* The shared nav and footer carry a hairline and resting shadows (cozy-home.css). On this page,
   surfaces are separated by tone alone. */
.pr-page nav { border-bottom: 0; box-shadow: none; padding-left: max(16px, calc((100% - 1200px) / 2 + var(--pr-margin))); padding-right: max(16px, calc((100% - 1200px) / 2 + var(--pr-margin))); }
.pr-page nav .btn-cta, .pr-page nav .btn-ghost, .pr-page nav [data-lang-toggle], .pr-page nav [data-theme-btn] { box-shadow: none; }
.pr-page footer { border-top: 0; }

.pr-page { --pr-margin: clamp(16px, 4vw, 48px); --pr-gap: clamp(88px, 11vw, 160px); }
.pr-page main { position: relative; z-index: 1; }
.pr-page main > section { max-width: 1200px; margin: 0 auto; padding: 0 var(--pr-margin); }
.pr-page main > section.pr-section { margin-top: var(--pr-gap); }
.pr-page h1, .pr-page h2, .pr-page h3 { color: var(--cz-ink); font-weight: 800; }
.pr-page h2 { font-size: clamp(30px, 4.4vw, 56px); line-height: 1.08; letter-spacing: -0.025em; max-width: 20ch; }
.pr-page p { font-size: 17px; line-height: 1.6; color: var(--cz-ink); }
.pr-note { margin-top: 14px; color: var(--cz-muted) !important; font-size: 14px !important; }

/* ── buttons: pill, one fill for the main action, a tone step for the rest ── */
.pr-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 26px; border-radius: 999px; white-space: nowrap;
  font: inherit; font-size: 17px; font-weight: 800; text-decoration: none;
  background: var(--cz-panel-2); color: var(--cz-ink);
  transition: transform .12s ease, background-color .15s ease;
}
.pr-btn:hover { background: var(--cz-tray); }
.pr-btn--main { background: var(--cz-teal-d); color: var(--cz-on-fill); }
html.light .pr-btn--main { color: #FFFFFF; }
.pr-btn--main:hover { background: var(--cz-teal); }
.pr-btn:active { transform: translateY(1px); }
.pr-btn:focus-visible, .pr-seg button:focus-visible, .pr-day-buy:focus-visible, .pr-board-buy:focus-visible { outline: 3px solid var(--cz-sky-d); outline-offset: 2px; }

/* ── segmented choice (grade, period) ── */
.pr-seg { display: inline-flex; padding: 4px; gap: 4px; border-radius: 999px; background: var(--cz-panel-2); }
.pr-seg button {
  font: inherit; font-size: 14px; font-weight: 800; cursor: pointer; border: 0;
  min-height: 40px; padding: 0 18px; border-radius: 999px; background: transparent; color: var(--cz-muted);
}
.pr-seg button[aria-pressed="true"] { background: var(--cz-panel); color: var(--cz-ink); }

/* ══ the hero: the claim, and the day meter that proves it ══ */
.pr-hero {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr); gap: clamp(32px, 5vw, 72px);
  align-items: center; padding-top: clamp(40px, 7vw, 96px) !important;
}
/* Two lines at every width: each half of the headline is kept whole (.nw), so the size is set
   for the longer half to fit its column. */
.pr-hero h1 { font-size: clamp(38px, 5.4vw, 80px); line-height: 1.02; letter-spacing: -0.035em; }
.pr-lede { margin-top: 28px; font-size: 22px !important; max-width: 34ch; }
.pr-ratio { margin-top: 18px; color: var(--cz-muted) !important; font-size: 14px !important; }

.pr-meter { background: var(--cz-panel); border-radius: 26px; padding: clamp(20px, 3vw, 32px); }
.pr-meter-q { display: block; font-size: 17px; font-weight: 800; color: var(--cz-ink); }
.pr-meter-row { display: flex; align-items: center; gap: 18px; margin-top: 12px; }
.pr-meter-row input[type=range] { flex: 1; width: 100%; min-width: 0; height: 32px; accent-color: var(--cz-teal-d); cursor: pointer; }
.pr-meter-num { flex: none; min-width: 0; text-align: right; font-size: 44px; font-weight: 800; color: var(--cz-ink); line-height: 1; font-variant-numeric: tabular-nums; }
.pr-meter-num small { display: block; font-size: 14px; font-weight: 700; color: var(--cz-muted); }
.pr-meter .pr-seg { margin-top: 14px; }
.pr-meter-need { margin-top: 18px; font-weight: 700; }

.pr-days { list-style: none; margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.pr-day {
  display: grid; grid-template-columns: 7.2em minmax(0, 1fr) auto; grid-template-areas: "name track price" "state state buy";
  align-items: center; gap: 6px 14px; padding: 12px 14px; border-radius: 16px;
}
.pr-day.is-pick { background: var(--pk-t); }
.pr-day-name { grid-area: name; font-weight: 800; color: var(--cz-ink); }
.pr-day-price { grid-area: price; font-weight: 800; color: var(--cz-ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pr-day-price small { font-size: 14px; font-weight: 700; color: var(--cz-muted); }
.pr-day-track { grid-area: track; position: relative; height: 14px; border-radius: 999px; background: var(--cz-panel-2); overflow: hidden; }
.pr-day.is-pick .pr-day-track { background: var(--cz-panel); }
.pr-day-fill { position: absolute; inset: 0 auto 0 0; border-radius: 999px; background: var(--pk); transition: width .35s ease; }
.pr-day-state { grid-area: state; font-size: 14px; font-weight: 700; color: var(--cz-muted); }
.pr-day-state.is-over { color: var(--cz-clay-d); }
.pr-day.is-pick .pr-day-state { color: var(--cz-ink); }
.pr-day-buy { grid-area: buy; justify-self: end; white-space: nowrap; font-size: 14px; font-weight: 800; color: var(--cz-teal-d); text-decoration: none; padding: 4px 0; }
.pr-day-buy:hover { text-decoration: underline; }
.pr-day--over { display: block; font-weight: 700; color: var(--cz-clay-d); }

/* ══ four packages, each drawn to the size of its day ══ */
.pr-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 18px 32px; }
.pr-pkgs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 36px; }
.pr-pkg { display: flex; flex-direction: column; gap: 10px; padding: 22px 22px 24px; border-radius: 24px; background: var(--cz-panel); }
.pr-pkg.is-rec { background: var(--pk-t); }
/* The day itself: a column whose height is the package's daily tokens (square-root scale, so the
   smallest is still visible next to the 20× largest). */
.pr-pkg-day { position: relative; height: 150px; border-radius: 16px; background: var(--cz-panel-2); overflow: hidden; }
.pr-pkg.is-rec .pr-pkg-day { background: var(--cz-panel); }
.pr-pkg-day::before { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: var(--h); background: var(--pk); border-radius: 16px 16px 0 0; }
.pr-pkg-day > span {
  position: absolute; left: 12px; top: 10px; font-size: 14px; font-weight: 800; color: var(--cz-ink);
  background: var(--cz-panel); padding: 3px 10px; border-radius: 999px;
}
.pr-pkg h3 { font-size: 22px; line-height: 1.2; margin-top: 6px; }
.pr-rec { display: inline-block; vertical-align: middle; font-size: 14px; font-weight: 800; padding: 2px 10px; border-radius: 999px; background: var(--cz-panel); color: var(--cz-ink); }
.pr-pkg-price { font-size: 44px !important; font-weight: 800; line-height: 1 !important; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.pr-pkg-price small { font-size: 14px; font-weight: 700; color: var(--cz-muted); letter-spacing: 0; }
.pr-pkg-sub { font-size: 14px !important; color: var(--cz-muted) !important; line-height: 1.5 !important; }
.pr-pkg-lines { list-style: none; display: flex; flex-direction: column; gap: 8px; margin: 6px 0 8px; flex: 1; }
.pr-pkg-lines li { position: relative; padding-left: 22px; font-size: 14px; line-height: 1.45; color: var(--cz-ink); }
.pr-pkg-lines li::before {
  content: ''; position: absolute; left: 3px; top: .38em; width: 6px; height: 11px;
  border: solid var(--pk-d); border-width: 0 3px 3px 0; transform: rotate(45deg); border-radius: 1px;
}
/* Not in this package: still readable (4.5:1), marked by a short bar instead of the tick. */
.pr-pkg-lines li.is-off { color: var(--cz-muted); }
.pr-pkg-lines li.is-off::before { width: 10px; height: 0; top: .78em; border-width: 0 0 3px 0; transform: none; border-color: var(--cz-muted); }
.pr-soon { display: inline-block; font-size: 14px; font-weight: 800; padding: 1px 8px; border-radius: 999px; background: var(--cz-panel-2); color: var(--cz-muted); vertical-align: 1px; }
.pr-pkg .pr-btn { width: 100%; }
.pr-always { margin-top: 22px; padding: 16px 20px; border-radius: 18px; background: var(--cz-panel); font-weight: 700; }

/* ══ two kinds of token: two fields of colour ══ */
.pr-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 32px; }
.pr-field { padding: clamp(24px, 4vw, 48px); border-radius: 28px; min-height: 260px; display: flex; flex-direction: column; justify-content: flex-end; gap: 14px; }
.pr-field--daily { background: var(--cz-ochre-t); }
.pr-field--saved { background: var(--cz-moss-t); }
.pr-field h3 { font-size: clamp(30px, 4.4vw, 56px); line-height: 1.04; letter-spacing: -0.03em; }
.pr-field p { font-size: 17px !important; max-width: 30ch; }
.pr-after { margin-top: 22px; font-weight: 700; }

/* ══ packs, as a shop's price board ══ */
.pr-board { background: var(--cz-hero); border-radius: 30px; padding: clamp(28px, 5vw, 64px); }
.pr-board h2, .pr-board p { color: #F7EFDD; }
.pr-board > p { margin-top: 16px; max-width: 46ch; opacity: .85; }
.pr-board-list { list-style: none; margin-top: 34px; display: flex; flex-direction: column; gap: 8px; }
.pr-board-list li {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 12px 24px;
  padding: 18px 22px; border-radius: 18px; background: rgba(247, 239, 221, .07); color: #F7EFDD;
}
.pr-board-name { font-size: 22px; font-weight: 800; }
.pr-board-item { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.pr-board-what { font-size: 14px; opacity: .8; }
.pr-board-price { font-size: 44px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.pr-board-price small { font-size: 17px; font-weight: 700; opacity: .75; }
.pr-board-buy {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 20px; border-radius: 999px;
  background: #F7EFDD; color: #17222C; font-weight: 800; font-size: 14px; text-decoration: none; white-space: nowrap;
}
.pr-board-buy:hover { background: #FFFFFF; }

/* ══ the comparison: a real table, so it may keep its lines ══ */
.pr-table-wrap { margin-top: 28px; overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 22px; background: var(--cz-panel); }
.pr-swipe { display: none; margin-top: 18px; font-size: 14px; font-weight: 700; color: var(--cz-muted); }
@media (max-width: 760px) { .pr-swipe { display: block; } }
.pr-table { width: 100%; min-width: 720px; border-collapse: collapse; }
.pr-table th, .pr-table td { padding: 14px 16px; text-align: center; font-size: 14px; color: var(--cz-ink); border-bottom: 1px solid var(--cz-line); }
.pr-table thead th { font-size: 17px; font-weight: 800; vertical-align: bottom; border-bottom: 4px solid var(--pk, var(--cz-line)); }
.pr-table thead th small { display: block; font-size: 14px; font-weight: 700; color: var(--cz-muted); }
.pr-table tbody th { text-align: left; font-weight: 700; position: sticky; left: 0; background: var(--cz-panel); }
.pr-table tbody tr:last-child > * { border-bottom: 0; }
.pr-yes { display: inline-block; width: 7px; height: 13px; border: solid var(--cz-moss-d); border-width: 0 3px 3px 0; transform: rotate(45deg); }
.pr-no { color: var(--cz-faint); }

/* ══ paying, shown as the pay screen itself ══ */
.pr-pay { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); gap: clamp(32px, 6vw, 96px); align-items: center; }
.pr-pay-text p { margin-top: 18px; font-size: 17px !important; max-width: 36ch; }
.pr-phone {
  justify-self: center; width: min(100%, 340px); padding: 22px; border-radius: 34px; background: var(--cz-panel);
  display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center;
}
.pr-phone figcaption { font-size: 14px; font-weight: 700; color: var(--cz-muted); }
.pr-phone-name { font-size: 17px; font-weight: 800; color: var(--cz-ink); }
/* A QR is always dark on white, in either theme: a camera reads contrast (cozy-pay.css). */
.pr-qr { width: 200px; height: 200px; padding: 10px; background: #FFFFFF; border-radius: 16px; }
.pr-qr svg { width: 100%; height: 100%; display: block; }
.pr-phone-amount { font-size: 44px; font-weight: 800; color: var(--cz-ink); }
.pr-phone-btn { width: 100%; min-height: 46px; display: grid; place-items: center; border-radius: 999px; background: var(--cz-teal-d); color: var(--cz-on-fill); font-weight: 800; }
html.light .pr-phone-btn { color: #FFFFFF; }
.pr-phone-done { width: 100%; padding: 10px 12px; border-radius: 14px; background: var(--cz-moss-t); color: var(--cz-ink); font-weight: 800; font-size: 14px; }

/* ══ start free: a whole field of colour, the page's one change of ground ══ */
.pr-free {
  max-width: none !important; margin-top: var(--pr-gap); padding: clamp(56px, 8vw, 112px) var(--pr-margin) !important;
  background: var(--cz-teal-t);
}
.pr-free > * { max-width: 1200px; margin-left: auto; margin-right: auto; }
.pr-free p { margin-top: 18px; font-size: 17px !important; max-width: 52ch; }
.pr-free .pr-free-limits { color: var(--cz-muted) !important; font-size: 17px !important; }
.pr-free .pr-btn { margin-top: 28px; }
.pr-free > .pr-btn { display: flex; width: max-content; }

/* ══ questions ══ */
.pr-faq-list { margin-top: 28px; display: flex; flex-direction: column; gap: 8px; max-width: 900px; }
.pr-faq-list details { border-radius: 18px; background: var(--cz-panel); padding: 0 22px; }
.pr-faq-list summary {
  cursor: pointer; list-style: none; padding: 18px 0; font-size: 17px; font-weight: 800; color: var(--cz-ink);
  display: flex; justify-content: space-between; gap: 16px;
}
.pr-faq-list summary::-webkit-details-marker { display: none; }
.pr-faq-list summary::after { content: '+'; font-weight: 800; color: var(--cz-muted); }
.pr-faq-list details[open] summary::after { content: '–'; }
.pr-faq-list details p { padding-bottom: 20px; max-width: 70ch; }
.pr-big { margin-top: 40px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; }
.pr-big h3 { font-size: 22px; width: 100%; }
.pr-big p { flex: 1; min-width: 260px; }

/* ══ the close: the name at full width ══ */
.pr-footer { margin-top: var(--pr-gap); padding: 0 var(--pr-margin) 40px; position: relative; z-index: 1; flex-direction: column; align-items: flex-start; }
.pr-wordmark { font-size: clamp(64px, 17vw, 236px); font-weight: 800; letter-spacing: -0.05em; line-height: .82; color: var(--cz-ink); width: 100%; }
.pr-wordmark span { color: var(--cz-teal-d); }
.pr-footer .footer-links { margin: 24px 0 0; }

/* ══ the homepage teaser (index.html #pricing) ══ */
.pr-teaser { list-style: none; display: flex; flex-direction: column; gap: 6px; margin-top: 22px; }
.pr-teaser li {
  display: grid; grid-template-columns: 8em auto minmax(0, 1fr); align-items: baseline; gap: 6px 22px;
  padding: 16px 20px; border-radius: 18px; background: var(--cz-panel); border-left: 6px solid var(--pk);
}
.pr-tz-name { font-size: 17px; font-weight: 800; color: var(--cz-ink); }
.pr-tz-price { font-size: 44px; font-weight: 800; color: var(--cz-ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pr-tz-price small { font-size: 14px; font-weight: 700; color: var(--cz-muted); }
.pr-tz-day { font-size: 14px; color: var(--cz-muted); }
.pr-home-more { align-self: flex-start; margin-top: 6px; }
.pr-home-trial { margin-top: 14px; padding: 14px 18px; border-radius: 16px; background: var(--cz-moss-t); color: var(--cz-ink); font-weight: 700; }

/* ══ widths ══ */
@media (max-width: 1100px) {
  .pr-pkgs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  .pr-hero { grid-template-columns: 1fr; }
  .pr-pay { grid-template-columns: 1fr; }
  .pr-board-list li { grid-template-columns: 1fr auto; }
  .pr-board-buy { grid-column: 1 / -1; justify-content: center; }
}
@media (max-width: 640px) {
  .pr-pkgs, .pr-fields { grid-template-columns: 1fr; }
  .pr-field { min-height: 0; }
  .pr-day { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name price" "track track" "state buy"; }
  .pr-meter-num { font-size: 44px; min-width: 0; }
  .pr-teaser li { grid-template-columns: 1fr auto; }
  .pr-tz-day { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) {
  .pr-day-fill, .pr-btn { transition: none; }
}

/* ══ motion: each section's parts rise in once, staggered; the package days fill. Without the
   script nothing is hidden (it sets .pr-js); reduced motion keeps everything still. ══ */
.pr-js .pr-rise { opacity: 0; transform: translateY(22px); transition: opacity .55s ease, transform .55s cubic-bezier(.2, .7, .2, 1); transition-delay: var(--d, 0ms); }
.pr-js .pr-rise.is-in { opacity: 1; transform: none; }
.pr-pkg-day::before { transform-origin: bottom; transition: transform .7s cubic-bezier(.2, .7, .2, 1) calc(var(--d, 0ms) + 150ms); }
.pr-js .pr-pkg.pr-rise:not(.is-in) .pr-pkg-day::before { transform: scaleY(0); }
.pr-pkg, .pr-board-list li { transition: transform .15s ease; }
.pr-pkg:hover, .pr-board-list li:hover { transform: translateY(-3px); }
@media (prefers-reduced-motion: reduce) {
  .pr-js .pr-rise, .pr-js .pr-pkg.pr-rise:not(.is-in) .pr-pkg-day::before { opacity: 1; transform: none; transition: none; }
  .pr-pkg:hover, .pr-board-list li:hover { transform: none; }
}
