/* ---------- Form kit (js/form-kit.js). Prefix fk-. ----------
   The shared look for submission forms, taken from Report a price (css/report-price.css): a card with a pastel banner,
   numbered sections, 48px fields with labels above, hints and errors under the field, pills for choices, one full-width
   48px submit at the end, and one "Sent for review" screen. Used by #/suggest/<type> and #/correct/<type>/<id>.
   The side column ("What happens next", tips) shows from 840px of page width: a container query on .fk-wrap, as for
   Report a price, so the app sidebar is allowed for. */

.fk-wrap { container-type: inline-size; container-name: fk; }
.fk-screen { padding-bottom: 40px; display: flex; flex-direction: column; gap: 12px; }
.fk-grid { display: block; }
.fk-aside { display: none; }

.fk-back {
  align-self: flex-start; max-width: 100%; min-height: 44px; display: inline-flex; align-items: center; gap: 6px;
  color: var(--brand-text); font-size: 15px; font-weight: 600; text-decoration: none;
}
.fk-back span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fk-back:hover span { text-decoration: underline; }

.fk-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.fk-banner { padding: 16px 20px; background: var(--banner-gradient); color: var(--banner-title); }
.fk-title { margin: 0 0 2px; font-size: 20px; font-weight: 600; line-height: 1.3; color: var(--banner-title); }
.fk-banner p { margin: 0; font-size: 14px; line-height: 1.45; color: var(--banner-title); }
.fk-body { padding: 16px; display: flex; flex-direction: column; gap: 16px; }

.fk-form { display: flex; flex-direction: column; gap: 24px; }
.fk-section { border: 0; margin: 0; padding: 0; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.fk-legend { padding: 0 0 10px; font-size: 13px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.fk-optional { text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--text-muted); }

.fk-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.fk-label { font-size: 14px; font-weight: 600; color: var(--text); }
.fk-label .fk-optional { font-size: 14px; }
.fk-field input[type="text"], .fk-field input[type="email"], .fk-field input[type="number"], .fk-field input[type="tel"], .fk-field input[type="search"], .fk-field input[type="url"], .fk-field input:not([type]),
.fk-field select, .fk-field textarea, .fk-add input {
  width: 100%; box-sizing: border-box; min-height: 48px; padding: 0 14px; border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--surface); color: var(--text); font: inherit; font-size: 16px;
}
.fk-field textarea { padding: 12px 14px; line-height: 1.45; resize: vertical; min-height: 96px; }
.fk-field input:focus, .fk-field select:focus, .fk-field textarea:focus, .fk-add input:focus { outline: 0; border-color: var(--focus-ring); box-shadow: 0 0 0 2px var(--focus-ring); }
.fk-field [aria-invalid="true"] { border-color: var(--danger-text); border-width: 1.5px; }
.fk-hint { font-size: 13px; line-height: 1.45; color: var(--text-muted); }
.fk-hint:empty { display: none; }
.fk-now { font-size: 14px; color: var(--text-muted); }
.fk-error { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--danger-text); }
.fk-error svg { flex: none; }

.fk-link {
  align-self: flex-start; position: relative; border: 0; background: transparent; padding: 0; color: var(--brand-text);
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
}
.fk-link:hover { text-decoration: underline; }
.fk-link::after { content: ""; position: absolute; inset: -12px -6px; } /* 44px tap area */
.fk-btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
.fk-btn { min-height: 44px; border-radius: 999px; font-size: 14px; }
.fk-btn-row .fk-btn { flex: 1 1 140px; }

.fk-map { height: 220px; border-radius: var(--radius-lg); border: 1px solid var(--border); overflow: hidden; }
.fk-pin-row { margin-bottom: 0; }
.fk-pin-row input { min-height: 48px; }

