/* GIT CTRE student site. Mesra form house style on the GIT brand tokens (kit/brands/git/brand.css).
   No colour literals here: every colour is a token. 18px body, nothing under 16px, 48 to 64px targets. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body.pf {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 var(--pf-body)/1.55 var(--sans); touch-action: manipulation;
}
body.pf.lang-zh { font-family: var(--zh); }
.pf a { color: var(--link); text-underline-offset: 3px; }
.pf a:focus-visible, .pf button:focus-visible, .pf input:focus-visible, .pf summary:focus-visible, .pf label:has(input:focus-visible) {
  outline: 3px solid var(--focus); outline-offset: 2px;
}
/* A ring only for the keyboard: a tap focuses a checkbox too, and the ring then stayed after the tap.
   Browsers without :has() keep the older ring, so the keyboard is never left without one. */
@supports not selector(:has(*)) { .pf label:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; } }
/* A heading the page moves to (after an upload) is not a control: no ring. */
.pf-h1[tabindex="-1"]:focus { outline: none; }
.pf-skip { position: absolute; left: -9999px; top: 0; }
.pf-skip:focus { left: 12px; top: 12px; z-index: 50; background: var(--surface); padding: 10px 14px; border-radius: var(--r-sm); }
.pf-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }
/* A message that was shown and is now answered (an error being fixed, the email hint after 用这个)
   keeps its room, empty and unseen, until the step is checked again, so nothing under it moves
   under a finger. The page script adds this class and the height. */
.pf-kept { visibility: hidden; }

.pf-practice { background: var(--warn-bg); color: var(--warn-fg); border-bottom: 2px solid var(--warn-dot); text-align: center; padding: 10px 16px; font-weight: 700; font-size: var(--pf-small); }

/* Frame */
.pf-page { padding: 0 0 120px; }
.pf-sheet { max-width: 720px; margin: 0 auto; background: var(--surface); min-height: 100vh; }
.pf-stripe { display: flex; height: 4px; }
.pf-stripe i { flex: 1; }
.pf-stripe i:nth-child(1) { background: var(--stripe-1); }
.pf-stripe i:nth-child(2) { background: var(--stripe-2); }
.pf-stripe i:nth-child(3) { background: var(--stripe-3); }
.pf-stripe i:nth-child(4) { background: var(--stripe-4); }
@media (min-width: 680px) {
  .pf-page { padding: 24px 16px 140px; }
  .pf-sheet { border-radius: var(--r-lg); box-shadow: var(--sh); overflow: hidden; min-height: 0; }
}
/* The room under the page is for the fixed bar, so only the class list (the page with the bar) keeps it */
body:not(:has(> .pf-bar)) .pf-page { padding-bottom: 0; }
@media (min-width: 680px) { body:not(:has(> .pf-bar)) .pf-page { padding-bottom: 24px; } }

/* The top of the page is kept short so the first class starts on the first screen of a small phone
   in every language (375 by 667, and 375 by 560 inside WhatsApp with its bars). */
.pf-head { display: flex; align-items: center; gap: 12px; padding: 6px 16px; }
.pf-logo img { display: block; width: 88px; height: auto; }
.pf-langs { margin-left: auto; display: flex; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r); padding: 3px; }
.pf-langs a { min-width: 52px; min-height: 44px; display: flex; align-items: center; justify-content: center; padding: 0 10px; border-radius: var(--r-sm); color: var(--text-2); text-decoration: none; font-weight: 600; font-size: var(--pf-small); }
.pf-langs a.on { background: var(--surface); color: var(--accent-text); box-shadow: var(--sh-sm); }

.pf-main { padding: 0 16px 8px; }
@media (min-width: 680px) { .pf-head { padding: 18px 28px; } .pf-main { padding: 0 28px 12px; } }

/* Type */
.pf-intro { padding: 2px 0 0; }
.pf-h1 { margin: 0 0 4px; color: var(--accent-text); font-size: var(--pf-h1); line-height: 1.25; font-weight: 700; }
@media (min-width: 680px) { .pf-h1 { font-size: var(--pf-h1-wide); } }
.pf-lead { margin: 0 0 6px; color: var(--text-2); }
/* One calm line in plain text, for a shared link to a class that is no longer on the list. At 16px it
   stays short enough for the first class title to end on the first screen of a small phone. */
.pf-note { margin: 0 0 6px; font-size: var(--pf-small); line-height: 1.45; font-weight: 400; color: var(--text); }
/* A menu name in quotes (「存储到照片」) never breaks across two lines */
.pf-nowrap { white-space: nowrap; }
.pf-btn-text { min-width: 0; }
.pf-small, .pf-hint { font-size: var(--pf-small); color: var(--text-2); margin: 4px 0; }
.pf-strong { font-weight: 700; }
.pf-center { text-align: center; }
.pf-block { display: block; }
.pf-prose p, .pf-prose li { margin: 0 0 10px; }
.pf-prose ol { padding-left: 24px; }

