/* Khunpon components. Load after tokens.css. Every class is prefixed kp-.
   Shapes come from the website: square edges, 45-degree notches cut with clip-path.
   A notched element paints its fill on ::before, so its own focus outline is never clipped. */

:root { --kp-ease: cubic-bezier(.2, .7, .2, 1); }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font-family: var(--font-text);
  font-size: 16px;
  line-height: 26px;
  -webkit-font-smoothing: antialiased;
}
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
::selection { background: var(--selection); color: var(--on-gold); }
.kp-num { font-variant-numeric: tabular-nums; }
.kp-sr { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- Icons: Lucide outlines, squared off to match the notches ---------- */
.kp-icon { width: 1.15em; height: 1.15em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: square; stroke-linejoin: miter; }

/* ---------- Eyebrow and title (the website's .eyebrow and .section-title) ---------- */
.kp-eyebrow {
  display: inline-flex; align-items: center; gap: .6rem;
  font-family: var(--font-display); font-style: italic; font-weight: 600;
  text-transform: uppercase; letter-spacing: .28em; font-size: .78rem; line-height: 1rem;
  color: var(--gold-text);
}
.kp-eyebrow::before { content: ""; width: 26px; height: 2px; background: currentColor; display: inline-block; }
.kp-title {
  margin: 0; font-family: var(--font-display); font-style: italic; font-weight: 800;
  text-transform: uppercase; letter-spacing: .005em; line-height: .92; font-size: 28px;
  overflow-wrap: anywhere; text-wrap: balance;
}
.kp-title .gold { color: var(--gold-text); }
.kp-title--xl { font-size: 40px; }
.kp-title--md { font-size: 20px; line-height: 22px; }

/* ---------- Button ---------- */
.kp-btn {
  --kp-fill: var(--gold); --kp-edge: var(--gold-edge); --kp-cut: var(--notch-md);
  position: relative; isolation: isolate;
  display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
  min-height: var(--tap); padding: .7rem 1.25rem; box-sizing: border-box;
  font-family: var(--font-display); font-style: italic; font-weight: 600;
  text-transform: uppercase; letter-spacing: .12em; font-size: .9rem; line-height: 1;
  color: var(--on-gold); background: none; border: 0; cursor: pointer;
  text-decoration: none; white-space: nowrap;
  transition: transform .15s var(--kp-ease), color .2s, filter .2s;
}
.kp-btn::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--kp-fill); border: 2px solid var(--kp-edge);
  clip-path: polygon(var(--kp-cut) 0, 100% 0, 100% calc(100% - var(--kp-cut)), calc(100% - var(--kp-cut)) 100%, 0 100%, 0 var(--kp-cut));
  transition: background .2s, border-color .2s;
}
.kp-btn:hover { transform: translateY(-2px); filter: drop-shadow(0 10px 14px rgba(217, 180, 90, .35)); }
.kp-btn:hover::before { --kp-fill: var(--gold-bright); }
.kp-btn:active { transform: none; }
.kp-btn:active::before { --kp-fill: var(--gold-deep); }
.kp-btn--ghost { --kp-fill: transparent; --kp-edge: var(--control-border); color: var(--text); }
.kp-btn--ghost:hover { color: var(--gold-text); filter: none; }
.kp-btn--ghost:hover::before { --kp-fill: transparent; --kp-edge: var(--gold-text); }
.kp-btn--ghost:active::before { --kp-fill: var(--surface-3); }
.kp-btn--danger { --kp-fill: var(--blood); --kp-edge: var(--blood); color: var(--on-danger); }
.kp-btn--danger:hover { filter: brightness(1.08); }
.kp-btn--danger:hover::before, .kp-btn--danger:active::before { --kp-fill: var(--blood); }
.kp-btn--whatsapp { --kp-fill: var(--whatsapp); --kp-edge: var(--whatsapp); color: var(--on-gold); }
.kp-btn--whatsapp:hover { filter: brightness(1.05); }
.kp-btn--whatsapp:hover::before, .kp-btn--whatsapp:active::before { --kp-fill: var(--whatsapp); }
.kp-btn--quiet { --kp-fill: transparent; --kp-edge: transparent; color: var(--text-muted); padding-inline: .6rem; }
.kp-btn--quiet:hover { color: var(--text); transform: none; filter: none; }
.kp-btn--quiet:hover::before, .kp-btn--quiet:active::before { --kp-fill: var(--surface-3); --kp-edge: transparent; }
.kp-btn--sm { min-height: 36px; padding: .5rem .9rem; font-size: .8rem; }
.kp-btn--lg { padding: 1.05rem 1.7rem; }
.kp-btn--block { display: flex; width: 100%; }
.kp-btn--icon { width: var(--tap); padding: 0; }
.kp-btn--icon.kp-btn--sm { width: 36px; }
.kp-btn:disabled, .kp-btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; transform: none; filter: none; }
.kp-btn[aria-busy="true"] { pointer-events: none; }
.kp-btn[aria-busy="true"]::after { content: ""; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: kp-spin .8s linear infinite; }
.kp-btn-row { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; }

