/* Help center, on top of /styles.css (fonts, tokens, .btn, .logo). Khmer reads best a little
   larger than Latin with tall lines: its stacked vowels and subscripts need the room. */
:root {
  --header-h: 64px;
  --tint: #e8f2fc;
  --side-w: 280px;
  --toc-w: 220px;
}

.help { background: var(--bg); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 200; padding: 8px 14px; border-radius: 8px; background: #fff; color: var(--ink); font-weight: 600; }
.skip:focus { top: 12px; }
body.drawer-open, body.search-open, body.zoom-open { overflow: hidden; }

/* Header */
.help-header { position: sticky; top: 0; z-index: 60; background: var(--navy); color: #fff; box-shadow: 0 1px 0 rgba(255, 255, 255, .08); }
.hh-inner { display: flex; align-items: center; gap: 20px; max-width: 1440px; height: var(--header-h); margin: 0 auto; padding: 0 24px; }
.hh-logo { flex: none; }
.hh-title { margin-left: 4px; padding-left: 12px; border-left: 1px solid rgba(255, 255, 255, .22); font-family: var(--font); font-weight: 500; font-size: .95rem; letter-spacing: 0; color: rgba(255, 255, 255, .82); }
.hh-links { display: flex; align-items: center; gap: 20px; margin-left: auto; flex: none; }
.hh-links > a:not(.btn) { color: rgba(255, 255, 255, .75); font-size: .92rem; font-weight: 500; }
.hh-links > a:not(.btn):hover { color: #fff; }
.hh-icon { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 10px; background: none; color: inherit; cursor: pointer; flex: none; }
.hh-icon:hover { background: rgba(255, 255, 255, .08); }
.hh-icon .icon { width: 22px; height: 22px; }
.hh-menu, .hh-search-open { display: none; }
.lang-switch { display: inline-flex; align-items: center; gap: 8px; font-size: .9rem; }
.lang-switch .icon { width: 16px; height: 16px; opacity: .7; }
.lang-switch [aria-current] { font-weight: 600; }
.hh-links .lang-switch a { color: rgba(255, 255, 255, .75); }

/* Search */
.search { position: relative; }
.search-top { flex: 1; max-width: 520px; margin: 0 auto; }
.search input { width: 100%; height: 40px; padding: 0 40px 0 42px; border: 1px solid rgba(255, 255, 255, .16); border-radius: 999px; background: rgba(255, 255, 255, .08); color: #fff; font: inherit; font-size: .95rem; outline: none; -webkit-appearance: none; appearance: none; transition: background-color .15s, border-color .15s; }
.search input::placeholder { color: rgba(255, 255, 255, .55); }
.search input::-webkit-search-cancel-button { display: none; }
.search input:focus { background: #fff; color: var(--ink); border-color: #fff; }
.search input:focus::placeholder { color: var(--muted); }
.search-icon { position: absolute; left: 14px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); color: rgba(255, 255, 255, .6); pointer-events: none; }
.search:focus-within .search-icon { color: var(--muted); }
.search-key { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); min-width: 22px; padding: 1px 6px; border: 1px solid rgba(255, 255, 255, .25); border-radius: 6px; font: 600 .75rem/1.5 var(--font); text-align: center; color: rgba(255, 255, 255, .6); pointer-events: none; }
.search:focus-within .search-key { display: none; }
.search-cancel { display: none; }
.search-results { position: absolute; z-index: 70; top: calc(100% + 8px); left: 0; right: 0; max-height: min(70vh, 560px); overflow-y: auto; padding: 6px; border-radius: 16px; background: #fff; color: var(--ink); box-shadow: 0 0 0 1px rgba(10, 27, 51, .06), 0 24px 60px -12px rgba(10, 27, 51, .35); text-align: left; }
.search-results[hidden] { display: none; }
.sr-item { display: block; padding: 10px 14px; border-radius: 10px; color: var(--ink); line-height: 1.5; }
.sr-item.is-active, .sr-item:hover { background: var(--tile); }
.sr-sec { display: block; font-size: .78rem; font-weight: 600; color: var(--muted); }
.sr-title { display: block; font-weight: 600; font-size: .98rem; }
.sr-snip { display: block; margin-top: 2px; font-size: .88rem; color: var(--slate); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.lang-km .sr-item { line-height: 1.75; }
.search mark { padding: 0 1px; border-radius: 3px; background: #ffe58a; color: inherit; }
.sr-empty { padding: 18px 14px; color: var(--slate); font-size: .93rem; }
.sr-empty strong { display: block; color: var(--ink); margin-bottom: 4px; }
.sr-empty a { color: var(--blue-dark); text-decoration: underline; }

/* Shell: sidebar, article, on this page */
.help-shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); max-width: 1440px; margin: 0 auto; }
.help-shell.has-toc { grid-template-columns: var(--side-w) minmax(0, 1fr) var(--toc-w); }
.help-sidebar { position: sticky; top: var(--header-h); align-self: start; height: calc(100vh - var(--header-h)); overflow-y: auto; padding: 24px 14px 40px 20px; border-right: 1px solid var(--line); overscroll-behavior: contain; }
.drawer-head, .drawer-links, .drawer-backdrop { display: none; }
.side-sec summary { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; font-weight: 600; font-size: .94rem; line-height: 1.4; color: var(--ink); cursor: pointer; list-style: none; -webkit-user-select: none; user-select: none; }
.side-sec summary::-webkit-details-marker { display: none; }
.side-sec summary:hover { background: var(--tile); }
.side-sec .sec-icon { width: 18px; height: 18px; color: var(--blue); }
.side-sec .chev { width: 16px; height: 16px; margin-left: auto; color: var(--muted); transition: transform .15s; }
.side-sec[open] .chev { transform: rotate(180deg); }
.side-sec ul { margin: 2px 0 10px; }
.side-sec li a { display: block; padding: 6px 10px 6px 38px; border-radius: 8px; color: var(--slate); font-size: .9rem; line-height: 1.5; }
.side-sec li a:hover { background: var(--tile); color: var(--ink); }
.side-sec li a[aria-current] { background: var(--tint); color: var(--blue-dark); font-weight: 600; }
.lang-km .side-sec summary, .lang-km .side-sec li a { line-height: 1.7; }

.help-main { width: 100%; max-width: 840px; margin: 0 auto; padding: 28px 56px 72px; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: .88rem; color: var(--muted); }
.crumbs a { color: var(--slate); }
.crumbs a:hover { color: var(--ink); }
.crumbs .icon { width: 14px; height: 14px; }

.help-toc { position: sticky; top: var(--header-h); align-self: start; max-height: calc(100vh - var(--header-h)); overflow-y: auto; padding: 36px 24px 24px 8px; font-size: .86rem; }
.help-toc p { margin-bottom: 10px; font-weight: 600; color: var(--ink); }
.help-toc a { display: block; padding: 4px 0 4px 12px; border-left: 2px solid var(--line); color: var(--slate); line-height: 1.5; }
.help-toc a:hover { color: var(--ink); }
.help-toc a.is-active { border-left-color: var(--blue); color: var(--blue-dark); font-weight: 600; }
.lang-km .help-toc a { line-height: 1.7; }

/* Article */
.prose { font-size: 1.03rem; line-height: 1.75; color: #1e2c3d; }
.lang-km .prose { font-size: 1.08rem; line-height: 1.9; }
.prose h1 { margin: 10px 0 22px; font-size: 2.1rem; line-height: 1.25; color: var(--ink); }
.lang-km .prose h1 { font-size: 1.85rem; line-height: 1.55; }
.prose h2 { margin: 2.2em 0 .6em; font-size: 1.42rem; line-height: 1.35; color: var(--ink); scroll-margin-top: calc(var(--header-h) + 20px); }
.prose h3 { margin: 1.7em 0 .5em; font-size: 1.14rem; line-height: 1.4; color: var(--ink); letter-spacing: -0.01em; scroll-margin-top: calc(var(--header-h) + 20px); }
.lang-km .prose h2 { font-size: 1.32rem; line-height: 1.6; }
.lang-km .prose h3 { font-size: 1.1rem; line-height: 1.65; }
.prose > :first-child { margin-top: 0; }
.prose p, .prose ul, .prose ol, .prose .shot, .prose .callout, .prose .table-wrap { margin: 0 0 1.1em; }
.prose li > :last-child, .prose .callout > :last-child { margin-bottom: 0; }
.prose ul { padding-left: 1.35em; list-style: disc; }
.prose ul ul { margin: .35em 0 0; list-style: circle; }
.prose li > p:has(+ ul), .prose li > p:has(+ ol) { margin-bottom: .35em; }
.prose ul li { margin: .3em 0; padding-left: .15em; }
.prose ul li::marker { color: var(--muted); }
.prose a { color: var(--blue-dark); text-decoration: underline; text-decoration-color: rgba(15, 99, 173, .35); text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: currentColor; }
.prose strong { font-weight: 650; color: var(--ink); }
.prose code { padding: .12em .42em; border-radius: 6px; background: var(--tile); border: 1px solid var(--line); font-family: ui-monospace, 'SF Mono', Menlo, Consolas, 'Noto Sans Khmer', monospace; font-size: .88em; color: var(--ink); white-space: nowrap; }
.path-sep .icon { width: .95em; height: .95em; margin: 0 .1em; vertical-align: -.14em; color: var(--muted); }

.prose ol.help-steps { counter-reset: step; padding: 0; list-style: none; }
.prose ol.help-steps > li { position: relative; margin: 0 0 1.15em; padding-left: 2.7em; counter-increment: step; }
.prose ol.help-steps > li::before { content: counter(step); position: absolute; left: 0; top: .1em; display: flex; align-items: center; justify-content: center; width: 1.85em; height: 1.85em; border-radius: 50%; background: var(--tint); color: var(--blue-dark); font: 700 .88em/1 'Inter', system-ui, sans-serif; }
.lang-km .prose ol.help-steps > li::before { top: .32em; }
.prose ol.help-steps > li > p + *, .prose ol.help-steps > li > * + p { margin-top: .6em; }

.shot { display: block; }
.shot a { display: block; cursor: zoom-in; }
.shot img { width: 100%; border-radius: 12px; border: 1px solid var(--line); box-shadow: 0 12px 32px -18px rgba(10, 27, 51, .45); background: var(--tile); }
.shot-phone a { width: fit-content; }
.shot-phone img { width: min(290px, 100%); border: 6px solid var(--navy); border-radius: 30px; box-shadow: 0 16px 36px -18px rgba(10, 27, 51, .55); }
.prose ol.help-steps .shot { margin-top: .8em; }

.callout { padding: 14px 18px; border: 1px solid; border-radius: 14px; }
.callout-title { display: flex; align-items: center; gap: 8px; margin-bottom: .2em !important; font-weight: 700; font-size: .95em; }
.callout-title .icon { width: 18px; height: 18px; }
.callout-note { background: #eef5fd; border-color: #d3e5f8; }
.callout-note .callout-title { color: #0f63ad; }
.callout-tip { background: #edf8f1; border-color: #c9ead6; }
.callout-tip .callout-title { color: #187244; }
.callout-warning { background: #fff6e8; border-color: #f2d9a6; }
.callout-warning .callout-title { color: #965900; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
.prose table { width: 100%; border-collapse: collapse; font-size: .93em; line-height: 1.6; }
.lang-km .prose table { line-height: 1.75; }
.prose th, .prose td { padding: 10px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.prose th { background: var(--tile); font-weight: 600; color: var(--ink); white-space: nowrap; }
.prose tr:last-child td { border-bottom: 0; }

.badge { display: inline-block; margin-left: 8px; padding: 2px 10px; border-radius: 999px; background: #f1ebff; color: #6a3fcf; font: 600 .78rem/1.6 var(--font); letter-spacing: 0; vertical-align: .3em; white-space: nowrap; }
.prose h1 .badge { font-size: .8rem; }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 56px 0 32px; }
.pager a { display: flex; flex-direction: column; gap: 4px; padding: 14px 18px; border: 1px solid var(--line); border-radius: 14px; color: var(--ink); line-height: 1.5; transition: border-color .15s; }
.pager a:hover { border-color: var(--blue); }
.pager-next { align-items: flex-end; text-align: right; }
.pager-label { display: flex; align-items: center; gap: 6px; font-size: .84rem; color: var(--muted); }
.pager-label .icon { width: 15px; height: 15px; }
.pager-title { font-weight: 600; }
.lang-km .pager a { line-height: 1.7; }

.stuck { position: relative; overflow: hidden; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px 28px; padding: 28px 32px; border-radius: 20px; background: var(--navy); color: #fff; isolation: isolate; }
.stuck::before { content: ''; position: absolute; z-index: -1; right: -120px; top: -120px; width: 420px; height: 320px; background: radial-gradient(closest-side, rgba(26, 127, 212, .5), transparent); }
.stuck h2 { font-size: 1.3rem; color: #fff; }
.stuck p { margin-top: 4px; color: rgba(255, 255, 255, .72); }
.stuck .btn .icon { width: 17px; height: 17px; }

/* Home */
/* The decoration sits in its own clipped layer so the search results can hang below the hero. */
.help-hero { position: relative; z-index: 1; padding: 72px 24px 88px; background: var(--navy); color: #fff; text-align: center; isolation: isolate; }
.help-hero-bg { position: absolute; inset: 0; z-index: -1; overflow: hidden; }
.help-hero-bg::before { content: ''; position: absolute; inset: 0; z-index: -2; background-image: linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px); background-size: 56px 56px; -webkit-mask-image: radial-gradient(ellipse 70% 80% at 50% 20%, #000 30%, transparent 75%); mask-image: radial-gradient(ellipse 70% 80% at 50% 20%, #000 30%, transparent 75%); }
.help-hero .hero-glow { top: 30%; width: 900px; height: 460px; }
.help-hero-inner { position: relative; max-width: 680px; margin: 0 auto; }
.help-hero h1 { color: #fff; font-size: clamp(1.9rem, 4vw, 2.75rem); }
.help-hero p { margin: 14px auto 0; max-width: 600px; color: rgba(255, 255, 255, .72); font-size: 1.1rem; }
.search-hero { margin: 32px auto 0; }
.search-hero input { height: 58px; padding-left: 54px; background: #fff; color: var(--ink); border-color: #fff; font-size: 1.05rem; box-shadow: 0 20px 50px -16px rgba(0, 0, 0, .55); }
.search-hero input::placeholder { color: var(--muted); }
.search-hero .search-icon { left: 20px; width: 22px; height: 22px; color: var(--muted); }
.search-hero .search-key { right: 18px; border-color: var(--line); color: var(--muted); }

.help-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; max-width: var(--max); margin: 48px auto 0; padding: 0 24px; }
.sec-card { display: flex; flex-direction: column; padding: 22px; border: 1px solid var(--line); border-radius: 18px; background: #fff; color: var(--ink); transition: border-color .15s, box-shadow .15s, transform .15s; }
.sec-card:hover { border-color: #b9d6f3; box-shadow: 0 14px 34px -20px rgba(10, 27, 51, .4); transform: translateY(-1px); }
.sec-card-icon { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 44px; height: 44px; border-radius: 12px; background: var(--tint); color: var(--blue); }
.sec-card-icon .icon { width: 22px; height: 22px; }
.sec-card h2 { margin: 14px 0 6px; font-size: 1.1rem; line-height: 1.4; letter-spacing: -0.01em; }
.sec-card p { color: var(--slate); font-size: .93rem; }
.sec-card-count { margin-top: auto; padding-top: 14px; font-size: .84rem; font-weight: 500; color: var(--muted); }
.lang-km .sec-card h2 { line-height: 1.6; }
.help-home-stuck { max-width: var(--max); margin: 32px auto 80px; padding: 0 24px; }

/* Section page */
.sec-head { display: flex; align-items: flex-start; gap: 16px; margin: 14px 0 28px; }
.sec-head h1 { font-size: 2rem; line-height: 1.25; }
.lang-km .sec-head h1 { font-size: 1.8rem; line-height: 1.55; }
.sec-head p { margin-top: 6px; color: var(--slate); }
.sec-list { margin-bottom: 48px; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.sec-list li + li { border-top: 1px solid var(--line); }
.sec-list a { display: grid; grid-template-columns: 1fr auto; column-gap: 16px; padding: 16px 20px; color: var(--ink); }
.sec-list a:hover { background: var(--tile); }
.sec-list-title { font-weight: 600; }
.sec-list-title .badge { vertical-align: .1em; }
.sec-list-desc { margin-top: 2px; color: var(--slate); font-size: .93rem; }
.sec-list .chev { grid-column: 2; grid-row: 1 / span 2; align-self: center; width: 18px; height: 18px; color: var(--muted); }

.help-footer { border-top: 1px solid var(--line); }
.hf-inner { display: flex; flex-wrap: wrap; gap: 8px 24px; max-width: 1440px; margin: 0 auto; padding: 22px 24px; font-size: .88rem; color: var(--muted); }
.hf-inner a { color: var(--slate); }
.hf-inner a:hover { color: var(--ink); }

/* Full-size picture */
.zoom { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(5, 12, 24, .92); cursor: zoom-out; }
.zoom img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; border-radius: 8px; }
.zoom button { position: absolute; top: 12px; right: 12px; display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .92); color: var(--ink); cursor: pointer; }

@media (max-width: 1200px) {
  .help-shell.has-toc { grid-template-columns: var(--side-w) minmax(0, 1fr); }
  .help-toc { display: none; }
}
@media (max-width: 1080px) {
  .hh-links > a:not(.btn) { display: none; }
}

/* Phone and small tablet: the sidebar becomes a drawer, search a sheet over the page. */
@media (max-width: 900px) {
  :root { --header-h: 56px; }
  .hh-inner { gap: 4px; padding: 0 6px; }
  .hh-menu, .hh-search-open { display: inline-flex; }
  .hh-search-open { margin-left: auto; }
  .hh-links { display: none; }
  .hh-logo { gap: 8px; font-size: 1.05rem; margin-left: 4px; }
  .hh-title { margin-left: 2px; padding-left: 10px; font-size: .9rem; }
  .help-home .hh-logo { margin-left: 10px; }

  .search-top { display: none; }
  body.search-open .search-top { position: fixed; inset: 0 0 auto 0; z-index: 90; display: flex; align-items: center; gap: 6px; max-width: none; height: var(--header-h); padding: 0 6px 0 10px; background: var(--navy); }
  body.search-open .search-top input { flex: 1; background: #fff; color: var(--ink); border-color: #fff; font-size: 16px; }
  body.search-open .search-top .search-icon { left: 24px; color: var(--muted); }
  .search-top .search-key, .search-hero .search-key { display: none; }
  body.search-open .search-cancel { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0; border: 0; background: none; color: #fff; flex: none; }
  body.search-open .search-cancel .icon { width: 22px; height: 22px; }
  body.search-open .search-top .search-results { position: fixed; top: var(--header-h); bottom: 0; max-height: none; border-radius: 0; box-shadow: none; padding: 8px; }
  body.search-open .search-top .search-results[hidden] { display: block; background: rgba(5, 12, 24, .5); }

  .help-shell, .help-shell.has-toc { grid-template-columns: minmax(0, 1fr); }
  .help-sidebar { position: fixed; z-index: 85; top: 0; left: 0; bottom: 0; align-self: stretch; display: flex; flex-direction: column; width: min(340px, 88vw); height: auto; padding: 0; border-right: 0; background: #fff; box-shadow: 20px 0 60px -20px rgba(5, 12, 24, .5); transform: translateX(-105%); visibility: hidden; transition: transform .22s ease, visibility 0s .22s; }
  body.drawer-open .help-sidebar { transform: none; visibility: visible; transition: transform .22s ease; }
  .drawer-backdrop { position: fixed; inset: 0; z-index: 80; background: rgba(5, 12, 24, .5); }
  body.drawer-open .drawer-backdrop { display: block; }
  .drawer-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; min-height: var(--header-h); padding: 0 6px 0 20px; border-bottom: 1px solid var(--line); background: #fff; font-family: var(--font-head); font-weight: 700; }
  .drawer-head .hh-icon:hover { background: var(--tile); }
  .side-nav { padding: 12px 10px; }
  .side-sec summary { padding: 10px; font-size: 1rem; }
  .side-sec li a { padding: 8px 10px 8px 38px; font-size: .96rem; }
  .drawer-links { display: flex; flex-direction: column; gap: 14px; margin-top: auto; padding: 18px 20px 24px; border-top: 1px solid var(--line); font-size: .95rem; }
  .drawer-links a { display: inline-flex; align-items: center; gap: 8px; color: var(--slate); font-weight: 500; }
  .drawer-links .icon { width: 17px; height: 17px; color: var(--blue); }
  .drawer-links .lang-switch a { color: var(--blue-dark); }

  .help-main { padding: 18px 16px 48px; }
  .prose h1 { margin-bottom: 18px; font-size: 1.65rem; }
  .lang-km .prose h1 { font-size: 1.5rem; }
  .prose h2 { font-size: 1.28rem; }
  .lang-km .prose h2 { font-size: 1.22rem; }
  .shot img { border-radius: 10px; }
  .shot-phone a { margin: 0 auto; }
  .prose ol.help-steps > li { padding-left: 2.4em; }
  .prose code { white-space: normal; }
  .pager { grid-template-columns: 1fr; gap: 10px; margin-top: 40px; }
  .pager-next { order: -1; }
  .stuck { padding: 24px 20px; }
  .stuck .btn { width: 100%; }

  .help-hero { padding: 44px 16px 52px; }
  .help-hero p { font-size: 1rem; }
  .search-hero { margin-top: 26px; }
  .search-hero input { height: 54px; font-size: 16px; }
  .help-cards { grid-template-columns: 1fr; gap: 12px; margin-top: 24px; padding: 0 16px; }
  .sec-card { display: grid; grid-template-columns: auto 1fr; column-gap: 14px; padding: 16px; border-radius: 16px; }
  .sec-card-icon { grid-row: 1 / span 3; width: 40px; height: 40px; }
  .sec-card h2 { margin: 0 0 2px; font-size: 1.04rem; }
  .sec-card-count { padding-top: 6px; }
  .help-home-stuck { margin: 24px auto 48px; padding: 0 16px; }

  .sec-head { margin: 10px 0 20px; }
  .sec-head h1, .lang-km .sec-head h1 { font-size: 1.5rem; }
  .sec-list a { padding: 14px 16px; }
  .hf-inner { padding: 20px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .help-sidebar, .sec-card, .side-sec .chev { transition: none; }
}