/* Sections */
.pf-section { border-top: 8px solid var(--bg); margin: 0 -16px; padding: 18px 16px 8px; }
@media (min-width: 680px) { .pf-section { margin: 0 -28px; padding: 22px 28px 10px; } }
.pf-sec-title { display: flex; gap: 10px; align-items: baseline; margin: 0 0 12px; font-size: var(--pf-section); line-height: 1.3; color: var(--text); }
.pf-n { color: var(--highlight); font-weight: 700; }

/* Price ladder: two short lines, the notes behind "价格怎么算" */
.pf-price { display: grid; grid-template-columns: max-content minmax(0, 1fr); column-gap: 14px; align-items: start; margin: 0; }
.pf-price-title { margin: 0; font-size: var(--pf-body); line-height: 26px; color: var(--accent-text); }
.pf-price-lines { min-width: 0; }
/* 16px (the floor) so three prices fit a 375px line in 中文 and two in English and BM */
.pf-price-line { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; column-gap: 14px; font-size: var(--pf-small); line-height: 26px; }
.pf-price-line li { white-space: nowrap; }
.pf-price-line b { font-variant-numeric: tabular-nums; }
.pf-price-how { grid-column: 2; }
.pf-price-how > summary { min-height: 44px; display: flex; align-items: center; color: var(--link); font-weight: 600; cursor: pointer; }
.pf-price-how p { margin: 0 0 8px; color: var(--text-2); }

/* 跳到 months, "Taught in English" dates and the WhatsApp link: one short line each */
.pf-jump, .pf-english { display: flex; flex-wrap: wrap; align-items: center; column-gap: 14px; margin: 0; }
.pf-jump-k { color: var(--text-2); }
.pf-jump a, .pf-english a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }
.pf-wa-line { margin: 0; }

/* Months */
.pf-month { margin: 0 0 8px; }
.pf-month-title { margin: 8px 0 10px; padding-left: 12px; border-left: 5px solid var(--stripe-4); font-size: 22px; color: var(--accent-text); line-height: 1.3; }
.pf-month-fold > summary { list-style: none; cursor: pointer; display: flex; align-items: center; min-height: 56px; margin: 10px 0; border: 1px solid var(--line); border-radius: var(--r); padding: 0 14px; background: var(--surface-2); }
.pf-month-fold > summary::-webkit-details-marker { display: none; }
.pf-month-fold > summary .pf-month-title { margin: 0; flex: 1; }
.pf-month-fold > summary::after { content: ""; width: 10px; height: 10px; border-right: 3px solid var(--accent-text); border-bottom: 3px solid var(--accent-text); transform: rotate(45deg); margin: -4px 4px 0 12px; }
.pf-month-fold[open] > summary::after { transform: rotate(-135deg); margin-top: 6px; }
.pf-classes { scroll-margin-top: 12px; }

/* One class: a compact row, not a card */
.pf-row { border: 1px solid var(--line); border-radius: var(--r); padding: 10px 14px 14px; margin: 0 0 12px; background: var(--surface); scroll-margin-top: 12px; scroll-margin-bottom: 140px; }
.pf-row.is-picked, .pf-row:has(.pf-pick input:checked) { border: 3px solid var(--accent); padding: 8px 12px 12px; background: var(--accent-soft); }
.pf-row-when { margin: 0; color: var(--text); }
.pf-row-date { font-weight: 700; }
.pf-row-title { margin: 4px 0 0; font-size: 20px; line-height: 1.35; color: var(--accent-text); font-weight: 700; overflow-wrap: anywhere; }
.pf-row-title2 { margin: 2px 0 0; color: var(--text-2); font-size: var(--pf-small); line-height: 1.45; overflow-wrap: anywhere; }
/* The facts are spaced by CSS, never a typed "|" a screen reader would read out. Each fact has a thin
   rule on its left, and the rule of the first fact on every line sits outside the clipped box. */
.pf-row-facts { margin: 6px 0 0; overflow: hidden; color: var(--text-2); }
.pf-facts-in { display: flex; flex-wrap: wrap; margin-left: -11px; }
.pf-facts-in > span { border-left: 1px solid var(--field); padding: 0 10px; line-height: 1.35; margin: 2px 0; }
.pf-row-call { margin: 6px 0 0; font-weight: 700; color: var(--warn-fg); }
.pf-row-more { margin-top: 4px; }
.pf-row-more > summary { min-height: 44px; display: flex; align-items: center; color: var(--link); font-weight: 600; cursor: pointer; }
/* 详情 and 价格怎么算 show the same open and close arrow in every browser (a flex summary loses
   Chrome's own marker while Safari keeps it), like the folded months and the bar. */