/* ---------- Status chip ---------- */
.kp-chip {
  display: inline-flex; align-items: center; gap: var(--space-1);
  min-height: 24px; padding: 2px 8px; box-sizing: border-box;
  font-family: var(--font-text); font-size: 13px; line-height: 18px; font-weight: 600;
  color: var(--text-muted); background: transparent; border: 1px solid var(--line-strong);
  white-space: nowrap;
}
.kp-chip .kp-icon { width: 14px; height: 14px; }
.kp-chip--ok { color: var(--ok); background: var(--ok-bg); border-color: var(--ok-line); }
.kp-chip--warn { color: var(--warn); background: var(--warn-bg); border-color: var(--warn-line); }
.kp-chip--danger { color: var(--danger); background: var(--danger-bg); border-color: var(--danger-line); }
.kp-chip--info { color: var(--info); background: var(--info-bg); border-color: var(--info-line); }
.kp-chip--member { color: var(--gold-text); border-color: var(--gold-deep); }
.kp-chip-row { display: flex; flex-wrap: wrap; gap: var(--space-2); }

/* ---------- Class card ---------- */
.kp-class {
  --kp-cut: var(--notch-md);
  position: relative; isolation: isolate;
  display: grid; grid-template-columns: auto 1fr auto; gap: var(--space-2) var(--space-4); align-items: start;
  padding: var(--space-4) var(--space-5); color: var(--text); text-decoration: none;
}
.kp-class::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--surface); border: 1px solid var(--line);
  clip-path: polygon(0 0, calc(100% - var(--kp-cut)) 0, 100% var(--kp-cut), 100% 100%, var(--kp-cut) 100%, 0 calc(100% - var(--kp-cut)));
}
a.kp-class:hover::before, button.kp-class:hover::before { background: var(--surface-2); }
.kp-class__time { display: grid; font-size: 15px; line-height: 20px; font-weight: 600; color: var(--gold-text); font-variant-numeric: tabular-nums; }
.kp-class__time small { font-size: 13px; font-weight: 500; color: var(--text-subtle); }
.kp-class__name { margin: 0; font-family: var(--font-display); font-style: italic; font-weight: 800; text-transform: uppercase; font-size: 20px; line-height: 22px; letter-spacing: .005em; }
.kp-class__meta { margin: 2px 0 0; font-size: 14px; line-height: 22px; color: var(--text-muted); }
.kp-class__places { text-align: right; font-size: 24px; line-height: 28px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kp-class__places small { display: block; font-size: 12px; line-height: 18px; font-weight: 500; color: var(--text-muted); }
.kp-meter { grid-column: 1 / -1; position: relative; height: 4px; background: var(--surface-3); }
.kp-meter > span { position: absolute; inset: 0 auto 0 0; width: var(--kp-pct, 0%); background: var(--gold-text); }
.kp-class--near .kp-meter > span { background: var(--warn); }
.kp-class--full .kp-meter > span { background: var(--danger); }
.kp-class .kp-chip-row { grid-column: 1 / -1; }
.kp-class--closed .kp-class__name, .kp-class--closed .kp-class__places { color: var(--text-muted); }
.kp-class--closed .kp-meter > span { background: var(--text-subtle); }
.kp-class--pt::before { border-style: dashed; border-color: var(--line-strong); }

/* ---------- Attendee row ---------- */
.kp-attendee {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: var(--space-3);
  min-height: 64px; padding: var(--space-3) var(--space-4); box-sizing: border-box;
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.kp-initials {
  --kp-cut: var(--notch-sm);
  width: 40px; height: 40px; display: grid; place-items: center; flex: none;
  background: var(--surface-3); color: var(--text);
  font-family: var(--font-display); font-style: italic; font-weight: 800; font-size: 15px; text-transform: uppercase;
  clip-path: polygon(var(--kp-cut) 0, 100% 0, 100% calc(100% - var(--kp-cut)), calc(100% - var(--kp-cut)) 100%, 0 100%, 0 var(--kp-cut));
}
.kp-attendee__name { margin: 0; font-weight: 600; }
.kp-attendee__sub { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); font-size: 14px; line-height: 22px; color: var(--text-muted); }
.kp-attendee__actions { display: flex; gap: var(--space-2); align-items: center; justify-content: flex-end; }
@media (max-width: 560px) {
  .kp-attendee { grid-template-columns: auto 1fr; }
  .kp-attendee__actions { grid-column: 1 / -1; }
}

/* ---------- Fields ---------- */
.kp-field { display: grid; gap: 6px; }
.kp-label { font-size: 12px; line-height: 18px; font-weight: 500; color: var(--text-muted); }
.kp-input, .kp-select {
  width: 100%; box-sizing: border-box; min-height: var(--tap); padding: 9px 12px;
  background: var(--surface-2); color: var(--text); border: 1px solid var(--control-border); border-radius: 0;
  font-family: var(--font-text); font-size: 16px; line-height: 24px;
}
.kp-input::placeholder { color: var(--text-muted); opacity: 1; }
.kp-input:focus-visible, .kp-select:focus-visible { outline: 2px solid var(--focus); outline-offset: 0; border-color: var(--focus); }
.kp-select { appearance: none; -webkit-appearance: none; padding-right: 40px; cursor: pointer; }
.kp-select-wrap { position: relative; }
.kp-select-wrap .kp-icon { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); pointer-events: none; color: var(--text-muted); }
.kp-help { font-size: 14px; line-height: 22px; color: var(--text-muted); }
.kp-field--error .kp-input, .kp-field--error .kp-select { border-color: var(--danger); }
.kp-error-text { display: flex; gap: var(--space-1); align-items: center; font-size: 14px; line-height: 22px; color: var(--danger); }
.kp-search { position: relative; }
.kp-search > .kp-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }
.kp-search .kp-input { padding-left: 42px; padding-right: 48px; }
.kp-kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); min-width: 22px; text-align: center; padding: 0 6px; border: 1px solid var(--line-strong); font-size: 12px; line-height: 20px; font-weight: 600; color: var(--text-muted); }

