/* EsYen owner's guide: plain pages, the apps' cream and blue, readable from a phone up.
   Source: design/help/build/help.css (build.py copies it to customer/public/help/help.css). */
:root {
  --paper: #F4F3EF;
  --card: #FFFFFF;
  --ink: #14130F;
  --ink2: #4A4740;
  --ink3: #7A766D;
  --line: #E4E1D9;
  --blue: #B5573A; /* EsYen terracotta (owner, 2026-11-22: "ทำให้เป็นสีของเราด้วย"); the name is kept */
  --blue-soft: #FBEDE8;
  --toc-w: 260px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 76px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.65 'Noto Sans Thai', system-ui, -apple-system, 'Leelawadee UI', Thonburi, sans-serif;
}
/* English pages: Latin face first; the Thai button names in quotes fall back to Noto Sans Thai */
html[lang="en"] body { font-family: 'Noto Sans', 'Noto Sans Thai', system-ui, -apple-system, 'Segoe UI', 'Leelawadee UI', Thonburi, sans-serif; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
b, strong { font-weight: 600; }

/* top bar */
.top {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  height: 60px; padding: 0 16px;
  background: rgba(244, 243, 239, .94); backdrop-filter: saturate(1.2) blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; color: var(--ink); font-weight: 700; font-size: 19px; }
.brand:hover { text-decoration: none; }
.brand em { font-style: normal; font-weight: 600; font-size: 15px; color: var(--ink3); padding-left: 10px; border-left: 1px solid var(--line); margin-left: 4px; }
.home { font-size: 15px; font-weight: 600; }
.top-r { display: flex; align-items: center; gap: 16px; }
.lang { display: flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 600; }
.lang a { color: var(--ink3); padding: 8px 2px; }
.lang a.on { color: var(--ink); }
.lang span { color: var(--line); }

/* layout */
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 16px; display: grid; grid-template-columns: 1fr; }
main { min-width: 0; padding: 20px 0 40px; }