.pf-row-more > summary, .pf-price-how > summary { list-style: none; }
.pf-row-more > summary::-webkit-details-marker, .pf-price-how > summary::-webkit-details-marker { display: none; }
.pf-row-more > summary::after, .pf-price-how > summary::after { content: ""; width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); margin: -5px 0 0 10px; }
.pf-row-more[open] > summary::after, .pf-price-how[open] > summary::after { transform: rotate(-135deg); margin-top: 5px; }
.pf-more-list { margin: 0 0 6px; }
.pf-more-list > div { display: grid; grid-template-columns: minmax(96px, 30%) 1fr; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line-soft); }
.pf-more-list dt { color: var(--text-2); }
.pf-more-list dd { margin: 0; overflow-wrap: anywhere; }
.pf-more-list a { display: inline-flex; align-items: center; min-height: 44px; }
.pf-more-text { white-space: pre-line; }
/* A date and time breaks only at its spaces (never 下 | 午5点) */
.pf-keep { word-break: keep-all; }
@media (max-width: 380px) { .pf-more-list > div { grid-template-columns: 1fr; gap: 2px; } }
.pf-more-links { display: flex; flex-wrap: wrap; gap: 12px; margin: 10px 0 4px; }

/* Full or closed and not happened yet: one grey line, the status in words (4.5:1 and more).
   On a wide sheet: date, title, status on one line. On a phone the status sits beside the date and the
   title gets the whole second line, so a long title never leaves one character beside the status. */
.pf-row.is-off { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "date title state"; align-items: baseline;
  column-gap: 12px; row-gap: 2px; background: var(--surface-2); color: var(--text-2); border-style: dashed; padding: 10px 14px; }
.pf-off-date { grid-area: date; color: var(--text-2); }
.pf-off-title { grid-area: title; min-width: 0; overflow-wrap: anywhere; color: var(--text-2); }
.pf-off-state { grid-area: state; color: var(--text); text-align: right; }
@media (max-width: 600px) { .pf-row.is-off { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "date state" "title title"; } }

/* The select button: a full width button that is really a checkbox */
.pf-pick { position: relative; display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 56px; margin-top: 12px; padding: 4px 12px;
  border: 2px solid var(--accent); border-radius: var(--r); color: var(--accent-text); font-weight: 700; cursor: pointer; user-select: none; background: var(--surface); text-align: center; }
.pf-pick input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pf-pick-box { flex: 0 0 26px; height: 26px; border: 2px solid var(--accent); border-radius: 7px; background: var(--surface); }
.pf-pick-on { display: none; }
.pf-pick:has(input:checked) { background: var(--accent); color: var(--on-accent); }
.pf-pick input:checked ~ .pf-pick-box { background: var(--on-accent); border-color: var(--on-accent); }
.pf-pick input:checked ~ .pf-pick-box::after { content: "\2713"; display: block; text-align: center; color: var(--accent); font-weight: 800; line-height: 22px; }
.pf-pick input:checked ~ .pf-pick-off { display: none; }
.pf-pick input:checked ~ .pf-pick-on { display: inline; }
.pf-pick:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }

.pf-later { background: var(--accent-soft); border-radius: var(--r); padding: 4px 16px 16px; margin: 18px 0; }
/* "One less" [n] "One more": words on the buttons, they wrap to two lines on a 320px phone */
.pf-stepper { display: grid; grid-template-columns: minmax(0, 1fr) 60px minmax(0, 1fr); gap: 8px; align-items: stretch; max-width: 380px; }
.pf-step-btn { min-width: 0; min-height: 56px; padding: 6px 4px; border: 2px solid var(--accent); background: var(--surface); color: var(--accent-text); border-radius: var(--r);
  font-family: inherit; font-size: var(--pf-body); font-weight: 700; line-height: 1.2; overflow-wrap: break-word; cursor: pointer; }
.pf-step-input { text-align: center; min-width: 0; padding-left: 4px; padding-right: 4px; }
.pf-endnav { margin: 18px 0 6px; }
.pf-endnav .pf-bar-msg { margin: 0 0 8px; }
.pf-end-line { margin: 0 0 8px; }
.pf-pastlink { margin: 12px 0 4px; }
.pf-pastlink a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }
.pf-empty { text-align: center; padding: 24px 0 32px; }
.pf-empty h2 { font-size: 22px; color: var(--accent-text); }

/* Bottom bar: solid, one line with the count and the total, Next on the right. It is fixed only while
   something is picked (the script adds is-on), so with nothing picked it never covers the first class
   on a small phone. Without script it never shows: the Next at the end of the list does its work. The
   room under the page (.pf-page) is there either way, so the bar coming or going moves nothing. */