/* ---------- Forms: questions, text areas, choices, agreements, progress, signature and photo ---------- */
/* Added in version 5 for the members' sign-up form. Choices and ticks keep the native input (hidden but
   focusable), so the keyboard, screen readers and autofill all work as they do on a plain form. */
.kp-textarea {
  width: 100%; box-sizing: border-box; min-height: 104px; padding: 10px 12px; resize: vertical;
  background: var(--surface-2); color: var(--text); border: 1px solid var(--control-border); border-radius: 0;
  font-family: var(--font-text); font-size: 16px; line-height: 24px;
}
.kp-textarea::placeholder { color: var(--text-muted); opacity: 1; }
.kp-textarea:focus-visible { outline: 2px solid var(--focus); outline-offset: 0; border-color: var(--focus); }
.kp-field--error .kp-textarea, .kp-field--error .kp-choice, .kp-field--error .kp-check { border-color: var(--danger); }
.kp-optional { font-weight: 400; color: var(--text-muted); }
.kp-question { margin: 0; font-size: 17px; line-height: 26px; font-weight: 600; color: var(--text); }
.kp-fieldset { margin: 0; padding: 0; border: 0; min-width: 0; display: grid; gap: var(--space-3); }
.kp-fieldset > legend { padding: 0; margin-bottom: var(--space-3); }
.kp-form-row { display: grid; gap: var(--space-4); grid-template-columns: 1fr; }
@media (min-width: 560px) { .kp-form-row { grid-template-columns: 1fr 1fr; } .kp-form-row--3 { grid-template-columns: 1fr 1.4fr 1fr; } }
/* A follow-up question that an answer opens. */
.kp-follow { display: grid; gap: var(--space-4); padding: var(--space-4); background: var(--ground-2); border: 1px dashed var(--line-strong); }

