/* TangMa user manual (/guide/*) - shared stylesheet.
   Tokens are copied from landing/how-it-works.html. Light by default, dark via
   prefers-color-scheme. Sections: tokens, base, topbar/header, content blocks,
   hub (search + cards), phone demo, footer. */

:root{--indigo:#6C5CE7;--indigo-d:#5847C9;--indigo-l:#8B7CF0;--money:#11B98A;
      --ink:#16182B;--muted:#5C6178;--bg:#F4F5FB;--card:#fff;--stroke:#E7E9F3;
      --green:var(--indigo);--green-d:var(--indigo-d);
      --text2:#2A2D45;--answer-bg:#ECEAFB;--answer-bd:#C9C2F5;
      --warn-bg:#FFF6E9;--warn-bd:#F3D9AE;--th-bg:#F0F0FA;--field-bg:#fff}

@media(prefers-color-scheme:dark){
  :root{--ink:#ECEEFA;--muted:#A9AEC8;--bg:#0F1120;--card:#1A1D33;--stroke:#2D3150;
        --green-d:#B9AFFF;--text2:#D5D8EE;--answer-bg:#232050;--answer-bd:#4A44A0;
        --warn-bg:#33291A;--warn-bd:#6B5528;--th-bg:#222640;--field-bg:#14172B}
}

*{box-sizing:border-box;margin:0;padding:0}
html{background:var(--bg)}
body{font-family:'Sarabun','Segoe UI',system-ui,-apple-system,sans-serif;color:var(--ink);background:var(--bg);line-height:1.75;font-size:16px;overflow-x:hidden;-webkit-font-smoothing:antialiased}
a{color:var(--green-d)}
a:focus-visible,button:focus-visible,input:focus-visible{outline:3px solid var(--indigo-l);outline-offset:2px;border-radius:8px}
.wrap{max-width:860px;margin:0 auto;padding:0 22px}
.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}

/* topbar (sticky, in flow - never position:fixed) with the inline HubLink pill */
.topbar{position:sticky;top:0;z-index:1000;display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;padding:calc(env(safe-area-inset-top) + 10px) 16px 10px;background:rgba(22,24,43,.92);backdrop-filter:blur(10px);border-bottom:1px solid rgba(255,255,255,.08)}
.homebtn{display:inline-flex;align-items:center;min-height:40px;padding:9px 13px;border-radius:11px;font-size:12px;color:#d3d8ee;background:rgba(255,255,255,.10);border:1px solid rgba(255,255,255,.20);text-decoration:none;white-space:nowrap;opacity:.9;transition:.25s}
.homebtn:hover{opacity:1;color:#fff;border-color:rgba(255,255,255,.4);box-shadow:0 0 14px rgba(108,92,231,.45)}
header{background:linear-gradient(160deg,#16182B 0%,#4B3FBE 70%,#6C5CE7 130%);color:#fff;padding:52px 0 40px}
header h1{font-size:29px;line-height:1.35;font-weight:800}
.crumb{font-size:13px;color:#DDD8FA;margin-bottom:12px}
.crumb a{color:#fff;text-decoration:none;opacity:.85;display:inline-flex;align-items:center;justify-content:center;min-height:40px;min-width:40px;padding:0 4px;margin:-12px -4px}  /* >=40px tap target, negative margin keeps the line height */
.crumb a:hover{text-decoration:underline;opacity:1}
.lede{margin-top:14px;font-size:17px;color:#F1EEFF}
main{padding:34px 0 60px}

/* content blocks reused by the /guide/<slug> pages */
h2{font-size:21px;color:var(--green-d);margin:34px 0 12px;border-left:4px solid var(--green);padding-left:12px;line-height:1.4}
h3{font-size:17px;margin:22px 0 6px}
p,li{color:var(--text2);margin-bottom:11px}
ul,ol{padding-left:22px}
.answer{background:var(--answer-bg);border:1px solid var(--answer-bd);border-radius:14px;padding:18px 20px;margin:0 0 22px}
.answer p:last-child{margin-bottom:0}
.box{background:var(--card);border:1px solid var(--stroke);border-radius:14px;padding:16px 20px;margin:16px 0}
.box p:last-child,.box li:last-child{margin-bottom:0}
.warn{background:var(--warn-bg);border-color:var(--warn-bd)}
.tablewrap{overflow-x:auto;margin:16px 0;border:1px solid var(--stroke);border-radius:14px;background:var(--card)}
table{border-collapse:collapse;width:100%;min-width:460px;font-size:15px}
th,td{text-align:left;padding:11px 14px;border-bottom:1px solid var(--stroke);vertical-align:top;color:var(--text2)}
th{background:var(--th-bg);color:var(--green-d);font-weight:700;white-space:nowrap}
tr:last-child td{border-bottom:none}
.cta{background:linear-gradient(150deg,#4B3FBE,#6C5CE7);color:#fff;border-radius:18px;padding:26px 22px;margin:34px 0 10px;text-align:center}
.cta h2{color:#fff;border:none;padding:0;margin:0 0 8px;font-size:20px}
.cta p{color:#fff;opacity:.92;margin-bottom:16px}
.btn{display:inline-flex;align-items:center;justify-content:center;min-height:48px;padding:13px 26px;border-radius:13px;background:#fff;color:var(--indigo-d);font-weight:700;text-decoration:none;transition:.2s}
.btn:hover{transform:translateY(-2px);box-shadow:0 10px 24px rgba(0,0,0,.25)}
.faq details{background:var(--card);border:1px solid var(--stroke);border-radius:12px;padding:14px 18px;margin-bottom:10px}
.faq summary{font-weight:700;cursor:pointer;color:var(--ink);min-height:40px}
.faq p{margin:10px 0 0}
.related{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,230px),1fr));gap:12px;margin-top:14px}
.related a{display:block;background:var(--card);border:1px solid var(--stroke);border-radius:13px;padding:14px 16px;text-decoration:none;transition:.2s}
.related a:hover{border-color:var(--indigo-l);transform:translateY(-2px);box-shadow:0 8px 20px rgba(108,92,231,.14)}
.related b{display:block;color:var(--green-d);margin-bottom:3px}
.related span{font-size:14px;color:var(--muted)}
.updated{margin-top:26px;font-size:14px;color:var(--muted)}
.badge-pro{display:inline-block;margin-left:6px;padding:0 9px;border-radius:999px;background:var(--indigo);color:#fff;font-size:12px;font-weight:700;line-height:1.7;vertical-align:middle}

/* hub: symptom search + grouped cards */
.guide-search-wrap{display:none;margin:0 0 6px}
.js .guide-search-wrap{display:block}
.guide-search{width:100%;min-height:48px;padding:11px 16px;border-radius:13px;border:1.5px solid var(--stroke);background:var(--field-bg);color:var(--ink);font:inherit;font-size:16px}
.guide-search::placeholder{color:var(--muted)}
.guide-search:focus{border-color:var(--indigo-l)}
.guide-status{min-height:1.75em;margin:8px 2px 0;font-size:14px;color:var(--muted)}
.guide-group h2{margin-top:30px}
.guide-cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,250px),1fr));gap:12px}
.guide-card{display:block;min-height:64px;background:var(--card);border:1px solid var(--stroke);border-radius:13px;padding:14px 16px;text-decoration:none;transition:.2s}
.guide-card:hover{border-color:var(--indigo-l);transform:translateY(-2px);box-shadow:0 8px 20px rgba(108,92,231,.14)}
.guide-card b{display:block;color:var(--green-d);margin-bottom:2px}
.guide-card span{display:block;font-size:14px;color:var(--muted);line-height:1.6}
.guide-group[hidden],.guide-card[hidden],.guide-empty[hidden]{display:none}
.guide-empty{margin-top:22px}

/* phone mock step demo: <div class="phone-demo" data-steps> with <figure class="phone"> children.
   Without JS every step is shown stacked; guide.js adds .is-enhanced and the controls. */
.phone-demo{margin:22px auto;max-width:340px;text-align:center}
.phone{margin:0 auto 26px}
.phone-screen{width:min(236px,100%);margin:0 auto;aspect-ratio:9/16;background:#F7F8FD;color:#16182B;border:8px solid #16182B;border-radius:30px;box-shadow:0 10px 26px rgba(22,24,43,.25),0 0 0 1px var(--stroke);overflow:hidden;text-align:left;font-size:13px;line-height:1.5;display:flex;flex-direction:column;position:relative}
.phone-screen img{display:block;width:100%;height:100%;object-fit:cover}
.phone figcaption{max-width:300px;margin:12px auto 0;font-size:14px;color:var(--muted);line-height:1.6}
.phone figcaption b{color:var(--ink)}
/* mock UI atoms (fixed colours on purpose - they imitate the app, not the page theme) */
.m-bar{padding:14px 12px 10px;background:#4B3FBE;color:#fff;font-weight:700;font-size:14px}
.m-body{padding:12px;display:flex;flex-direction:column;gap:9px;flex:1}
.m-card{background:#fff;border:1px solid #E7E9F3;border-radius:12px;padding:10px 12px}
.m-big{font-size:24px;font-weight:800;color:#16182B;line-height:1.2}
.m-sub{font-size:12px;color:#5C6178}
.m-ok{color:#087A5B;font-weight:700}
.m-btn{display:block;text-align:center;padding:10px;border-radius:10px;background:#6C5CE7;color:#fff;font-weight:700}
.m-toast{margin-top:auto;padding:10px 12px;border-radius:12px;background:#16182B;color:#fff;font-weight:600}
.m-hl{outline:3px solid #F5A524;outline-offset:2px;animation:m-pulse 1.6s ease-in-out infinite}
@keyframes m-pulse{0%,100%{outline-color:#F5A524}50%{outline-color:rgba(245,165,36,.25)}}
/* controls + stepping (enhanced only) */
.phone-demo-nav{display:none;align-items:center;justify-content:center;gap:6px;flex-wrap:wrap}
.phone-demo.is-enhanced .phone{display:none;margin-bottom:12px}
.phone-demo.is-enhanced .phone.is-active{display:block;animation:phone-in .25s ease-out}
.phone-demo.is-enhanced .phone-demo-nav{display:flex}
@keyframes phone-in{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
.phone-nav-btn{min-width:84px;min-height:44px;padding:8px 16px;border-radius:12px;border:1.5px solid var(--indigo);background:var(--card);color:var(--green-d);font:inherit;font-weight:700;cursor:pointer}
.phone-nav-btn:hover:not(:disabled){background:var(--indigo);color:#fff}
.phone-nav-btn:disabled{opacity:.4;cursor:default}
.phone-dots{display:flex;align-items:center;justify-content:center;flex-wrap:wrap}
.phone-dot{width:40px;height:40px;border:none;background:transparent;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;border-radius:50%}
.phone-dot::before{content:"";width:12px;height:12px;border-radius:50%;background:var(--stroke);border:2px solid var(--indigo-l);transition:.2s}
.phone-dot[aria-current="step"]::before{background:var(--indigo);transform:scale(1.25)}
.phone-demo-status{flex-basis:100%;margin-top:4px;font-size:13px;color:var(--muted)}

/* step pages (/guide/<slug>): quoted in-app labels + prev/next */
b.ui{font-weight:700;color:var(--green-d);background:var(--answer-bg);border-radius:6px;padding:0 6px;overflow-wrap:anywhere}
.pager{margin-top:30px}
.pager a small{display:block;font-size:13px;color:var(--muted);font-weight:400}
.back-guide{display:inline-flex;align-items:center;min-height:44px;margin-top:14px;font-weight:700}
.steps-note{font-size:14px;color:var(--muted)}

/* mock UI atoms, part 2 (fixed colours, same reason as above): back arrow, rows, switches, pills,
   chips, dialogs, bottom nav, QR. Dialogs sit in .m-dim, which fills the (positioned) phone screen. */
.m-tall .phone-screen{aspect-ratio:9/19}
.m-bar-back::before{content:"\2039";margin-right:8px;font-size:20px;line-height:1;vertical-align:-1px}
.m-bar small{display:block;font-weight:400;font-size:10px;opacity:.85;line-height:1.35}
.m-bar-tab{display:flex;justify-content:space-between;align-items:center}
.m-title{font-weight:700;font-size:12.5px;color:#16182B;line-height:1.35}
.m-row{display:flex;align-items:center;gap:8px;background:#fff;border:1px solid #E7E9F3;border-radius:12px;padding:8px 10px}
.m-row>div{flex:1;min-width:0}
.m-row>span:last-child{flex:none;color:#8A8FA8}
.m-group{font-size:11px;font-weight:700;color:#5C6178;margin-top:2px}
.m-badge{display:inline-block;margin-left:4px;padding:0 6px;border-radius:999px;background:#6C5CE7;color:#fff;font-size:9px;font-weight:700;line-height:1.6;vertical-align:middle}
.m-badge-free{background:#087A5B}
.m-sw-row{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:5px 0;font-size:12px;line-height:1.35;color:#16182B}
.m-sw{flex:none;position:relative;width:34px;height:20px;border-radius:999px;background:#C9CCDD}
.m-sw::after{content:"";position:absolute;top:2px;left:2px;width:16px;height:16px;border-radius:50%;background:#fff}
.m-sw.on{background:#6C5CE7}
.m-sw.on::after{left:16px}
.m-pill{display:inline-block;padding:1px 8px;border-radius:999px;font-size:10.5px;font-weight:700;line-height:1.5}
.m-pill-ok{background:#DDF6EC;color:#087A5B}
.m-pill-warn{background:#FFEBCF;color:#9A5B00}
.m-pill-bad{background:#FFE1E1;color:#B3261E}
.m-chips{display:flex;gap:5px;flex-wrap:wrap;margin:6px 0}
.m-chip{padding:2px 9px;border-radius:999px;border:1px solid #C9CCDD;font-size:11px;color:#16182B}
.m-chip.on{background:#6C5CE7;border-color:#6C5CE7;color:#fff}
.m-warnbox{background:#FFF1DC;border:1px solid #F3D9AE;border-radius:10px;padding:8px 10px;font-size:11px;color:#16182B}
.m-warnbox b{display:block;color:#9A5B00;font-size:12px}
.m-btn-line{background:#fff;color:#4B3FBE;border:1.5px solid #6C5CE7}
.m-btn-bad{background:#fff;color:#B3261E;border:1.5px solid #E5534B}
.m-btn-sm{padding:6px 8px;font-size:12px}
.m-link{color:#4B3FBE;font-weight:700;font-size:11px}
.m-tl{font-size:10.5px;color:#5C6178;line-height:1.45}
.m-bill{padding:5px 0;border-top:1px solid #E7E9F3;font-size:11.5px;color:#16182B;line-height:1.4}
.m-bad{color:#B3261E;font-weight:700}
.m-warn{color:#9A5B00;font-weight:700}
.m-note{font-size:10.5px;color:#5C6178;text-align:center;line-height:1.4}
.m-center{text-align:center}
.m-input{border-bottom:2px solid #6C5CE7;padding:3px 2px;font-size:12px;color:#16182B}
.m-input.ph{color:#8A8FA8}
.m-code{align-self:center;padding:2px 12px;border-radius:10px;background:#ECEAFB;color:#4B3FBE;font-weight:800;font-size:20px;letter-spacing:.2em}
.m-qr{position:relative;flex:none;width:104px;height:104px;margin:0 auto;padding:6px;background:#fff;border:1px solid #E7E9F3;border-radius:8px}
.m-qr i{display:block;width:100%;height:100%;background:conic-gradient(#16182B 25%,#fff 0 50%,#16182B 0 75%,#fff 0) 0 0/10px 10px}
.m-qr::before,.m-qr::after,.m-qr b{content:"";position:absolute;width:24px;height:24px;background:#fff;border:5px solid #16182B;border-radius:3px}
.m-qr::before{top:6px;left:6px}
.m-qr::after{top:6px;right:6px}
.m-qr b{bottom:6px;left:6px}
.m-nav{display:flex;margin-top:auto;border-top:1px solid #E7E9F3;background:#fff}
.m-nav span{flex:1;padding:8px 0;text-align:center;font-size:10.5px;color:#5C6178}
.m-nav .on{color:#4B3FBE;font-weight:700}
.m-noti{background:#fff;border-radius:12px;padding:9px 11px;border-left:4px solid #E5983B;box-shadow:0 4px 12px rgba(22,24,43,.18);font-size:11.5px;line-height:1.4;color:#16182B}
.m-noti b{display:block;font-size:12px}
.m-noti small{color:#5C6178;font-size:10.5px}
.m-dim{position:absolute;inset:0;z-index:2;display:flex;align-items:center;justify-content:center;padding:12px;background:rgba(22,24,43,.58)}
.m-dialog{width:100%;max-height:100%;overflow:hidden;background:#fff;border-radius:16px;padding:12px;color:#16182B;box-shadow:0 8px 24px rgba(0,0,0,.35)}
.m-dialog-title{margin-bottom:4px;font-weight:700;font-size:13px;line-height:1.35}
.m-dialog-msg{margin-bottom:8px;font-size:11px;line-height:1.45;color:#5C6178}
.m-dialog-item{padding:8px 2px;border-top:1px solid #E7E9F3;font-size:12px;line-height:1.35}
.m-dialog-actions{display:flex;justify-content:flex-end;flex-wrap:wrap;gap:6px 16px;margin-top:8px;font-weight:700;font-size:12px;color:#4B3FBE}
.m-dialog-actions span{padding:2px 4px}
.m-dialog-actions .m-bad{color:#B3261E}

/* additive mock pieces (T3): slider, radio, app row with two switches, checklist row */
.m-seek{position:relative;height:5px;margin:9px 6px 12px;border-radius:3px;background:#C9CCDD}
.m-seek i{display:block;height:100%;border-radius:3px;background:#6C5CE7}
.m-seek::after{content:"";position:absolute;top:-4px;left:var(--p,50%);width:13px;height:13px;margin-left:-6px;border-radius:50%;background:#6C5CE7;box-shadow:0 1px 3px rgba(0,0,0,.3)}
.m-rb{display:flex;align-items:center;gap:7px;padding:4px 0;font-size:12px;line-height:1.35;color:#16182B}
.m-rb::before{content:"";flex:none;width:13px;height:13px;box-sizing:border-box;border-radius:50%;border:2px solid #8A8FA8}
.m-rb.on::before{border-color:#6C5CE7;background:radial-gradient(circle,#6C5CE7 0 38%,transparent 42%)}
.m-app{display:flex;align-items:center;gap:6px;padding:5px 0;border-top:1px solid #E7E9F3;font-size:11.5px;line-height:1.3;color:#16182B}
.m-app>span:nth-child(2){flex:1;min-width:0}
.m-app .m-sw{transform:scale(.8);transform-origin:center}
.m-ico{flex:none;width:16px;height:16px;border-radius:5px;background:#C9CCDD}
.m-chk{display:flex;align-items:center;gap:7px;padding:5px 0;font-size:12px;line-height:1.35;color:#16182B}
.m-chk::before{content:"";flex:none;width:14px;height:14px;box-sizing:border-box;border-radius:50%;border:2px solid #8A8FA8}
.m-chk.done::before{border-color:#087A5B;background:#087A5B}

footer{background:#16182B;color:#aab;text-align:center;font-size:14px;padding:30px 0 40px}
footer a{color:#cfd4f0}
@media(max-width:640px){header h1{font-size:24px}h2{font-size:19px}}
@media(prefers-reduced-motion:reduce){
  *,*::before,*::after{animation-duration:.001ms!important;animation-iteration-count:1!important;transition-duration:.001ms!important}
  .m-hl{animation:none}
}
