/* TMS WhatsApp user guide (/manual). Built on the shared tokens in theme.css. */
.man-body { background: var(--t-bg); color: var(--t-text); font-family: var(--font); margin: 0; line-height: 1.6; }
.man-body * { box-sizing: border-box; }
.man-skip { position: absolute; left: -999px; top: 8px; background: var(--brand); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 60; }
.man-skip:focus { left: 8px; }
.man-progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: var(--brand); z-index: 50; transition: width .1s linear; }

/* ── top bar ── */
.man-top {
  position: sticky; top: 0; z-index: 40; height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 28px; background: rgba(255, 255, 255, .9); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--t-line);
}
.man-brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: var(--t-text); min-width: 0; }
.man-brand-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--brand); color: #fff; display: grid; place-items: center; flex: none; box-shadow: 0 8px 20px -10px rgba(14, 143, 114, .8); }
.man-brand-text b { display: block; font-size: 15px; letter-spacing: -.02em; line-height: 1.15; }
.man-brand-text span { display: block; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--t-faint); }
.man-top-actions { display: flex; align-items: center; gap: 10px; }
.man-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: 10px; font: inherit; font-size: 13px; font-weight: 600;
  text-decoration: none; cursor: pointer; border: 1px solid var(--t-line2); background: var(--t-surface); color: var(--t-text);
}
.man-btn:hover { background: var(--t-elev); }
.man-btn.pri { background: var(--brand); border-color: transparent; color: #fff; box-shadow: 0 8px 20px -12px rgba(14, 143, 114, .9); }
.man-btn.pri:hover { background: var(--brand-hover); }
.man-menu-btn { display: none; }

/* ── layout ── */
.man-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 36px; max-width: 1320px; margin: 0 auto; padding: 28px 28px 80px; }
.man-toc { position: sticky; top: 88px; align-self: start; max-height: calc(100vh - 108px); overflow-y: auto; padding-right: 8px; }
.man-search input {
  width: 100%; height: 38px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--t-line2); background: var(--t-surface); color: var(--t-text); font: inherit; font-size: 13.5px; margin-bottom: 8px;
}
.man-toc h2 { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--t-faint); margin: 20px 0 6px; font-weight: 600; }
.man-toc h2:first-of-type { margin-top: 10px; }
.man-toc a { display: block; padding: 7px 12px; border-radius: 9px; color: var(--t-muted); text-decoration: none; font-size: 14px; font-weight: 500; }
.man-toc a:hover { background: var(--t-surface); color: var(--t-text); }
.man-toc a.active { background: var(--brand-soft); color: var(--brand-ink); font-weight: 600; }
.man-toc a.hide { display: none; }
.man-main { min-width: 0; }

/* ── hero ── */
.man-hero {
  position: relative; overflow: hidden; color: #fff; border-radius: 20px; padding: 44px 44px 36px; margin-bottom: 26px;
  background:
    radial-gradient(520px 320px at 88% 0%, rgba(37, 211, 102, .22), transparent 70%),
    radial-gradient(circle at 1px 1px, rgba(255, 255, 255, .07) 1px, transparent 1.5px) 0 0 / 22px 22px,
    linear-gradient(160deg, #0A2F28 0%, #06201B 100%);
}
.man-hero .eyebrow { font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: rgba(255, 255, 255, .6); }
.man-hero h1 { margin: 10px 0 12px; font-size: 38px; line-height: 1.12; letter-spacing: -.03em; font-weight: 600; }
.man-hero h1 em { font-style: normal; color: var(--wa); }
.man-hero p { margin: 0; max-width: 640px; font-size: 16px; line-height: 1.7; color: rgba(255, 255, 255, .78); }
.man-hero-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin-top: 28px; }
.man-hero-cards a { display: block; padding: 15px 16px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, .22); background: rgba(255, 255, 255, .06); color: #fff; text-decoration: none; transition: background .15s; }
.man-hero-cards a:hover { background: rgba(255, 255, 255, .14); }
.man-hero-cards strong { display: block; font-size: 15px; font-weight: 600; }
.man-hero-cards span { font-size: 12.5px; color: rgba(255, 255, 255, .68); }
.man-demo { margin-top: 20px; font-size: 12.5px; color: rgba(255, 255, 255, .55); }