.kp-choices { display: grid; gap: var(--space-2); grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.kp-choices--two { grid-template-columns: 1fr 1fr; }
.kp-choices--list { grid-template-columns: 1fr; }
.kp-choice {
  position: relative; display: flex; align-items: center; gap: var(--space-3); box-sizing: border-box;
  min-height: var(--tap); padding: 10px 14px; cursor: pointer; user-select: none;
  background: var(--surface-2); color: var(--text); border: 1px solid var(--control-border);
  font-size: 16px; line-height: 22px; transition: background .15s, border-color .15s;
}
.kp-choice:hover { background: var(--surface-3); }
.kp-choice input, .kp-check input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.kp-choice__mark, .kp-check__mark {
  flex: none; width: 20px; height: 20px; box-sizing: border-box; display: grid; place-items: center;
  border: 2px solid var(--control-border); background: var(--surface); color: transparent;
}
.kp-choice__mark .kp-icon, .kp-check__mark .kp-icon { width: 14px; height: 14px; stroke-width: 3; }
/* one choice of several is a diamond, the brand's cut corner on its point; any number is a square */
.kp-choice--one .kp-choice__mark { transform: rotate(45deg) scale(.85); }
.kp-choice:has(input:checked) { background: var(--surface-3); border-color: var(--gold-deep); box-shadow: inset 0 0 0 1px var(--gold-edge); }
.kp-choice input:checked + .kp-choice__mark { background: var(--gold); border-color: var(--gold); color: var(--on-gold); }
.kp-choice--one input:checked + .kp-choice__mark .kp-icon { transform: rotate(-45deg); }
.kp-choice:has(input:focus-visible), .kp-check:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.kp-choice small { display: block; font-size: 13px; line-height: 18px; color: var(--text-muted); }

/* One agreement: a tick, the statement and, once ticked, when. */
.kp-check {
  position: relative; display: grid; grid-template-columns: 20px 1fr; gap: var(--space-3); align-items: start; box-sizing: border-box;
  padding: 14px 16px; cursor: pointer; background: var(--surface-2); border: 1px solid var(--control-border);
}
.kp-check__mark { margin-top: 2px; }
.kp-check:has(input:checked) { border-color: var(--ok-line); background: var(--ok-bg); }
.kp-check input:checked + .kp-check__mark { background: var(--ok); border-color: var(--ok); color: var(--surface); }
.kp-check__text { display: grid; gap: 2px; font-size: 16px; line-height: 24px; }
.kp-check__text small { font-size: 13px; line-height: 18px; color: var(--text-muted); }

/* The document being agreed to, readable in place: it scrolls inside its box. */
.kp-doc { max-height: 320px; overflow: auto; padding: var(--space-4) var(--space-5); background: var(--surface); border: 1px solid var(--line-strong); font-size: 14px; line-height: 22px; color: var(--text); }
.kp-doc:focus-visible { outline-offset: 2px; }
.kp-doc h3 { margin: 0 0 var(--space-2); font-family: var(--font-display); font-style: italic; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; font-size: 15px; line-height: 20px; }
.kp-doc p { margin: 0 0 var(--space-3); }
.kp-doc ol, .kp-doc ul { margin: 0 0 var(--space-3); padding-left: 1.4em; display: grid; gap: var(--space-2); }

/* Where the person is in a form of several steps. */
.kp-progress { display: grid; gap: var(--space-2); }
.kp-progress__label { margin: 0; display: flex; justify-content: space-between; gap: var(--space-3); font-size: 13px; line-height: 18px; color: var(--text-muted); }
.kp-progress__label b { color: var(--text); font-weight: 600; }
.kp-progress__bar { height: 4px; background: var(--surface-3); overflow: hidden; }
.kp-progress__bar > span { display: block; height: 100%; width: var(--kp-pct, 0%); background: var(--gold); transition: width .2s var(--kp-ease); }

/* A signature: ink on paper in both themes, as it will be printed. */
.kp-signature { position: relative; display: grid; background: #fff; border: 1px solid var(--control-border); touch-action: none; }
.kp-signature__pad { display: block; width: 100%; height: 180px; cursor: crosshair; }
.kp-signature__line { position: absolute; left: 20px; right: 20px; bottom: 40px; border-top: 1px dashed #8a8f99; pointer-events: none; }
.kp-signature__hint { position: absolute; left: 20px; bottom: 14px; font-size: 13px; line-height: 18px; color: #5b616e; pointer-events: none; }
.kp-signature__clear.kp-btn { position: absolute; top: 6px; right: 6px; --kp-fill: transparent; --kp-edge: transparent; color: #3f4450; }
.kp-signature.is-signed .kp-signature__hint { visibility: hidden; }
.kp-field--error .kp-signature { border-color: var(--danger); }

/* A photo of a person: a square frame (the 640 × 640 photo kept) with a guide for the face until one is set. */
.kp-photo { position: relative; width: min(240px, 100%); aspect-ratio: 1; overflow: hidden; background: var(--ground-2); border: 1px dashed var(--line-strong); display: grid; place-items: center; }
.kp-photo__img, .kp-photo__video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.kp-photo__video { transform: scaleX(-1); }
.kp-photo__guide { width: 44%; aspect-ratio: 3 / 4; border: 2px dashed var(--line-strong); border-radius: 50%; margin-bottom: 10%; }
.kp-photo.is-set { border-style: solid; border-color: var(--ok-line); }
.kp-photo.is-checking::after { content: ""; position: absolute; inset: 0; background: var(--overlay); }

/* ---------- Panel ---------- */
.kp-panel { position: relative; background: var(--surface); border: 1px solid var(--line); padding: var(--space-6); }
.kp-panel--notched { clip-path: polygon(0 0, calc(100% - var(--notch-lg)) 0, 100% var(--notch-lg), 100% 100%, var(--notch-lg) 100%, 0 calc(100% - var(--notch-lg))); }
.kp-panel--selected { border-color: var(--gold-deep); box-shadow: inset 0 0 0 1px var(--gold-edge); }
.kp-panel__head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-4); padding-bottom: var(--space-4); margin-bottom: var(--space-4); border-bottom: 1px solid var(--line); }
.kp-corner { position: absolute; top: 0; right: 0; width: 30px; height: 30px; border-top: 2px solid var(--gold); border-right: 2px solid var(--gold); pointer-events: none; }

/* ---------- Price rows (the website's .price-row) ---------- */
.kp-price-rows { display: flex; flex-direction: column; }
.kp-price-row { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; padding: .85rem 0; border-bottom: 1px dashed var(--line); }
.kp-price-row:last-child { border-bottom: 0; }
.kp-price-row .what { font-family: var(--font-display); font-style: italic; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; font-size: .95rem; }
.kp-price-row .what small { display: block; margin-top: .15rem; font-family: var(--font-text); font-style: normal; font-weight: 400; text-transform: none; letter-spacing: 0; font-size: .8rem; color: var(--text-muted); }
.kp-price-row .amt { font-family: var(--font-display); font-style: italic; font-weight: 800; font-size: 1.5rem; color: var(--gold-text); white-space: nowrap; font-variant-numeric: tabular-nums; }
button.kp-price-row { width: 100%; background: none; border: 0; border-bottom: 1px dashed var(--line); color: inherit; font: inherit; text-align: left; cursor: pointer; padding-inline: var(--space-3); }
button.kp-price-row:hover { background: var(--surface-2); }
button.kp-price-row[aria-pressed="true"] { background: var(--surface-3); box-shadow: inset 2px 0 0 var(--gold), inset -2px 0 0 var(--gold); }

/* ---------- Data table ---------- */
.kp-table-wrap { overflow-x: auto; border: 1px solid var(--line); background: var(--surface); }
.kp-table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 22px; }
.kp-table th {
  text-align: left; padding: 10px 12px; white-space: nowrap;
  font-family: var(--font-display); font-style: italic; font-weight: 600; text-transform: uppercase; letter-spacing: .12em; font-size: 11px; line-height: 16px;
  color: var(--text-muted); background: var(--ground-2); border-bottom: 1px solid var(--line-strong);
}
.kp-table td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.kp-table tbody tr:hover td { background: var(--surface-2); }
.kp-table tr[aria-selected="true"] td { background: var(--surface-3); }
.kp-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kp-table .muted { color: var(--text-muted); }
@media (max-width: 640px) {
  .kp-table thead { display: none; }
  .kp-table tr { display: grid; grid-template-columns: 1fr 1fr; padding: var(--space-3) 0; border-bottom: 1px solid var(--line); }
  .kp-table td { border: 0; padding: 4px 12px; }
  .kp-table td::before { content: attr(data-l); display: block; font-size: 11px; line-height: 16px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .08em; }
  .kp-table .num { text-align: left; }
}

/* ---------- Sheet, confirm and prompt ---------- */
.kp-overlay { position: fixed; inset: 0; z-index: var(--z-sheet); display: flex; justify-content: flex-end; align-items: stretch; background: var(--overlay); }
.kp-sheet { position: relative; display: flex; flex-direction: column; width: min(var(--sheet), 100%); max-height: 100%; overflow: auto; background: var(--surface-2); color: var(--text); box-shadow: var(--shadow-sheet); }
.kp-sheet--inline { width: 100%; max-height: none; box-shadow: none; border: 1px solid var(--line); }
.kp-sheet--confirm { width: min(420px, 100%); align-self: center; margin-inline: auto; }
/* The head and foot sit above the body as it scrolls under them: without a z-index, the body's
   positioned parts (a search box, a notched button) would paint over the title and the actions. */
.kp-sheet__head { position: sticky; top: 0; z-index: 2; display: grid; grid-template-columns: 1fr auto; gap: var(--space-2) var(--space-3); align-items: start; padding: var(--space-6); background: inherit; border-bottom: 1px solid var(--line); }
.kp-sheet__head .kp-title { grid-column: 1; }
.kp-sheet__close { grid-column: 2; grid-row: 1 / span 2; }
.kp-sheet__body { display: grid; gap: var(--space-5); padding: var(--space-6); }
.kp-sheet__body p { margin: 0; }
.kp-sheet__foot { position: sticky; bottom: 0; z-index: 2; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--space-3); padding: var(--space-4) var(--space-6); background: inherit; border-top: 1px solid var(--line); }
@media (max-width: 640px) {
  .kp-overlay { align-items: flex-end; }
  .kp-sheet { width: 100%; max-height: 92vh; }
  .kp-sheet--confirm { align-self: flex-end; }
  .kp-sheet__foot .kp-btn { flex: 1; }
}
.kp-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); }
.kp-step { display: grid; grid-template-columns: 24px 1fr; gap: var(--space-3); align-items: start; color: var(--text-muted); }
.kp-step__mark { width: 24px; height: 24px; display: grid; place-items: center; box-sizing: border-box; border: 1px solid var(--line-strong); }
.kp-step__mark .kp-icon { width: 14px; height: 14px; }
.kp-step__text { display: grid; }
.kp-step__text b { font-weight: 600; color: var(--text); }
.kp-step__text small { font-size: 14px; line-height: 22px; }
.kp-step--done .kp-step__mark { color: var(--ok); border-color: var(--ok-line); background: var(--ok-bg); }
.kp-step--active .kp-step__mark { color: var(--info); border-color: var(--info-line); background: var(--info-bg); }
.kp-step--failed .kp-step__mark { color: var(--danger); border-color: var(--danger-line); background: var(--danger-bg); }
.kp-step--failed .kp-step__text small { color: var(--danger); }