html:has(.pf-bar.is-on) { scroll-padding-bottom: 140px; }
.pf-bar { display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--surface); border-top: 1px solid var(--line); box-shadow: var(--sh); padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); }
.js .pf-bar.is-on { display: block; }
.pf-bar-in { max-width: 720px; margin: 0 auto; }
.pf-bar-row { display: flex; gap: 12px; align-items: center; }
.pf-bar-info { flex: 1; min-width: 0; }
.pf-bar-info p { margin: 0; }
.pf-bar-line, .pf-bar-sum { display: flex; flex-wrap: wrap; align-items: center; column-gap: 14px; font-weight: 700; color: var(--text); }
.pf-bar-sum { min-height: 44px; width: 100%; padding: 0; border: 0; background: none; font-family: inherit; font-size: var(--pf-body); text-align: left; cursor: pointer; }
.pf-bar-sum::after { content: ""; width: 9px; height: 9px; border-right: 3px solid var(--accent-text); border-top: 3px solid var(--accent-text); transform: rotate(-45deg); margin-top: 4px; }
.pf-bar-sum[aria-expanded="true"]::after { transform: rotate(135deg); margin-top: -6px; }
.pf-bar-sum #bar-count { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.pf-bar-total { color: var(--accent-text); }
.pf-bar-nudge { font-size: var(--pf-small); color: var(--warn-fg); }
.pf-bar-msg { font-weight: 700; color: var(--err-fg); }
/* Next keeps to the bottom of the bar: when a line appears beside it (同样 RM200，你还可以多选 1 堂课)
   the bar grows upwards and Next stays where the finger is. */
.pf-bar .pf-btn-primary { flex: 0 0 auto; min-width: 120px; align-self: flex-end; }
.pf-picked { max-height: 50vh; overflow-y: auto; border-bottom: 1px solid var(--line); margin: 0 0 10px; padding: 0 0 10px; }
.pf-picked-head { display: flex; align-items: center; gap: 12px; }
.pf-picked-title { flex: 1; margin: 0; font-size: 20px; color: var(--accent-text); }
.pf-picked-list { list-style: none; margin: 6px 0; padding: 0; }
.pf-picked-list li { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
.pf-picked-text { flex: 1; min-width: 0; }
.pf-picked-when { display: block; font-weight: 700; }
.pf-picked-name { display: block; color: var(--text-2); overflow-wrap: anywhere; }
.pf-picked-share { margin: 8px 0 0; }
/* Short screens or very large text: the bar joins the page instead of covering it */
@media (max-height: 480px) { .pf-bar { position: static; box-shadow: none; } html:has(.pf-bar.is-on) { scroll-padding-bottom: 0; } }

/* Past classes */
.pf-search { margin: 4px 0 12px; }
.pf-search-row { display: flex; gap: 10px; }
.pf-search-row .pf-input { flex: 1; min-width: 0; }
.pf-search-row .pf-btn { flex: 0 0 auto; }
.pf-past-found { margin: 0 0 8px; font-weight: 600; }
.pf-empty-line { margin: 16px 0; color: var(--text-2); }
.pf-past-list { list-style: none; margin: 0; padding: 0; }
.pf-past-row { padding: 10px 0 12px; border-bottom: 1px solid var(--line-soft); }
.pf-past-row p { margin: 0; }
.pf-past-date { color: var(--text-2); }
.pf-past-title { font-weight: 700; font-size: 20px; line-height: 1.35; color: var(--accent-text); overflow-wrap: anywhere; }
.pf-past-title2 { color: var(--text-2); overflow-wrap: anywhere; }
.pf-past-fact { color: var(--text); }
.pf-k { color: var(--text-2); }
.pf-k::after { content: ":"; }
.lang-zh .pf-k::after { content: "\FF1A"; }
.pf-again { display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; }

/* One poster on its own page: the picture at the width of the screen, never wider */
.pf-poster-title2 { margin: 0 0 4px; color: var(--text-2); overflow-wrap: anywhere; }
.pf-poster-when { margin: 0 0 4px; }
.pf-poster-img { display: block; width: 100%; height: auto; margin: 4px 0 16px; border: 1px solid var(--line-soft); }

/* Old links to classes that cannot be booked */
.pf-gone { list-style: none; margin: 0 0 16px; padding: 0; }
.pf-gone li { display: flex; flex-direction: column; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.pf-gone-title { font-weight: 700; color: var(--accent-text); overflow-wrap: anywhere; }
.pf-gone-date { color: var(--text-2); }
.pf-gone-state { color: var(--text); }

/* Buttons */
.pf-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 56px; padding: 0 22px; border-radius: var(--r);
  border: 2px solid transparent; font-family: inherit; font-weight: 650; font-size: 19px; line-height: 1.2; text-decoration: none; cursor: pointer; text-align: center; }
.pf a.pf-btn { text-decoration: none; }
.pf-btn-primary { background: var(--accent); color: var(--on-accent); }
.pf a.pf-btn-primary { color: var(--on-accent); }
.pf-btn-primary:hover { background: var(--accent-hover); }
.pf-btn-ghost { background: var(--accent-soft); color: var(--accent-text); border-color: var(--line-accent); }
.pf a.pf-btn-ghost { color: var(--accent-text); }
.pf-btn-block { display: flex; width: 100%; }
.pf-btn-sm { min-height: 44px; padding: 0 14px; font-size: var(--pf-small); }
.pf-btn[disabled], .pf-btn[aria-busy="true"] { opacity: .65; cursor: default; }
.pf-wa { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }
.pf-link-strong { font-weight: 700; display: inline-flex; min-height: 44px; align-items: center; }
.pf-nav { display: flex; flex-wrap: wrap; gap: 12px; margin: 18px 0 10px; }
.pf-nav > .pf-btn { flex: 1 1 140px; }
@media (max-width: 480px) { .pf-nav > .pf-btn-primary { flex-basis: 100%; order: -1; } }

/* Register form: a link in the error summary leaves the field's label and hint in view above it */
#reg .pf-field, #reg .pf-input, #f-classes { scroll-margin-top: 120px; }

/* Steps */
.pf-steps { margin: 0; color: var(--text-2); font-weight: 600; }

/* Fields */
.pf-field { margin: 0 0 22px; border: 0; padding: 0; min-width: 0; }
.pf-label { display: block; font-weight: 700; font-size: var(--pf-label); margin: 0 0 4px; padding: 0; }
.pf-input { display: block; width: 100%; min-height: 56px; padding: 12px 14px; font-family: inherit; font-weight: 400; font-size: var(--pf-input); line-height: 1.3; color: var(--text);
  background: var(--surface); border: 1.5px solid var(--field); border-radius: var(--r-sm); }
.pf-input:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px var(--focus-halo); }
.pf-input[aria-invalid="true"] { border-color: var(--err-fg); border-width: 2px; }
.pf-err { margin: 6px 0 0; color: var(--err-fg); font-weight: 700; font-size: var(--pf-small); }
.pf-err::before { content: "!"; display: inline-flex; width: 20px; height: 20px; border-radius: 50%; background: var(--err-fg); color: var(--surface); align-items: center; justify-content: center; font-size: 14px; margin-right: 8px; vertical-align: 1px; }
/* One line under the name field: the hint (证书上会印这个名字。) while the field is empty, and with
   script the name as it will print while it is typed (证书上会是：NAME), at the size of a hint. With
   script its room is three lines from the start (a 60 letter name fits at 320px), a name too long
   for them is cut at the end of the third, so the line never grows and nothing moves. Without script
   it is the plain hint. */