/* ── sections ── */
.man-sec { background: var(--t-surface); border: 1px solid var(--t-line); border-radius: 16px; padding: 30px 34px; margin-bottom: 20px; scroll-margin-top: 84px; }
.man-sec.hide { display: none; }
.kicker { font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--brand); font-weight: 600; }
.man-sec h2 { margin: 6px 0 8px; font-size: 26px; letter-spacing: -.025em; font-weight: 600; }
.man-sec h3 { margin: 28px 0 8px; font-size: 17px; letter-spacing: -.01em; font-weight: 600; }
.lead { margin: 0 0 8px; font-size: 16px; line-height: 1.75; color: var(--t-muted); max-width: 760px; }
.man-sec p, .man-sec li { font-size: 15px; line-height: 1.75; }
.man-sec ul, .man-sec ol { padding-left: 22px; margin: 8px 0; }
.man-sec li { margin: 5px 0; }
.man-sec li::marker { color: var(--brand); font-weight: 700; }
.man-sec code, .kbd {
  font-family: var(--font-mono); font-size: 12.5px; background: var(--brand-soft); color: var(--brand-ink); padding: 2px 7px; border-radius: 6px;
}
.man-sec strong { font-weight: 600; }

/* steps */
.steps { list-style: none; counter-reset: s; padding: 0 !important; margin: 14px 0 !important; }
.steps > li { counter-increment: s; position: relative; padding: 2px 0 14px 46px; margin: 0; }
.steps > li::before {
  content: counter(s); position: absolute; left: 0; top: 0; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--font-mono); font-size: 13px; font-weight: 600; color: var(--brand-ink); background: var(--brand-soft); border: 1px solid var(--brand-ring);
}
.steps > li:not(:last-child)::after { content: ""; position: absolute; left: 14.5px; top: 34px; bottom: 4px; width: 1px; background: var(--t-line2); }