/* ---------- Write status and toasts ---------- */
.kp-status { display: grid; grid-template-columns: auto 1fr auto; gap: var(--space-3); align-items: start; padding: var(--space-3) var(--space-4); background: var(--surface-2); border: 1px solid var(--line-strong); color: var(--text); }
.kp-status__icon { display: grid; place-items: center; width: 24px; height: 24px; }
.kp-status__title { margin: 0; font-weight: 600; }
.kp-status__text { margin: 0; font-size: 14px; line-height: 22px; color: var(--text-muted); }
.kp-status--ok { border-color: var(--ok-line); background: var(--ok-bg); } .kp-status--ok .kp-status__icon { color: var(--ok); }
.kp-status--warn { border-color: var(--warn-line); background: var(--warn-bg); } .kp-status--warn .kp-status__icon { color: var(--warn); }
.kp-status--danger { border-color: var(--danger-line); background: var(--danger-bg); } .kp-status--danger .kp-status__icon { color: var(--danger); }
.kp-status--info { border-color: var(--info-line); background: var(--info-bg); } .kp-status--info .kp-status__icon { color: var(--info); }
.kp-toast-region { position: fixed; z-index: var(--z-toast); right: var(--space-4); bottom: var(--space-4); display: grid; gap: var(--space-2); width: min(420px, calc(100% - 32px)); }
.kp-toast-region .kp-status { background-color: var(--surface-2); box-shadow: var(--shadow-pop); }
.kp-spinner { width: 16px; height: 16px; box-sizing: border-box; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: kp-spin .8s linear infinite; }
@keyframes kp-spin { to { transform: rotate(360deg); } }