.pf-echo { margin: 6px 0 0; font-size: var(--pf-small); font-weight: 700; color: var(--accent-text); line-height: 1.4; overflow-wrap: anywhere; }
.pf-echo.is-empty { font-weight: 400; color: var(--text-2); }
.js .pf-echo { display: -webkit-box; height: calc(3 * 1.4em); overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; }
/* The email hint, next to Next: the question with 用这个, and a short line that a second Next keeps
   the email as typed. Right above Next when the screen has room for it there, else right below it
   (between Next and 上一步 on a phone, under both on a wide screen). Next never moves for it. A long
   address wraps inside it instead of pushing the page sideways. */
.pf-suggest { margin: 14px 0 -4px; }
.pf-nav > .pf-suggest { flex: 1 1 100%; order: 1; margin: 0; }
@media (max-width: 480px) { .pf-nav > .pf-suggest { order: -1; } }
.pf-suggest p { margin: 0; }
.pf-suggest-q { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-weight: 700; }
.pf-suggest-text { min-width: 0; overflow-wrap: anywhere; }
.pf-suggest p.pf-suggest-again { margin-top: 6px; color: var(--text-2); font-size: var(--pf-small); }
.pf-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.pf-opts { display: grid; gap: 10px; margin-top: 6px; }
.pf-opt { position: relative; display: flex; gap: 12px; align-items: center; min-height: 64px; padding: 12px 16px; border: 1.5px solid var(--line); border-radius: var(--r); cursor: pointer; background: var(--surface); }
.pf-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pf-dot { flex: 0 0 26px; height: 26px; border-radius: 50%; border: 2px solid var(--field); background: var(--surface); }
.pf-opt:has(input:checked) { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: var(--accent-soft); }
.pf-opt input:checked + .pf-dot { border-color: var(--accent); box-shadow: inset 0 0 0 6px var(--accent); }
.pf-opt:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }

.pf-check { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; position: relative; min-height: 44px; }
.pf-check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pf-box { flex: 0 0 28px; height: 28px; border: 2px solid var(--field); border-radius: 7px; background: var(--surface); margin-top: 2px; }
.pf-check input:checked + .pf-box { background: var(--accent); border-color: var(--accent); }
.pf-check input:checked + .pf-box::after { content: "\2713"; display: block; color: var(--on-accent); text-align: center; font-weight: 800; line-height: 24px; }
.pf-check:has(input:focus-visible) .pf-box { outline: 3px solid var(--focus); outline-offset: 2px; }
/* 条款, 退款政策 and 隐私声明 in the consent sentence: each link is a 44px tall target. Padding on a
   link inside a line makes the tap area taller and never the line, so the sentence keeps its spacing
   and nothing moves. A tap on a link opens it and never ticks the box (a label does not pass on a tap
   on a link inside it). */
.pf-check a { padding: 12px 0; }
@supports not selector(:has(*)) { .pf-check:focus-within .pf-box { outline: 3px solid var(--focus); outline-offset: 2px; } }

/* Messages */
.pf-errsum { border: 2px solid var(--err-fg); background: var(--err-bg); border-radius: var(--r); padding: 12px 16px; margin: 0 0 16px; }
.pf-errsum h2 { margin: 0 0 6px; font-size: 20px; color: var(--err-fg); }
.pf-errsum ul { margin: 0; padding-left: 20px; }
.pf-errsum a { color: var(--err-fg); font-weight: 600; }
/* Each line is a link to its field: a 44px tall target that still reads as an underlined line of text */
.pf-errsum a { display: block; min-height: 44px; padding: 8px 0; }
/* A summary line whose field is right now: a tick and plain muted words, at the same height */
.pf-errsum li { position: relative; }
.pf-errsum li.is-fixed { list-style: none; }
/* The tick sits where the dot was, beside the first line of words. In the flow it would take a line
   of its own above the link (a block), and the summary would grow when a field is fixed. */
.pf-errsum li.is-fixed::before { content: "\2713"; position: absolute; left: -20px; top: 8px; width: 20px; color: var(--ok-fg); font-weight: 800; }
.pf-errsum li.is-fixed a { color: var(--text-2); text-decoration: none; font-weight: 400; }
.pf-errbox { border-left: 5px solid var(--err-dot); background: var(--err-bg); color: var(--err-fg); padding: 12px 14px; border-radius: var(--r-sm); font-weight: 600; margin: 0 0 14px; }
.pf-errbox a { display: inline-flex; align-items: center; min-height: 44px; color: var(--err-fg); font-weight: 700; }
.pf-warnbox { border-left: 5px solid var(--warn-dot); background: var(--warn-bg); color: var(--warn-fg); padding: 12px 14px; border-radius: var(--r-sm); margin: 0 0 12px; }
.pf-okbox { border-left: 5px solid var(--ok-dot); background: var(--ok-bg); color: var(--ok-fg); padding: 12px 14px; border-radius: var(--r-sm); font-weight: 600; }
.pf-nudge { color: var(--warn-fg); font-weight: 600; }