/* notes */
.note { margin: 16px 0 4px; padding: 14px 16px; border-radius: 12px; font-size: 14px; line-height: 1.65; background: var(--brand-soft); border: 1px solid var(--brand-ring); color: #0b4d3f; }
.note.warn { background: rgba(180, 83, 9, .07); border-color: rgba(180, 83, 9, .25); color: #7a3b08; }
.note.info { background: rgba(14, 116, 144, .07); border-color: rgba(14, 116, 144, .22); color: #0b5568; }
.note b { color: inherit; font-weight: 600; }

/* figures */
.fig { margin: 20px 0 6px; }
.fig img { display: block; width: 100%; height: auto; border: 1px solid var(--t-line2); border-radius: 12px; box-shadow: 0 18px 40px -24px rgba(15, 23, 42, .35); cursor: zoom-in; background: #fff; }
.fig figcaption { margin-top: 9px; font-size: 13px; color: var(--t-faint); text-align: center; }
.fig.narrow { max-width: 620px; }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; align-items: start; }
.phones { display: flex; flex-wrap: wrap; gap: 22px; justify-content: center; margin: 22px 0 6px; }
.phones .fig { margin: 0; width: 220px; }
.phones .fig img { border-radius: 22px; border-width: 5px; border-color: #0C1322; box-shadow: 0 20px 40px -22px rgba(15, 23, 42, .5); }

/* tables */
.tbl-wrap { overflow-x: auto; margin: 12px 0; border: 1px solid var(--t-line); border-radius: 12px; }
.man-table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 520px; }
.man-table th { text-align: left; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--t-faint); padding: 10px 14px; background: var(--t-bg); border-bottom: 1px solid var(--t-line); }
.man-table td { padding: 11px 14px; border-bottom: 1px solid var(--t-line); vertical-align: top; line-height: 1.55; }
.man-table tr:last-child td { border-bottom: none; }

/* chips */
.chip { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap; vertical-align: middle; }
.chip.g { color: #047857; background: rgba(4, 120, 87, .09); }
.chip.a { color: #B45309; background: rgba(180, 83, 9, .09); }
.chip.r { color: #C62828; background: rgba(198, 40, 40, .08); }
.chip.b { color: #0E7490; background: rgba(14, 116, 144, .09); }
.chip.n { color: var(--t-muted); background: rgba(74, 84, 104, .08); }

/* flow diagram */
.flow { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 20px 0 6px; counter-reset: f; }
.flow > div { position: relative; padding: 16px; border-radius: 14px; background: var(--t-bg); border: 1px solid var(--t-line); counter-increment: f; }
.flow > div::before { content: counter(f); display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--brand); color: #fff; font-family: var(--font-mono); font-size: 12px; font-weight: 600; margin-bottom: 10px; }
.flow b { display: block; font-size: 14.5px; margin-bottom: 3px; }
.flow span { font-size: 13px; color: var(--t-muted); line-height: 1.5; display: block; }

/* WhatsApp-style illustration (drawn in CSS, not a screenshot) */
.wa { max-width: 400px; margin: 16px 0; border-radius: 18px; overflow: hidden; border: 1px solid var(--t-line2); box-shadow: 0 18px 40px -24px rgba(15, 23, 42, .35); background: #EFE9E1; }
.wa-bar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: #0A6B56; color: #fff; font-size: 14px; font-weight: 600; }
.wa-bar i { width: 30px; height: 30px; border-radius: 50%; background: rgba(255, 255, 255, .22); display: grid; place-items: center; font-style: normal; font-size: 13px; }
.wa-bar small { display: block; font-weight: 400; font-size: 11px; opacity: .75; }
.wa-body { padding: 14px 12px 16px; display: flex; flex-direction: column; gap: 7px; }
.wa-b { max-width: 84%; padding: 8px 11px 6px; border-radius: 10px; font-size: 13.5px; line-height: 1.45; background: #fff; box-shadow: 0 1px 1px rgba(0, 0, 0, .08); white-space: pre-line; align-self: flex-start; }
.wa-b.me { background: #DDF5C8; align-self: flex-end; }
.wa-b time { display: block; text-align: right; font-size: 10.5px; color: #7b8794; margin-top: 2px; }
.wa-cap { font-size: 12.5px; color: var(--t-faint); margin-top: -8px; margin-bottom: 14px; }

/* misc */
.man-foot { text-align: center; color: var(--t-faint); font-size: 13px; padding: 14px 0 0; }
.man-foot a { color: var(--brand-ink); font-weight: 600; text-decoration: none; }
.man-lightbox { position: fixed; inset: 0; z-index: 80; background: rgba(12, 19, 34, .86); display: none; align-items: center; justify-content: center; padding: 24px; cursor: zoom-out; }
.man-lightbox.open { display: flex; }
.man-lightbox img { max-width: 100%; max-height: 100%; border-radius: 10px; box-shadow: 0 30px 80px rgba(0, 0, 0, .5); background: #fff; }
.man-empty { display: none; padding: 30px; text-align: center; color: var(--t-faint); background: var(--t-surface); border: 1px dashed var(--t-line2); border-radius: 16px; }
.man-empty.show { display: block; }

/* ── responsive ── */
@media (max-width: 980px) {
  .man-layout { grid-template-columns: minmax(0, 1fr); padding: 18px 16px 60px; gap: 0; }
  .man-top { padding: 0 14px; }
  .man-menu-btn { display: inline-flex; }
  .man-toc {
    position: fixed; z-index: 70; top: 0; left: 0; bottom: 0; width: 300px; max-width: 88vw; max-height: none; background: var(--t-surface); padding: 18px 14px 24px;
    transform: translateX(-102%); transition: transform .25s ease; box-shadow: none; border-right: 1px solid var(--t-line);
  }
  body.toc-open .man-toc { transform: none; box-shadow: 10px 0 40px rgba(0, 0, 0, .25); }
  .man-scrim { display: none; position: fixed; inset: 0; z-index: 65; background: rgba(12, 19, 34, .45); }
  body.toc-open .man-scrim { display: block; }
  .man-hero { padding: 28px 22px 24px; border-radius: 16px; }
  .man-hero h1 { font-size: 29px; }
  .man-sec { padding: 22px 18px; border-radius: 14px; }
  .man-sec h2 { font-size: 22px; }
  .two { grid-template-columns: minmax(0, 1fr); }
  .man-top-actions .man-btn.hide-m { display: none; }
}
@media (max-width: 480px) {
  .man-brand-text span { display: none; }
  .man-top-actions { gap: 8px; }
  .man-btn { padding: 0 11px; }
  .phones .fig { width: 46%; min-width: 150px; }
}
@media print {
  .man-top, .man-toc, .man-progress, .man-scrim { display: none !important; }
  .man-layout { display: block; padding: 0; }
  .man-sec { break-inside: avoid; border-color: #ccc; }
  .man-hero { background: #0A2F28 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .man-body, .man-sec, .man-table th { background: #fff !important; color: #0C1322 !important; }
  .man-sec p, .man-sec li, .lead, .man-table td { color: #0C1322 !important; }
}

/* ── light / dark switch in the top bar ── */
.man-top-actions #theme-toggle { margin-left: 0; height: 36px; width: 36px; }
@media (max-width: 400px) {
  /* brand mark only: the name plus Contents, Sign in and the switch overflow a 360px phone */
  .man-brand-text { display: none; }
}

/* ── dark mode (tokens come from theme.css; these are the hard-coded tints) ── */
:root[data-theme="dark"] .man-top { background: rgba(18, 25, 38, .88); }
:root[data-theme="dark"] .man-btn.pri { color: #fff; }
:root[data-theme="dark"] .man-toc a.active { color: var(--brand-ink); }
:root[data-theme="dark"] .note { color: #A7F3D0; }
:root[data-theme="dark"] .note a { color: #6EE7B7; }
:root[data-theme="dark"] .note.warn { background: rgba(251, 191, 36, .10); border-color: rgba(251, 191, 36, .28); color: #FDE68A; }
:root[data-theme="dark"] .note.info { background: rgba(34, 211, 238, .09); border-color: rgba(34, 211, 238, .26); color: #A5F3FC; }
:root[data-theme="dark"] .chip.g { color: #34D399; background: rgba(52, 211, 153, .14); }
:root[data-theme="dark"] .chip.a { color: #FBBF24; background: rgba(251, 191, 36, .14); }
:root[data-theme="dark"] .chip.r { color: #F87171; background: rgba(248, 113, 113, .14); }
:root[data-theme="dark"] .chip.b { color: #22D3EE; background: rgba(34, 211, 238, .13); }
:root[data-theme="dark"] .chip.n { color: var(--t-muted); background: rgba(255, 255, 255, .08); }
:root[data-theme="dark"] .man-sec a, :root[data-theme="dark"] .man-foot a { color: var(--brand-ink); }
:root[data-theme="dark"] .phones .fig img { border-color: #2A3448; }
:root[data-theme="dark"] .fig img { box-shadow: 0 18px 40px -24px rgba(0, 0, 0, .7); }
/* the WhatsApp illustrations keep WhatsApp's own light look, only the frame dims */
:root[data-theme="dark"] .wa { border-color: var(--t-line2); }

/* links inside the guide used the browser's default blue, off-brand next to
   the emerald UI (and too dark to read on the dark theme) */
.man-sec a, .note a { color: var(--brand-ink); font-weight: 600; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
.man-sec a:hover { color: var(--brand); }