/* ---------- Navigation: the desk rail and the coach tab bar (chrome: dark in both themes) ---------- */
.kp-rail { display: flex; flex-direction: column; gap: var(--space-1); width: var(--rail); box-sizing: border-box; padding: var(--space-4) var(--space-3); background: var(--chrome); color: var(--chrome-text); border-right: 1px solid var(--chrome-line); }
.kp-rail__brand { display: block; padding: var(--space-2) var(--space-3) var(--space-5); }
.kp-rail__brand img { width: 132px; height: auto; display: block; }
.kp-nav-item {
  position: relative; display: flex; align-items: center; gap: var(--space-3);
  min-height: var(--tap); padding: 0 var(--space-3);
  font-family: var(--font-display); font-style: italic; font-weight: 600; text-transform: uppercase; letter-spacing: .12em; font-size: .8rem;
  color: var(--chrome-muted); text-decoration: none;
}
.kp-nav-item:hover { color: var(--chrome-text); background: var(--chrome-raised); }
.kp-nav-item[aria-current="page"] { color: var(--gold); background: var(--chrome-raised); }
.kp-nav-item[aria-current="page"]::after { content: ""; position: absolute; top: 0; right: 0; width: 10px; height: 10px; border-top: 2px solid var(--gold); border-right: 2px solid var(--gold); }
.kp-nav-item:focus-visible, .kp-tab:focus-visible { outline-color: var(--gold); outline-offset: -2px; }
.kp-count { margin-left: auto; min-width: 22px; padding: 0 6px; box-sizing: border-box; text-align: center; font-family: var(--font-text); font-style: normal; font-size: 12px; line-height: 20px; font-weight: 700; letter-spacing: 0; color: var(--on-gold); background: var(--gold); }
.kp-tabbar { display: grid; grid-template-columns: repeat(4, 1fr); background: var(--chrome); border-top: 1px solid var(--chrome-line); padding-bottom: env(safe-area-inset-bottom, 0px); }
.kp-tab { display: grid; justify-items: center; align-content: center; gap: 4px; min-height: var(--tap-coach); padding: 8px 4px 6px; color: var(--chrome-muted); text-decoration: none; font-family: var(--font-display); font-style: italic; font-weight: 600; font-size: 11px; line-height: 14px; letter-spacing: .08em; text-transform: uppercase; }
.kp-tab .kp-icon { width: 22px; height: 22px; }
.kp-tab[aria-current="page"] { color: var(--gold); box-shadow: inset 0 2px 0 var(--gold); }

