/* คู่มือการใช้งาน (/help) — public, Thai, read on a phone as often as a desktop.
   Layered on top of style.css; only this page uses it. */

.help-wrap {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 16px 4rem;
}

.help-hero {
  text-align: center;
  padding: 1.5rem 0 1rem;
}

.help-hero .page-logo { margin-bottom: 0.75rem; }

.help-hero h1 {
  font-size: 1.7rem;
  color: var(--primary);
  margin: 0 0 0.35rem;
  text-wrap: balance;
}

.help-hero p {
  color: var(--muted);
  margin: 0;
  line-height: 1.7;
}

.help-updated {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.75rem;
}

/* Jump nav — horizontally scrollable on a phone rather than wrapping to
   four ragged lines. */
.help-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  padding: 0.6rem 0;
  margin-bottom: 1.25rem;
  background: var(--bg, #f1f5f9);
  border-bottom: 1px solid #e2e8f0;
  scrollbar-width: none;
}
.help-nav::-webkit-scrollbar { display: none; }

.help-nav a {
  flex: 0 0 auto;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #e2e8f0;
  color: var(--text, #0f172a);
  text-decoration: none;
  font-size: 0.9rem;
  white-space: nowrap;
}
.help-nav a:hover { border-color: var(--primary); color: var(--primary); }

.help-section {
  background: #fff;
  border-radius: 14px;
  padding: 1.35rem 1.25rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
  scroll-margin-top: 4.5rem;
}

.help-section > h2 {
  font-size: 1.3rem;
  color: var(--primary);
  margin: 0 0 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-wrap: balance;
}

.help-role-who {
  color: var(--muted);
  line-height: 1.75;
  margin: 0 0 1rem;
}

.help-section h3 {
  font-size: 1.02rem;
  margin: 1.4rem 0 0.6rem;
  padding-bottom: 0.35rem;
  border-bottom: 2px solid #eef2f7;
}

/* The flow strip. Blocks, not colour alone — it prints and photocopies. */
.help-flow {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: stretch;
  margin: 0.5rem 0 0.25rem;
}

.help-step {
  flex: 1 1 150px;
  min-width: 150px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.7rem 0.75rem;
  background: #fbfdfc;
}

.help-step .who {
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  background: var(--primary);
  border-radius: 999px;
  padding: 0.1rem 0.55rem;
  display: inline-block;
  margin-bottom: 0.35rem;
}

.help-step .what { font-weight: 700; display: block; margin-bottom: 0.2rem; }
.help-step .sub { font-size: 0.83rem; color: var(--muted); line-height: 1.5; }

.help-step.is-end { border-style: dashed; background: #f8fafc; }
.help-step.is-end .who { background: #64748b; }

.help-steps-list { margin: 0; padding-left: 1.3rem; line-height: 1.85; }
.help-steps-list li { margin-bottom: 0.35rem; }
.help-steps-list strong { color: var(--primary); }

.help-kbd {
  display: inline-block;
  border: 1px solid #cbd5e1;
  border-bottom-width: 2px;
  border-radius: 6px;
  padding: 0.05rem 0.45rem;
  background: #f8fafc;
  font-size: 0.92em;
  white-space: nowrap;
}

figure.help-shot { margin: 1rem 0 0.5rem; }

figure.help-shot img {
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
}

figure.help-shot figcaption {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.4rem;
  text-align: center;
  line-height: 1.6;
}

/* Phone-shaped screens stay phone-shaped instead of stretching to 900px. */
figure.help-shot.narrow img { max-width: 340px; margin: 0 auto; }

.help-note,
.help-warn {
  border-radius: 10px;
  padding: 0.75rem 0.9rem;
  margin: 0.9rem 0;
  line-height: 1.7;
  font-size: 0.94rem;
}
.help-note { background: #eff6ff; border-left: 4px solid #3b82f6; }
.help-warn { background: #fef3c7; border-left: 4px solid #d97706; }
/* ONLY the callout's leading title goes block. This was a descendant
   selector (`.help-warn strong`), so it also caught every inline <strong>
   mid-sentence in the bullet lines and broke each one onto its own line,
   leaving the bullet stranded above its text. Same bug DESIGN.md records
   from yoku-one's `.help-rule strong`. Every callout opens with its title,
   so :first-child is the discriminator. */
.help-note > strong:first-child,
.help-warn > strong:first-child { display: block; margin-bottom: 0.2rem; }

.help-table-wrap { overflow-x: auto; margin: 0.75rem 0; }

table.help-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  min-width: 520px;
}

table.help-table th,
table.help-table td {
  border: 1px solid #e2e8f0;
  padding: 0.5rem 0.6rem;
  text-align: left;
  vertical-align: top;
  line-height: 1.6;
}

table.help-table th { background: #f1f5f9; font-weight: 700; white-space: nowrap; }
table.help-table td:first-child { white-space: nowrap; font-weight: 600; }

.help-pill {
  display: inline-block;
  border-radius: 999px;
  padding: 0.1rem 0.5rem;
  font-size: 0.78rem;
  font-weight: 700;
  border: 1px solid transparent;
}
.help-pill.open { background: #fef3c7; color: #92400e; border-color: #fcd34d; }
.help-pill.done { background: #dcfce7; color: #166534; border-color: #86efac; }

details.help-faq {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.65rem 0.85rem;
  margin-bottom: 0.5rem;
  background: #fff;
}
details.help-faq > summary {
  cursor: pointer;
  font-weight: 600;
  line-height: 1.6;
}
details.help-faq[open] > summary { color: var(--primary); margin-bottom: 0.5rem; }
details.help-faq p { margin: 0.35rem 0; line-height: 1.8; color: #334155; }

dl.help-glossary { margin: 0; }
dl.help-glossary dt { font-weight: 700; margin-top: 0.8rem; color: var(--primary); }
dl.help-glossary dd { margin: 0.2rem 0 0; line-height: 1.75; color: #334155; }

.help-foot {
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  padding: 1.5rem 0 0;
  line-height: 1.8;
}

@media (max-width: 480px) {
  .help-hero h1 { font-size: 1.35rem; }
  .help-section { padding: 1.1rem 0.9rem; }
  .help-step { min-width: 100%; }
}

@media print {
  .help-nav { display: none; }
  .help-section { box-shadow: none; border: 1px solid #ddd; break-inside: avoid; }
  details.help-faq { break-inside: avoid; }
  details.help-faq > summary::marker { content: ""; }
  details.help-faq p { display: block !important; }
}