/* Chosen classes and totals */
.pf-chosen { list-style: none; margin: 0; padding: 0; }
.pf-chosen li { padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.pf-chosen-date { display: block; font-weight: 700; }
.pf-chosen-title { display: block; color: var(--text-2); }
/* Step 1 of the form: 删除 beside each class, in a right column at the top of its row. The button is as
   wide as the longer of 删除 and 加回 from the start (an empty, unseen line with the other words), so
   it never changes width and the class beside it never wraps again. A class taken off keeps its row:
   已删除 in place of its date, its title struck through, and 加回 where 删除 was. */
.pf-chosen-edit li { display: flex; align-items: flex-start; gap: 12px; }
.pf-chosen-text { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.pf-chosen-rm { flex: 0 0 auto; flex-direction: column; gap: 0; }
.pf-chosen-rm::after { content: attr(data-alt); display: block; height: 0; overflow: hidden; visibility: hidden; }
.pf-chosen-gone { display: block; font-weight: 700; color: var(--text-2); }
.pf-chosen-edit li.is-removed .pf-chosen-title { text-decoration: line-through; }
.pf-totalbox { display: flex; justify-content: space-between; align-items: baseline; background: var(--warn-bg); color: var(--warn-fg); border-radius: var(--r); padding: 12px 16px; margin: 14px 0 8px; font-weight: 700; }
.pf-totalbox b { font-size: 26px; font-variant-numeric: tabular-nums; }

/* Recap */
.pf-recap { margin: 0 0 12px; }
.pf-recap > div { display: grid; grid-template-columns: minmax(110px, 35%) 1fr; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.pf-recap dt { color: var(--text-2); }
.pf-recap dd { margin: 0; overflow-wrap: anywhere; white-space: pre-line; }
.pf-recap .pf-change { display: inline-flex; min-height: 44px; align-items: center; margin-left: 6px; }
/* The email hint that was not taken, said once more on the check step: one calm line, never a block */
.pf-check-typo { margin: 4px 0 0; color: var(--warn-fg); font-weight: 600; white-space: normal; }
@media (max-width: 380px) { .pf-recap > div { grid-template-columns: 1fr; gap: 2px; } }
/* The check step (检查一下): every row the same grid. On a phone the label is a small grey line of its
   own, the answer under it takes the width, and 更改 sits in a right column at the top of the row, so
   every 更改 lines up whatever the answer's length. From 600px the label has a column of its own. */
.pf-checklist > div { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "k act" "v act"; column-gap: 12px; row-gap: 2px; align-items: start; }
.pf-checklist dt { grid-area: k; font-size: var(--pf-small); line-height: 1.45; }
.pf-checklist dd.pf-check-val { grid-area: v; min-width: 0; }
.pf-checklist dd.pf-check-act { grid-area: act; justify-self: end; white-space: normal; }
.pf-checklist .pf-change { margin-left: 0; }
@media (min-width: 600px) {
  .pf-checklist > div { grid-template-columns: minmax(130px, 32%) minmax(0, 1fr) auto; grid-template-areas: "k v act"; column-gap: 16px; }
  .pf-checklist dt { font-size: var(--pf-body); }
}

/* Pay */
.pf-done { text-align: center; padding: 16px 0 12px; }
/* After an upload the page opens at this heading: the margin keeps the tick and the logo above it in view. */
#done-title { scroll-margin-top: 240px; }
.pf-check-disc { display: inline-flex; width: 64px; height: 64px; border-radius: 50%; background: var(--ok-bg); border: 2px solid var(--ok-dot); align-items: center; justify-content: center; margin: 4px 0 8px; }
.pf-check-disc::after { content: "\2713"; font-size: 34px; font-weight: 800; color: var(--ok-fg); }
.pf-refline { font-size: 20px; display: flex; gap: 10px; align-items: center; justify-content: center; flex-wrap: wrap; }
.pf-ref { font-size: 24px; letter-spacing: .02em; color: var(--accent-text); font-variant-numeric: tabular-nums; }
.pf-status { display: inline-block; background: var(--accent-soft); color: var(--accent-text); padding: 6px 14px; border-radius: var(--r); font-weight: 700; }
.pf-copy { min-height: 48px; min-width: 76px; padding: 0 14px; border-radius: var(--r-sm); border: 1.5px solid var(--line-accent); background: var(--accent-soft); color: var(--accent-text); font-family: inherit; font-weight: 650; font-size: var(--pf-small); line-height: 1; cursor: pointer; }
/* A press changes 复制 to 已复制 (Copied, Disalin) for 2 seconds. The button is as wide as the longer
   words from the start (an empty, unseen line with those words), so it never grows: it never wraps
   under the number and never pushes the reference beside it. */
.pf-copy::after { content: attr(data-done); display: block; height: 0; overflow: hidden; visibility: hidden; }
.pf-pay { background: var(--warn-bg); border-radius: var(--r); padding: 14px 16px; margin: 0 0 16px; }
.pf-pay-amount { margin: 0 0 6px; font-size: 30px; font-weight: 800; color: var(--warn-fg); font-variant-numeric: tabular-nums; }
.pf-pay-k { margin: 0; font-weight: 700; color: var(--warn-fg); }
.pf-pay-rows { margin: 6px 0; }
.pf-pay-rows > div { display: grid; grid-template-columns: minmax(110px, 38%) 1fr; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--warn-line); align-items: center; }
.pf-pay-rows dt { color: var(--text-2); }
.pf-pay-rows dd { margin: 0; font-weight: 700; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
/* The account number never breaks (it broke as 3203 4752 / 26 at 320px). On a narrow phone each label
   sits above its value, so the number has the whole width: with 复制 beside it from 320px, and 复制 on
   the next line at 300px, never a sideways scroll. */
.pf-acct { font-size: 22px; font-variant-numeric: tabular-nums; letter-spacing: .02em; white-space: nowrap; }
@media (max-width: 380px) { .pf-pay-rows > div { grid-template-columns: 1fr; gap: 2px; } }
.pf-pay-ref { margin: 10px 0 0; font-weight: 600; }
.pf-pay-plain { margin: 6px 0 0; }
.pf-qr { text-align: center; border: 1px solid var(--line-soft); border-radius: var(--r); padding: 14px 16px; margin: 0 0 12px; }
.pf-qr-title { margin: 0 0 10px; font-size: 20px; }
/* A plain picture people can press and hold to save: nothing may block the phone's image menu */
.pf-qr img { display: inline-block; width: 240px; height: auto; max-width: 100%; aspect-ratio: 1; image-rendering: pixelated; border: 1px solid var(--line-soft); border-radius: var(--r-sm);
  -webkit-touch-callout: default; -webkit-user-select: auto; user-select: auto; pointer-events: auto; }
.pf-qr .pf-hint { text-align: left; }

/* The receipt upload, ported from the Mesra Malaysia form: a big dashed box to take a photo or choose a
   file, then the file in its place (a small picture, its name, what is happening, 更换). Without script
   the phone's own file box shows inside the dashed box, and 上传收据 under it sends it. */
.pf-upbox { margin: 8px 0; }
.pf-drop { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 14px; min-height: 96px; padding: 14px 16px;
  background: var(--bg); border: 1.5px dashed var(--field); border-radius: var(--r); color: var(--accent-text); cursor: pointer; }
.pf-drop svg { flex: 0 0 32px; }
.pf-drop-text { flex: 1 1 0; min-width: 0; }
.pf-drop-cta { display: block; font-weight: 700; color: var(--accent-text); }
.pf-drop-types { display: block; font-size: var(--pf-small); color: var(--text-2); }
.pf-drop input { flex: 1 1 100%; min-width: 0; min-height: 44px; font-family: inherit; font-size: var(--pf-small); color: var(--text); }
.js .pf-drop input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
/* The ring for the keyboard only, like the other controls (a tap focuses the file input too). */
.pf .pf-drop:has(input:focus-visible) { border-color: var(--focus); }
.pf-filecard { display: flex; align-items: flex-start; gap: 12px; padding: 10px 12px 10px 10px; background: var(--bg); border: 1.5px solid var(--line); border-radius: var(--r); }
.pf-filecard.is-failed { border-color: var(--err-line); }
.pf-thumb { flex: 0 0 64px; width: 64px; height: 64px; border-radius: 8px; object-fit: cover; background: var(--surface); border: 1px solid var(--line-soft); }
.pf-doc { display: flex; align-items: center; justify-content: center; font-size: var(--pf-small); font-weight: 700; color: var(--accent-text); }
.pf-meta { flex: 1 1 auto; min-width: 0; }
.pf-fname { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pf-fstate { display: block; font-size: var(--pf-small); color: var(--text-2); }
.pf-filecard.is-failed .pf-fstate { color: var(--err-fg); font-weight: 700; }
.pf-acts { display: flex; gap: 18px; }
.pf-acts button { min-height: 44px; padding: 0 2px; border: 0; background: none; color: var(--link); font-family: inherit; font-size: var(--pf-small); font-weight: 600;
  text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.pf-acts button[disabled] { color: var(--disabled-fg); text-decoration: none; cursor: default; }
.pf-upload .pf-err { margin: 0 0 8px; }
.pf-upload-retry { margin: 0 0 10px; }
.pf-upload .pf-btn-block { margin-top: 10px; }
.pf-upload-retry .pf-btn-block { margin-top: 0; }
.pf-later-note .pf-resume { background: var(--surface-2); border: 1px dashed var(--line); border-radius: var(--r-sm); padding: 10px 12px; overflow-wrap: anywhere; font-size: var(--pf-small); }
.pf-steps-list { margin: 0 0 12px; padding-left: 22px; }
.pf-steps-list li { margin: 0 0 6px; }
.pf-another { margin: 12px 0 18px; }
.pf-another > summary { min-height: 48px; display: flex; align-items: center; color: var(--link); font-weight: 600; cursor: pointer; }

/* Cloudflare Turnstile (only when the spam check is on). The compact widget is 150 by 140,
   so it fits a 320px phone, and the space is kept so the buttons do not jump when it loads. */
.pf-turnstile { min-height: 140px; }

/* Footer */
.pf-foot { border-top: 8px solid var(--bg); padding: 18px 16px 28px; font-size: var(--pf-small); color: var(--text-2); }
.pf-foot p { margin: 0 0 8px; }
.pf-foot-name { font-weight: 700; color: var(--text); }
.pf-foot-links { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.pf-foot a { display: inline-flex; min-height: 44px; align-items: center; }
@media (min-width: 680px) { .pf-foot { padding: 20px 28px 28px; } }

/* Script-only parts stay hidden until the script runs. Without script the whole form shows at once. */
.js-only { display: none; }
.js .js-only { display: block; }
.js .pf-bar-sum.js-only { display: flex; }
.js .nojs-only { display: none; }
.js .pf-nav.js-only { display: flex; }
.js .pf-section[data-step]:not(.is-current) { display: none; }
.js [data-show-if].is-hidden { display: none; }

@media print {
  .pf-bar, .pf-langs, .pf-upload, .pf-another, .pf-wa, .pf-pick, .pf-search { display: none !important; }
  .pf-page { padding: 0; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }

/* Page numbers under the past classes (PfPager). */
.pf-pager { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 16px 0 20px; }
.pf-pager-num, .pf-pager-step { display: inline-flex; align-items: center; justify-content: center; min-width: 48px; min-height: 48px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); color: var(--text); font-weight: 600; text-decoration: none; }
.pf-pager-num.is-current { background: var(--accent-text); border-color: var(--accent-text); color: var(--surface); }
.pf-pager-gap { display: inline-flex; align-items: center; min-height: 48px; padding: 0 2px; color: var(--text-2); }