/* ---------- Thai ---------- */
/* Thai is never letter-spaced: tracking pulls vowels and tone marks away from their consonants.
   With lang="th" on the page or on an element, every tracked style drops its tracking; capitals
   don't apply to Thai, and the italic and weight stay. */
.kp-eyebrow:lang(th), .kp-title:lang(th), .kp-class__name:lang(th), .kp-btn:lang(th),
.kp-price-row .what:lang(th), .kp-table th:lang(th), .kp-table td:lang(th)::before,
.kp-nav-item:lang(th), .kp-tab:lang(th), .kp-doc h3:lang(th) { letter-spacing: 0; }

/* ---------- Empty, error and loading ---------- */
.kp-empty { display: grid; justify-items: start; gap: var(--space-3); padding: var(--space-10) var(--space-6); border: 1px dashed var(--line-strong); color: var(--text-muted); }
.kp-empty__title { margin: 0; font-family: var(--font-display); font-style: italic; font-weight: 800; text-transform: uppercase; font-size: 20px; line-height: 22px; color: var(--text); }
.kp-empty p { margin: 0; max-width: 46ch; }
.kp-empty--error { border-style: solid; border-color: var(--danger-line); background: var(--danger-bg); }
.kp-empty--error .kp-empty__title { color: var(--danger); }
.kp-skeleton { display: block; height: 14px; background: var(--surface-3); animation: kp-pulse 1.4s ease-in-out infinite; }
@keyframes kp-pulse { 50% { opacity: .55; } }
.kp-age { font-size: 12px; line-height: 18px; color: var(--text-muted); }
