/* jmaster.vn/guide/* (GuideController, views/guide). Light + dark. */
:root {
  --bg: #f4f6fb;
  --card: #fff;
  --text: #1a2233;
  --muted: #5f6b7d;
  --line: #e3e8f0;
  --accent: #2563eb;
  --accent-2: #7c3aed;
  --accent-soft: #e8f0ff;
  --ok: #15803d;
  --ok-soft: #e7f6ec;
  --warn: #c2410c;
  --warn-soft: #fff1e6;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 6px 20px rgba(16, 24, 40, .06);
  --phone: #fff;
  --phone-frame: #1f2633;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1219;
    --card: #171e2a;
    --text: #e6ebf3;
    --muted: #9aa6b8;
    --line: #283244;
    --accent: #7aa7ff;
    --accent-2: #b794ff;
    --accent-soft: #1b2843;
    --ok: #5fd08a;
    --ok-soft: #14301f;
    --warn: #f2a65a;
    --warn-soft: #3a2614;
    --shadow: none;
    --phone: #1d2533;
    --phone-frame: #3a4558;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans JP", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
p { margin: 0 0 10px; }
h1 { font-size: 26px; line-height: 1.25; margin: 6px 0 6px; letter-spacing: -.01em; }
h2 { font-size: 20px; line-height: 1.35; margin: 0 0 12px; display: flex; align-items: center; gap: 10px; }
h3 { font-size: 17px; margin: 20px 0 8px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
ul { padding-left: 20px; margin: 6px 0 10px; }
li { margin-bottom: 6px; }
.wrap { max-width: 860px; margin: 0 auto; padding: 0 16px 40px; }
.wrap.wide { max-width: 1060px; }
svg.i { width: 1em; height: 1em; flex: none; vertical-align: -.125em; }

/* ---------- hero ---------- */
.hero {
  background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
  color: #fff;
  padding: 14px 0 26px;
  margin-bottom: 4px;
}
@media (prefers-color-scheme: dark) { .hero { background: linear-gradient(135deg, #1e3a8a 0%, #4c1d95 100%); } }
.hero .wrap { padding-bottom: 0; }
.hero-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.hero-top .back { color: #fff; opacity: .9; text-decoration: none; font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.hero-top .back:hover { opacity: 1; text-decoration: underline; }
.hero-main { display: flex; gap: 16px; align-items: center; }
.hero-logo { width: 64px; height: 64px; border-radius: 16px; background: #fff; box-shadow: 0 6px 18px rgba(0,0,0,.18); flex: none; object-fit: cover; }
.hero-logos { display: flex; flex: none; }
.hero-logos img { width: 44px; height: 44px; border-radius: 12px; border: 2px solid #fff; background: #fff; margin-left: -10px; box-shadow: 0 4px 12px rgba(0,0,0,.18); }
.hero-logos img:first-child { margin-left: 0; }
.hero-icon { width: 64px; height: 64px; border-radius: 16px; background: rgba(255,255,255,.18); display: flex; align-items: center; justify-content: center; font-size: 32px; flex: none; }
.hero .app { font-size: 13px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; opacity: .85; }
.hero .lead { margin: 0; opacity: .92; }
.hero .lead strong { color: #fff; }
.lang-switch { display: inline-flex; border-radius: 999px; overflow: hidden; background: rgba(255,255,255,.16); }
.lang-switch a { padding: 5px 12px; font-size: 13px; font-weight: 600; text-decoration: none; color: #fff; opacity: .85; }
.lang-switch a.on { background: #fff; color: #3730a3; opacity: 1; }

/* ---------- nav ---------- */
nav.tabs {
  position: sticky; top: 0; z-index: 5;
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
  padding: 10px 0; background: var(--bg);
}
nav.tabs::-webkit-scrollbar { display: none; }
nav.tabs a, .pill {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  padding: 7px 14px; border-radius: 999px;
  background: var(--card); color: var(--text); border: 1px solid var(--line);
  font-weight: 600; font-size: 14px; text-decoration: none;
}
nav.tabs a svg { color: var(--accent); }
nav.tabs a:hover, .pill:hover { border-color: var(--accent); }
.pill.primary { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- cards ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 18px;
  margin: 14px 0;
  scroll-margin-top: 64px;
}
section[id], h3[id] { scroll-margin-top: 64px; }
.ic {
  width: 38px; height: 38px; border-radius: 12px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent); font-size: 20px;
}
.ic.green { background: var(--ok-soft); color: var(--ok); }
.ic.orange { background: var(--warn-soft); color: var(--warn); }
.ic.purple { background: color-mix(in srgb, var(--accent-2) 16%, transparent); color: var(--accent-2); }
.ic.sm { width: 28px; height: 28px; border-radius: 9px; font-size: 15px; }
.grid { display: grid; gap: 0 14px; grid-template-columns: 1fr; }
@media (min-width: 860px) { .grid.cols-2 { grid-template-columns: 1fr 1fr; } }

/* benefits */
.benefits { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); margin: 4px 0 14px; }
.benefit { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border-radius: 12px; background: var(--bg); }
.benefit strong { display: block; }
.benefit span { color: var(--muted); font-size: 14px; }

/* steps */
ol.steps { counter-reset: s; list-style: none; padding: 0; margin: 10px 0; }
ol.steps > li { counter-increment: s; position: relative; padding: 2px 0 14px 44px; }
ol.steps > li::before {
  content: counter(s); position: absolute; left: 0; top: 0;
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; font-weight: 700; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
}
ol.steps > li:not(:last-child)::after {
  content: ""; position: absolute; left: 14px; top: 32px; bottom: 2px; width: 2px; background: var(--line);
}

/* payment methods */
.methods { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); margin: 8px 0; }
.method { border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: flex; gap: 12px; align-items: flex-start; }
.method strong { display: block; margin-bottom: 2px; }
.method p { margin: 0; color: var(--muted); font-size: 14px; }
.method .tag { display: inline-block; margin-top: 6px; font-size: 12px; font-weight: 700; color: var(--ok); background: var(--ok-soft); border-radius: 999px; padding: 1px 8px; }

/* notes */
.note, .tip, .ok {
  display: flex; gap: 10px; align-items: flex-start;
  border-radius: 12px; padding: 12px 14px; margin: 12px 0; font-size: 15px;
}
.note > svg, .tip > svg, .ok > svg { font-size: 19px; margin-top: 2px; }
.note { background: var(--warn-soft); } .note > svg { color: var(--warn); }
.tip { background: var(--accent-soft); } .tip > svg { color: var(--accent); }
.ok { background: var(--ok-soft); } .ok > svg { color: var(--ok); }
.note > div, .tip > div, .ok > div { flex: 1; min-width: 0; }
.chip { display: inline-block; padding: 1px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 13px; font-weight: 700; }
.path { font-weight: 600; background: var(--bg); border-radius: 6px; padding: 0 5px; }
.btn {
  display: inline-block; padding: 0 8px; border: 1px solid var(--line); border-bottom-width: 2px;
  border-radius: 7px; background: var(--card); font: inherit; font-size: 14px; font-weight: 700; white-space: nowrap;
}
code { font-size: 14px; background: var(--bg); border-radius: 5px; padding: 0 4px; }
.muted { color: var(--muted); font-size: 14px; }
table { width: 100%; border-collapse: collapse; font-size: 15px; margin: 8px 0; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 13px; }
.table-scroll { overflow-x: auto; }
figure { margin: 14px 0; text-align: center; }
figure img { max-width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--line); }
figcaption { color: var(--muted); font-size: 14px; margin-top: 6px; }

/* FAQ */
details { border: 1px solid var(--line); border-radius: 12px; padding: 0; margin: 8px 0; overflow: hidden; }
details summary {
  cursor: pointer; font-weight: 600; padding: 12px 40px 12px 14px; list-style: none; position: relative;
}
details summary::-webkit-details-marker { display: none; }
details summary::after {
  content: ""; position: absolute; right: 16px; top: 50%; width: 8px; height: 8px; margin-top: -6px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .2s;
}
details[open] summary::after { transform: rotate(-135deg); margin-top: -2px; }
details[open] summary { background: var(--bg); }
details > :not(summary) { margin-left: 14px; margin-right: 14px; }
details > :last-child { margin-bottom: 12px; }
details > p:first-of-type, details > ul:first-of-type { margin-top: 10px; }

ul.warn-list, ul.check-list { list-style: none; padding: 0; }
ul.warn-list li, ul.check-list li { position: relative; padding-left: 28px; }
ul.warn-list li::before { content: "✕"; position: absolute; left: 4px; color: var(--warn); font-weight: 700; }
ul.check-list li::before { content: "✓"; position: absolute; left: 4px; color: var(--ok); font-weight: 700; }

/* ---------- phone mock-ups (illustrations drawn in CSS) ---------- */
.flow { display: flex; gap: 8px; align-items: center; overflow-x: auto; padding: 8px 2px 4px; margin: 8px 0 4px; scroll-snap-type: x mandatory; }
.flow-step { flex: none; width: 178px; scroll-snap-align: start; text-align: center; }
.flow-arrow { flex: none; color: var(--muted); font-size: 22px; }
.flow-cap { font-size: 13px; color: var(--muted); margin-top: 8px; line-height: 1.4; }
.flow-cap b { color: var(--text); }
.flow-note { font-size: 12px; color: var(--muted); text-align: right; margin: 0; }
.phone {
  position: relative; height: 300px; border-radius: 26px; padding: 9px;
  background: var(--phone-frame); box-shadow: var(--shadow); text-align: left;
}
.phone::before { content: ""; position: absolute; top: 14px; left: 50%; width: 46px; height: 5px; margin-left: -23px; border-radius: 3px; background: rgba(255,255,255,.25); z-index: 2; }
.screen { position: relative; height: 100%; border-radius: 18px; overflow: hidden; background: var(--phone); font-size: 11px; line-height: 1.35; color: var(--text); }
.scr-bar { padding: 22px 10px 8px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; font-weight: 700; font-size: 12px; display: flex; align-items: center; gap: 6px; }
.scr-body { padding: 10px; }
.scr-line { display: flex; gap: 6px; align-items: center; padding: 5px 0; border-bottom: 1px solid var(--line); }
.scr-line .ok-dot { color: var(--ok); font-weight: 700; }
.scr-btn { display: block; margin-top: 10px; padding: 7px; border-radius: 8px; text-align: center; font-weight: 700; color: #fff; background: var(--accent); }
.scr-btn.green { background: #01875f; }
.scr-btn.dark { background: #0a84ff; }
.scr-pulse { box-shadow: 0 0 0 0 rgba(37,99,235,.55); animation: pulse 1.8s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 9px rgba(37,99,235,0); } 100% { box-shadow: 0 0 0 0 rgba(37,99,235,0); } }
@media (prefers-reduced-motion: reduce) { .scr-pulse { animation: none; } }
.scr-dim { position: absolute; inset: 0; background: rgba(0,0,0,.35); }
.scr-sheet { position: absolute; left: 0; right: 0; bottom: 0; background: var(--phone); border-radius: 14px 14px 0 0; padding: 10px; }
.scr-sheet .handle { width: 30px; height: 4px; border-radius: 2px; background: var(--line); margin: 0 auto 8px; }
.scr-app { display: flex; gap: 7px; align-items: center; margin-bottom: 6px; }
.scr-app img { width: 26px; height: 26px; border-radius: 7px; }
.scr-row { display: flex; justify-content: space-between; align-items: center; gap: 6px; padding: 5px 0; border-top: 1px solid var(--line); }
.scr-row .hl { outline: 2px solid var(--warn); outline-offset: 1px; border-radius: 4px; padding: 0 3px; }
.scr-muted { color: var(--muted); }
.scr-done { text-align: center; padding-top: 34px; }
.scr-done .big { width: 52px; height: 52px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); display: inline-flex; align-items: center; justify-content: center; font-size: 28px; margin-bottom: 8px; }
.scr-radio { display: flex; gap: 6px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.scr-radio i { width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--muted); flex: none; }
.scr-radio.on i { border-color: var(--accent); background: radial-gradient(var(--accent) 45%, transparent 50%); }
.scr-radio.on { font-weight: 700; }
.scr-slider { height: 4px; border-radius: 2px; background: var(--line); position: relative; margin: 10px 0 4px; }
.scr-slider::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 50%; background: var(--accent); border-radius: 2px; }
.scr-slider::after { content: ""; position: absolute; left: 50%; top: -5px; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: var(--accent); }
/* desktop mock-up */
.desktop { border-radius: 12px; border: 1px solid var(--line); overflow: hidden; background: var(--phone); max-width: 520px; margin: 12px auto; box-shadow: var(--shadow); font-size: 13px; }
.desktop .titlebar { display: flex; gap: 6px; align-items: center; padding: 8px 10px; background: var(--bg); border-bottom: 1px solid var(--line); font-weight: 600; }
.desktop .titlebar i { width: 10px; height: 10px; border-radius: 50%; background: #ff5f57; }
.desktop .titlebar i:nth-child(2) { background: #febc2e; } .desktop .titlebar i:nth-child(3) { background: #28c840; }
.desktop .row { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--line); gap: 8px; }
.desktop .row.on { background: var(--ok-soft); }
.desktop .start { background: #01875f; color: #fff; border-radius: 6px; padding: 3px 12px; font-weight: 700; }
.desktop .bad { color: var(--muted); text-decoration: line-through; }

/* ---------- index page ---------- */
.guide-apps { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); margin: 14px 0; }
.app-box { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; display: flex; flex-direction: column; }
.app-box header { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.app-box header img { width: 52px; height: 52px; border-radius: 14px; border: 1px solid var(--line); }
.app-box header strong { font-size: 18px; display: block; }
.app-box header span { color: var(--muted); font-size: 13px; }
.links { list-style: none; padding: 0; margin: 0; }
.links li { margin: 0; }
.links a { display: flex; align-items: center; gap: 10px; padding: 10px 6px; border-top: 1px solid var(--line); text-decoration: none; color: var(--text); font-weight: 600; }
.links li:first-child a { border-top: 0; }
.links a:hover { color: var(--accent); }
.links a .arrow { margin-left: auto; color: var(--muted); }
.links a small { display: block; font-weight: 400; color: var(--muted); font-size: 13px; }
.apps { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.app-card { border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: flex; gap: 12px; align-items: flex-start; }
.app-card img { width: 48px; height: 48px; border-radius: 12px; }
.app-card p { margin: 2px 0 10px; color: var(--muted); font-size: 14px; }

/* ---------- footer ---------- */
footer.help {
  margin-top: 22px; padding: 22px 16px; border-radius: var(--radius);
  background: var(--card); border: 1px solid var(--line); text-align: center; box-shadow: var(--shadow);
}
footer.help .fb {
  display: inline-flex; align-items: center; gap: 8px; margin: 10px 4px 0; padding: 9px 18px; border-radius: 999px;
  background: #1877f2; color: #fff; font-weight: 700; text-decoration: none;
}
footer.help .all { display: inline-block; margin-top: 14px; font-size: 14px; }
.app-box:target { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow); }
h3 { flex-wrap: nowrap; align-items: flex-start; }
h3 > .ic { margin-top: -2px; }
@media (max-width: 520px) {
  h1 { font-size: 22px; }
  .hero-main { align-items: flex-start; }
  .hero-logo, .hero-icon { width: 52px; height: 52px; border-radius: 14px; font-size: 26px; }
  .flow-step { width: 150px; }
  .phone { height: 268px; border-radius: 22px; padding: 7px; }
  .screen { font-size: 10px; border-radius: 16px; }
  .card { padding: 18px 14px; }
}
/* "Which app" box (_app_family) */
.family { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; margin: 6px 0 10px; }
.family-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-top: 1px solid var(--line); }
.family-row:first-child { border-top: 0; }
.family-row.main { background: var(--ok-soft); }
.family-row.end { opacity: .9; }
.family-row.end strong { text-decoration: line-through; text-decoration-color: var(--warn); }
.family-row img { width: 44px; height: 44px; border-radius: 12px; flex: none; }
.family-row p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.family-row.main p { color: var(--text); margin-bottom: 8px; }
.badge { display: inline-block; font-size: 12px; font-weight: 700; border-radius: 999px; padding: 1px 8px; vertical-align: 1px; background: var(--accent-soft); color: var(--accent); }
.badge.ok { background: var(--ok); color: #fff; }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
@media (prefers-color-scheme: dark) { .badge.ok { color: #0e1219; } }