/* Pills: a real checkbox or radio inside, kept in the tab order, drawn as a pill. */
.fk-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.fk-pill { position: relative; display: inline-flex; cursor: pointer; }
.fk-pill input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.fk-pill span {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; box-sizing: border-box;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text); font-size: 14px; font-weight: 600;
}
.fk-pill input:checked + span { background: var(--brand-tint); border-color: var(--brand-text); color: var(--brand-text); }
.fk-pill input:checked + span::before { content: "✓"; font-weight: 700; }
.fk-pill input:focus-visible + span { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.fk-pill input[aria-invalid="true"] + span { border-color: var(--danger-text); }

/* Removable chips (the correction form's categories) and the add-a-category row. */
.fk-chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 12px 0 14px; border: 1px solid var(--brand-text);
  border-radius: 999px; background: var(--brand-tint); color: var(--brand-text); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
}
.fk-chip:hover { background: var(--surface); }
.fk-add { display: flex; gap: 8px; }
.fk-add input { flex: 1; min-width: 0; }
.fk-add .fk-btn { flex: none; padding: 0 18px; }

/* Choice cards with a line of explanation (market / mall / plaza). */
.fk-options { display: flex; flex-direction: column; gap: 8px; }
.fk-option { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-lg); cursor: pointer; }
.fk-option input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--brand); flex: none; }
.fk-option > span { display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.fk-option > span > span { color: var(--text-muted); line-height: 1.4; }
.fk-option:has(input:checked) { border-color: var(--brand-text); background: var(--brand-tint); }

/* The market picker's list and chosen market. */
.fk-picker-list .location-option { min-height: 48px; }
.fk-chosen { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 8px 12px 8px 8px; box-sizing: border-box; border: 1px solid var(--border); border-radius: var(--radius-lg); }
.fk-chosen > span { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.fk-chosen strong { font-size: 15px; }
.fk-chosen > span > span { font-size: 13px; color: var(--text-muted); }
.fk-chosen .fk-link { align-self: center; }
.fk-avatar { flex: none; width: 40px; height: 40px; border-radius: 999px; background: var(--brand); color: var(--on-brand); font-weight: 700; font-size: 15px; display: flex; align-items: center; justify-content: center; }

/* "This looks like something we already have" (warn, never block). */
.fk-warning { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; border-radius: var(--radius-lg); background: var(--warning-bg); color: var(--warning-text); }
.fk-warning p { margin: 0; font-size: 14px; line-height: 1.45; }
.fk-match { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 8px 10px; box-sizing: border-box; border-radius: 10px; background: var(--surface); color: var(--text); text-decoration: none; }
.fk-match .fk-avatar { width: 36px; height: 36px; font-size: 13px; }
.fk-match > span:nth-child(2) { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.fk-match strong { font-size: 14px; }
.fk-match > span:nth-child(2) > span { font-size: 13px; color: var(--text-muted); }
.fk-match-view { flex: none; font-size: 13px; font-weight: 600; color: var(--brand-text); }
.fk-warning .fk-btn { align-self: stretch; background: var(--surface); }

.fk-form-error { padding: 12px 14px; border-radius: var(--radius-lg); background: var(--danger-bg); color: var(--danger-text); font-size: 14px; line-height: 1.45; }
.fk-form-error[hidden] { display: none; }
.fk-submit { width: 100%; min-height: 48px; font-size: 16px; }

/* Steps ("What happens next") and the side panels. */
.fk-steps { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 12px; text-align: left; }
.fk-steps li { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; line-height: 1.45; }
.fk-steps li > span:last-child { display: flex; flex-direction: column; }
.fk-steps li > span:last-child > span { color: var(--text-muted); }
.fk-step-num { flex: none; width: 28px; height: 28px; border-radius: 999px; background: var(--brand-tint); color: var(--brand-text); font-size: 14px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.fk-step-reward { background: var(--warning-bg); color: var(--warning-text); }
.fk-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.fk-panel h2 { margin: 0; font-size: 16px; font-weight: 700; }
.fk-tips { margin: 0; padding-left: 18px; font-size: 14px; line-height: 1.5; color: var(--text-muted); display: flex; flex-direction: column; gap: 4px; }

/* "Sent for review". */
.fk-done { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 28px 20px 20px; text-align: center; }
.fk-done-icon { width: 64px; height: 64px; border-radius: 999px; display: flex; align-items: center; justify-content: center; }
.fk-done-success { background: var(--success-bg); color: var(--success-text); }
.fk-done-title { margin: 0; font-size: 24px; font-weight: 700; letter-spacing: -0.02em; }
.fk-done-title:focus { outline: none; }
.fk-done-lead { margin: 0; font-size: 15px; line-height: 1.5; color: var(--text-muted); }
.fk-summary { align-self: stretch; display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-lg); text-align: left; }
.fk-summary > span { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.fk-summary strong { font-size: 15px; overflow-wrap: anywhere; }
.fk-summary > span > span { font-size: 13px; color: var(--text-muted); }
.fk-done .fk-steps { align-self: stretch; margin-top: 4px; }
.fk-done-actions { align-self: stretch; display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.fk-secondary { width: 100%; min-height: 48px; display: flex; align-items: center; justify-content: center; box-sizing: border-box; font-size: 15px; }

/* ---------- Pass B additions: stepper, two-up fields, button pills, review box, notices, claim ---------- */
.fk-lead { margin: 0; font-size: 15px; line-height: 1.5; color: var(--text-muted); }
.fk-stepper { margin: 0 0 4px; padding: 0 0 14px; list-style: none; display: flex; gap: 6px; border-bottom: 1px solid var(--border); }
.fk-stepper li { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text-muted); }
.fk-stepper .fk-stepper-now { color: var(--text); font-weight: 700; }
.fk-stepper-dot { flex: none; width: 24px; height: 24px; border-radius: 999px; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; background: var(--surface-2); color: var(--text-muted); }
.fk-stepper-done .fk-stepper-dot { background: var(--success-bg); color: var(--success-text); }
.fk-stepper-now .fk-stepper-dot { background: var(--brand); color: var(--on-brand); }
.fk-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.fk-two > .fk-field { min-width: 0; }
.fk-two select { min-height: 48px; }
.fk-pill-btn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; box-sizing: border-box;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text);
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
}
.fk-pill-btn.active { background: var(--brand-tint); border-color: var(--brand-text); color: var(--brand-text); }
.fk-pill-btn.active::before { content: "✓"; font-weight: 700; }
.fk-pill-btn:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.fk-actions { flex-direction: column; }
.fk-actions .fk-btn { flex: none; min-height: 48px; border-radius: var(--radius-lg); font-size: 15px; }
.fk-review { border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 14px; }
.fk-review-sum { margin: 0 0 8px; font-size: 14px; font-weight: 600; color: var(--text-muted); }
.fk-notice { margin: 0; padding: 12px 14px; border-radius: var(--radius-lg); background: var(--surface-2); font-size: 14px; line-height: 1.45; }
.fk-notice p { margin: 0 0 4px; }
.fk-notice p:last-child { margin: 0; }
.fk-store-chip { margin-bottom: 4px; }
.fk-claim-status { margin-top: 14px; }
.fk-perks { display: flex; flex-direction: column; gap: 10px; }
.fk-perks .fk-legend { padding: 0; }
.fk-perks ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.fk-perks li { position: relative; padding-left: 38px; min-height: 28px; display: flex; align-items: center; font-size: 14px; line-height: 1.45; }
.fk-perks li::before {
  content: "✓"; position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 999px;
  background: var(--brand-tint); color: var(--brand-text); font-weight: 700; font-size: 14px; display: flex; align-items: center; justify-content: center;
}
.fk-fineprint { margin: 0; font-size: 13px; line-height: 1.45; color: var(--text-muted); text-align: center; }
.fk-done-compact { padding: 8px 0 0; }
.fk-done-compact .fk-done-icon { width: 52px; height: 52px; }
.fk-done-compact .fk-done-title { font-size: 20px; }

@container fk (min-width: 840px) {
  .fk-screen { max-width: 996px; margin: 0 auto; }
  .fk-grid { display: grid; grid-template-columns: minmax(0, 620px) 300px; gap: 24px; justify-content: center; align-items: start; }
  .fk-aside { display: flex; flex-direction: column; gap: 14px; position: sticky; top: calc(var(--topbar-h, 96px) + 12px); }
  .fk-aside[hidden] { display: none; }
  .fk-body { padding: 20px; }
  .fk-map { height: 260px; }
  .fk-card-done { grid-column: 1 / -1; max-width: 560px; justify-self: center; width: 100%; }
}
EOF
node scripts/check.js | tail -1