/* contents: a top list on phones, a left column on wide screens */
.toc { margin: 16px 0 0; }
.toc details { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 4px 8px; }
.toc summary { cursor: pointer; padding: 10px 8px; font-weight: 600; font-size: 16px; list-style: none; }
.toc summary::-webkit-details-marker { display: none; }
.toc summary::after { content: '▾'; float: right; color: var(--ink3); }
.toc details[open] summary::after { content: '▴'; }
.toc ol { list-style: none; margin: 0 0 8px; padding: 0; }
.toc li a { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 10px; color: var(--ink2); font-size: 15.5px; line-height: 1.35; }
.toc li a:hover { background: var(--paper); text-decoration: none; }
.toc li a.on { background: var(--blue-soft); color: var(--blue); font-weight: 600; }
.cn { flex: none; display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 24px; padding: 0 4px; border-radius: 8px; background: var(--paper); color: var(--ink3); font-size: 12.5px; font-weight: 700; }
.on .cn { background: var(--blue); color: #fff; }

@media (min-width: 901px) {
  .wrap { grid-template-columns: var(--toc-w) minmax(0, 1fr); gap: 36px; }
  .toc { position: sticky; top: 76px; align-self: start; max-height: calc(100vh - 92px); overflow: auto; margin-top: 24px; }
  .toc details { background: transparent; border: 0; padding: 0; }
  .toc summary { pointer-events: none; padding: 4px 8px 10px; color: var(--ink3); font-size: 13.5px; }
  .toc summary::after, .toc details[open] summary::after { content: ''; }
  main { padding-top: 28px; }
}

/* text */
h1 { font-size: 32px; line-height: 1.3; margin: 4px 0 6px; }
h2 { font-size: 24px; line-height: 1.35; margin: 44px 0 14px; padding-top: 4px; }
h3 { display: flex; align-items: flex-start; gap: 10px; font-size: 19px; line-height: 1.45; margin: 0 0 12px; }
.lead { font-size: 18px; color: var(--ink2); margin: 0 0 18px; }
.crumb { margin: 0; font-size: 14.5px; color: var(--ink3); }
.sn { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; margin-top: -1px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 15px; font-weight: 700; }
.inthis { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px 18px; font-size: 16px; }
.inthis ul { margin: 6px 0 0; padding-left: 20px; columns: 2; column-gap: 28px; }
.inthis li { break-inside: avoid; }

/* a step: heading, screenshot, a few short lines */
.step { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 18px; margin: 0 0 16px; }
.lines p { margin: 6px 0 0; color: var(--ink2); }
.lines p:first-child { margin-top: 0; }
.m { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; margin: 0 1px; border-radius: 50%; background: var(--blue); color: #fff; font-size: 13px; font-weight: 700; line-height: 1; vertical-align: 1px; box-shadow: 0 0 0 2px #fff; }

/* screenshots */
.shot { margin: 0 0 14px; }
.shot .zoom { display: block; width: 100%; padding: 0; margin: 0; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: var(--paper); cursor: zoom-in; font: inherit; -webkit-tap-highlight-color: transparent; }
.shot .zoom:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.shot img { display: block; width: 100%; height: auto; max-width: 100%; }
.shot.mid .zoom { max-width: 640px; }
.shot.narrow .zoom { max-width: 460px; }
.shot.phone .zoom { max-width: 446px; }

/* the picture viewer (build.py LIGHTBOX): over the page, also inside the shop app's sheet */
html.lb-on, html.lb-on body { overflow: hidden; }
.lb { position: fixed; inset: 0; z-index: 1000; display: flex; background: rgba(14, 13, 11, .94); }
.lb[hidden] { display: none; }
.lb-scroll { flex: 1; display: flex; align-items: center; justify-content: center; overflow: auto; padding: 68px 12px 16px; -webkit-overflow-scrolling: touch; touch-action: pan-x pan-y pinch-zoom; overscroll-behavior: contain; }
.lb-scroll img { display: block; max-width: 100%; max-height: calc(100vh - 84px); width: auto; height: auto; border-radius: 10px; background: #fff; cursor: zoom-in; }
.lb.big .lb-scroll { display: block; }
.lb.big .lb-scroll img { max-width: none; max-height: none; height: auto; margin: 0 auto; cursor: zoom-out; }
.lb-close { position: fixed; top: 12px; right: 12px; z-index: 1001; display: inline-flex; align-items: center; gap: 6px; min-width: 44px; height: 48px; padding: 0 18px; border: 0; border-radius: 24px; background: #fff; color: var(--ink); font: 600 17px/1 inherit; font-family: inherit; cursor: pointer; box-shadow: 0 4px 18px rgba(0, 0, 0, .35); }
.lb-close span { font-size: 26px; line-height: 1; margin-top: -2px; }
.lb-close:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }

/* start path on the index */
.path { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; counter-reset: p; }
.path a, .cards a { display: flex; flex-direction: column; gap: 2px; height: 100%; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 16px; color: var(--ink); }
.path a:hover, .cards a:hover { border-color: var(--blue); text-decoration: none; }
.path b, .cards b { font-size: 18px; }
.path small, .cards small { color: var(--ink3); font-size: 14.5px; line-height: 1.45; }
.pn { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; background: var(--blue); color: #fff; font-weight: 700; margin-bottom: 6px; }
.path li { position: relative; }
.startpath + .shot { margin-top: 18px; }
.cards { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.cards .cn { margin-bottom: 6px; background: var(--blue-soft); color: var(--blue); }
.note .lines { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 16px 18px; }

/* questions */
.faq { background: var(--card); border: 1px solid var(--line); border-radius: 16px; margin: 0 0 10px; padding: 0 18px; }
.faq summary { cursor: pointer; padding: 14px 0; font-weight: 600; }
.faq p { margin: 0 0 14px; color: var(--ink2); }

/* previous / next */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 40px; }
.pager a { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; font-weight: 600; font-size: 17px; }
.pager a:hover { border-color: var(--blue); text-decoration: none; }
.pager small { color: var(--ink3); font-weight: 400; font-size: 14px; }
.pager .next { text-align: right; }

.foot { max-width: 1240px; margin: 0 auto; padding: 24px 16px 40px; color: var(--ink3); font-size: 14.5px; border-top: 1px solid var(--line); }
.foot p { margin: 4px 0; }

@media (max-width: 900px) {
  .index .toc { display: none; }
}

@media (max-width: 600px) {
  .top-r { gap: 12px; }
  body { font-size: 16.5px; }
  h1 { font-size: 27px; }
  h2 { font-size: 21.5px; margin-top: 36px; }
  h3 { font-size: 17.5px; }
  .step { padding: 14px; border-radius: 18px; }
  .inthis ul { columns: 1; }
  .brand em { display: none; }
}

/* ?embed=1: the chapter alone, inside the shop app's side sheet (iframe or WebView) */
html.embed { scroll-padding-top: 12px; }
html.embed .top, html.embed .toc, html.embed .crumb, html.embed .lead, html.embed .inthis, html.embed .pager, html.embed .foot { display: none; }
html.embed .wrap { display: block; max-width: none; padding: 0 16px; }
html.embed main { padding: 16px 0 32px; }
html.embed h1 { font-size: 24px; margin-top: 0; }
html.embed h2 { font-size: 20px; margin-top: 32px; }
html.embed .step { padding: 14px; border-radius: 16px; }

/* Two picture sets (build.py VIEW): html[data-view] is "pad" (an iPad or a computer) or "phone" (a phone held
   upright). What belongs to the other set is not drawn, and its pictures are lazy, so they are never fetched. */
html[data-view="pad"] .v-phone, html[data-view="pad"] .only-phone,
html[data-view="phone"] .v-pad, html[data-view="phone"] .only-pad { display: none !important; }
/* the number in front of a step counts the steps this set shows */
main section { counter-reset: step; }
.step { counter-increment: step; }
.step .sn::before { content: counter(step); }
.view { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 14px 0 6px; font-size: 14.5px; color: #5d5a54; }
.view span { margin-right: 4px; }
.view button { font: inherit; font-weight: 600; min-height: 40px; padding: 0 16px; border-radius: 20px; border: 1.5px solid #d9d5cc; background: #fff; color: #2b2925; cursor: pointer; }
.view button[aria-pressed="true"] { background: #15130f; border-color: #15130f; color: #fff; }
.view button:focus-visible { outline: 3px solid #E5AE9C; outline-offset: 2px; }
