/* Shared by /how-to-use (public) and /tutorials (in-app). Explicit colours so theme dark mode can't break contrast. */
.howto { --hw-ink: #171427; --hw-muted: #5b5870; --hw-line: rgba(23,20,39,.10); --hw-violet: #7C3AED; --hw-violet-dark: #5b21b6; --hw-soft: #f4f0ff; --hw-radius: 16px; --hw-shadow: 0 1px 2px rgba(15,23,42,.04), 0 8px 24px rgba(15,23,42,.06); color: var(--hw-ink); }
.howto *:focus-visible { outline: 3px solid var(--hw-violet); outline-offset: 3px; border-radius: 6px; }
.howto-container { max-width: 1200px; margin: 0 auto; padding: 0 20px 56px; }
.howto--app .howto-container { padding: 0 0 32px; }

/* Hero */
.howto-hero { background: radial-gradient(1200px 400px at 85% -10%, rgba(124,58,237,.45), transparent 60%), linear-gradient(135deg, #0B1020 0%, #1e1b4b 60%, #312e81 100%); color: #fff; padding: 72px 20px 64px; }
.howto--app .howto-hero { border-radius: var(--hw-radius); padding: 40px 32px; margin-bottom: 28px; }
.howto-hero__inner { max-width: 1160px; margin: 0 auto; }
.howto--app .howto-hero__inner { max-width: none; }
.howto-hero__eyebrow { display: inline-flex; gap: 6px; align-items: center; padding: 6px 12px; border-radius: 999px; background: rgba(255,255,255,.10); border: 1px solid rgba(255,255,255,.18); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #e9e3ff; }
.howto-hero__title { color: #fff; font-weight: 800; font-size: clamp(2rem, 1.4rem + 2.6vw, 3.4rem); line-height: 1.08; margin: 18px 0 14px; }
.howto-hero__value { color: #d7d3ea; font-size: clamp(1rem, .95rem + .3vw, 1.2rem); line-height: 1.6; max-width: 720px; margin: 0 0 26px; }
.howto-hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 24px; }
.howto-hero__chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0; }
.howto-hero__chips li { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: rgba(255,255,255,.08); color: #ecfdf5; font-size: 13px; font-weight: 600; }
.howto-hero__chips i { color: #34d399; }
.howto-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 12px 22px; border-radius: 12px; font-weight: 700; font-size: 15px; text-decoration: none; border: 1px solid transparent; cursor: pointer; transition: transform .15s ease, background .15s ease; }
.howto-btn--primary { background: linear-gradient(135deg, #7C3AED, #4f46e5); color: #fff; box-shadow: 0 8px 20px rgba(124,58,237,.35); }
.howto-btn--primary:hover { color: #fff; transform: translateY(-1px); }
.howto-btn--ghost { background: rgba(255,255,255,.08); color: #fff; border-color: rgba(255,255,255,.28); }
.howto-btn--ghost:hover { background: rgba(255,255,255,.16); }
.howto .howto-hero *:focus-visible { outline-color: #c4b5fd; }

/* Paths */
.howto-section-title { font-size: clamp(1.4rem, 1.2rem + .8vw, 1.9rem); font-weight: 800; color: var(--hw-ink); margin: 0 0 18px; }
.howto-paths { margin: 40px 0 36px; }
.howto--app .howto-paths { margin-top: 0; }
.howto-paths__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.howto-path { display: flex; flex-direction: column; gap: 8px; padding: 22px; border-radius: var(--hw-radius); background: #fff; border: 1px solid var(--hw-line); box-shadow: var(--hw-shadow); color: var(--hw-ink); text-decoration: none; transition: transform .15s ease, border-color .15s ease; }
.howto-path:hover { transform: translateY(-2px); border-color: var(--hw-violet); color: var(--hw-ink); }
.howto-path__icon { width: 44px; height: 44px; border-radius: 12px; background: var(--hw-soft); color: var(--hw-violet); display: inline-flex; align-items: center; justify-content: center; font-size: 22px; }
.howto-path__title { font-size: 1.1rem; font-weight: 800; margin: 4px 0 0; color: var(--hw-ink); }
.howto-path__text { color: var(--hw-muted); margin: 0; font-size: 14px; line-height: 1.55; flex: 1; }
.howto-path__range { color: var(--hw-violet-dark); font-weight: 700; font-size: 14px; }

/* Layout + TOC */
.howto-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 28px; align-items: start; }
.howto-aside { position: sticky; top: 90px; display: flex; flex-direction: column; gap: 14px; }
.howto-toc { background: #fff; border: 1px solid var(--hw-line); border-radius: var(--hw-radius); padding: 14px; box-shadow: var(--hw-shadow); }
.howto-toc__heading { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--hw-muted); margin: 4px 8px 8px; }
.howto-toc ol { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 2px; }
.howto-toc a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; color: #334155; font-size: 14px; font-weight: 600; text-decoration: none; }
.howto-toc a:hover { background: #f8fafc; color: var(--hw-ink); }
.howto-toc a.is-active { background: var(--hw-soft); color: var(--hw-violet-dark); }
.howto-toc__num { flex: none; width: 24px; height: 24px; border-radius: 999px; background: #eef2f7; color: #475569; font-size: 12px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.howto-toc a.is-active .howto-toc__num { background: var(--hw-violet); color: #fff; }
.howto-toc__label { flex: 1; }
.howto-toc__done { display: none; color: #059669; }
.howto-toc a.is-done .howto-toc__done { display: inline; }
.howto-progress { background: #fff; border: 1px solid var(--hw-line); border-radius: var(--hw-radius); padding: 16px; box-shadow: var(--hw-shadow); }
.howto-progress__head { display: flex; justify-content: space-between; align-items: baseline; font-size: 14px; color: var(--hw-ink); margin-bottom: 10px; }
.howto-progress__head span { color: var(--hw-muted); font-size: 13px; }
.howto-progress__bar { height: 8px; border-radius: 999px; background: #eef2f7; overflow: hidden; }
.howto-progress__bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #7C3AED, #10b981); transition: width .3s ease; }

/* Steps */
.howto-steps { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.howto-step { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; align-items: start; padding: 28px; border: 1px solid var(--hw-line); border-radius: var(--hw-radius); background: #fff; color: var(--hw-ink); box-shadow: var(--hw-shadow); scroll-margin-top: 90px; }
.howto-step--text { grid-template-columns: minmax(0, 1fr); }
.howto-step:target { border-color: var(--hw-violet); box-shadow: 0 0 0 3px rgba(124,58,237,.15), var(--hw-shadow); }
.howto-step__meta { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.howto-step__badge { width: 36px; height: 36px; border-radius: 12px; background: linear-gradient(135deg, #7C3AED, #4f46e5); color: #fff; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.howto-step__time { font-size: 13px; color: var(--hw-muted); font-weight: 600; }
.howto-step__title { font-size: 1.45rem; font-weight: 800; margin: 0 0 8px; color: var(--hw-ink); }
.howto-step__doing { color: var(--hw-muted); margin: 0 0 14px; }
.howto-step__doing strong { color: var(--hw-ink); }
.howto-step__list { list-style: none; counter-reset: sub; padding: 0; margin: 0 0 4px; }
.howto-step__list li { counter-increment: sub; position: relative; padding-left: 38px; margin-bottom: 12px; line-height: 1.65; color: #334155; }
.howto-step__list li::before { content: counter(sub); position: absolute; left: 0; top: 1px; width: 26px; height: 26px; border-radius: 999px; background: var(--hw-soft); color: var(--hw-violet-dark); font-size: 13px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.howto-step a:not(.howto-btn), .howto-faq a, .howto-callout a, .howto-video__caption a { color: var(--hw-violet-dark); }
.howto:not(.howto--app) { background: #F7F7FC; }
.howto code { background: #f1f5f9; padding: 1px 6px; border-radius: 6px; color: #0f172a; font-size: .9em; }
.ui-chip { display: inline-block; padding: 1px 8px; border: 1px solid #d6d3e6; border-bottom-width: 2px; border-radius: 6px; background: #faf9ff; color: var(--hw-ink, #171427); font-size: .88em; font-weight: 700; white-space: nowrap; }
.howto-callout { margin: 14px 0 4px; padding: 12px 14px; border-radius: 12px; background: #eef6ff; border-left: 4px solid #3b82f6; color: #1e3a5f; font-size: 14px; line-height: 1.6; }
.howto-callout--warn { background: #fff7ed; border-left-color: #f59e0b; color: #78350f; }
.howto-code { margin-top: 14px; border-radius: 12px; overflow: hidden; background: #0f172a; border: 1px solid #1e293b; }
.howto-code__bar { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; background: #111c33; color: #cbd5e1; font-size: 12px; font-weight: 700; }
.howto-code__copy { border: 1px solid #334155; background: transparent; color: #e2e8f0; border-radius: 8px; padding: 4px 10px; font-size: 12px; font-weight: 700; cursor: pointer; }
.howto-code__copy:hover { background: #1e293b; }
.howto-code pre { margin: 0; padding: 14px; overflow-x: auto; }
.howto-code pre code { background: none; color: #e2e8f0; padding: 0; font-size: 13px; line-height: 1.6; white-space: pre; }
.howto-step__foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-top: 16px; }
.howto-step__links { display: flex; flex-wrap: wrap; gap: 16px; }
.howto-step__link { font-weight: 700; text-decoration: none; }
.howto-step__link:hover { text-decoration: underline; }
.howto-done { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; color: #334155; cursor: pointer; padding: 6px 12px; border: 1px solid var(--hw-line); border-radius: 10px; }
.howto-done input { width: 18px; height: 18px; accent-color: #7C3AED; }

/* Video */
.howto-step__media { display: flex; flex-direction: column; gap: 16px; }
.howto-video { margin: 0; }
.howto-video__play, .howto-video__frame { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; padding: 0; border: 0; border-radius: 14px; overflow: hidden; background: #0B1020; cursor: pointer; box-shadow: 0 10px 30px rgba(15,23,42,.18); }
.howto-video__play img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s ease; }
.howto-video__play:hover img { transform: scale(1.04); }
.howto-video__icon { position: absolute; inset: 0; margin: auto; width: 72px; height: 72px; border-radius: 999px; background: rgba(124,58,237,.95); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 34px; box-shadow: 0 0 0 8px rgba(255,255,255,.25), 0 10px 24px rgba(0,0,0,.35); transition: transform .15s ease; }
.howto-video__play:hover .howto-video__icon { transform: scale(1.08); }
.howto-video__duration { position: absolute; right: 10px; bottom: 10px; padding: 3px 8px; border-radius: 6px; background: rgba(0,0,0,.78); color: #fff; font-size: 12px; font-weight: 700; }
.howto-video__frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.howto-video__caption { font-size: 13px; color: var(--hw-muted); margin: 10px 2px 0; line-height: 1.5; }

/* FAQ + CTA */
.howto-faq { margin-top: 56px; }
.howto-faq__list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.howto-faq__item { background: #fff; border: 1px solid var(--hw-line); border-radius: 14px; box-shadow: var(--hw-shadow); }
.howto-faq__item summary { cursor: pointer; padding: 16px 18px; font-weight: 700; color: var(--hw-ink); list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.howto-faq__item summary::-webkit-details-marker { display: none; }
.howto-faq__item summary::after { content: '+'; color: var(--hw-violet); font-size: 20px; line-height: 1; }
.howto-faq__item[open] summary::after { content: '–'; }
.howto-faq__answer { padding: 0 18px 16px; color: #334155; line-height: 1.6; }
.howto-cta { margin-top: 48px; padding: 40px 28px; border-radius: 20px; text-align: center; color: #fff; background: radial-gradient(800px 300px at 50% -20%, rgba(124,58,237,.55), transparent 60%), linear-gradient(135deg, #0B1020, #312e81); }
.howto-cta__title { color: #fff; font-weight: 800; font-size: clamp(1.4rem, 1.2rem + 1vw, 2rem); margin: 0 0 8px; }
.howto-cta p { color: #d7d3ea; margin: 0 0 20px; }

/* Responsive */
@media (max-width: 1199.98px) { .howto--app .howto-layout { grid-template-columns: minmax(0, 1fr); } .howto--app .howto-aside { position: static; } }
@media (max-width: 991.98px) {
  .howto-layout { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .howto-aside { position: sticky; top: 0; z-index: 5; gap: 8px; }
  .howto--app .howto-aside { position: static; }
  .howto-toc { padding: 8px; border-radius: 14px; }
  .howto-toc__heading { display: none; }
  .howto-toc ol { flex-direction: row; overflow-x: auto; gap: 6px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .howto-toc ol::-webkit-scrollbar { display: none; }
  .howto-toc a { white-space: nowrap; border: 1px solid var(--hw-line); border-radius: 999px; padding: 6px 12px 6px 6px; font-size: 13px; }
  .howto-step { grid-template-columns: minmax(0, 1fr); padding: 20px; gap: 18px; }
  .howto-step__media { order: -1; }
  .howto-paths__grid, .howto-faq__list { grid-template-columns: minmax(0, 1fr); }
  .howto-hero { padding: 48px 18px 40px; }
  .howto--app .howto-hero { padding: 28px 20px; }
}
@media (max-width: 575.98px) { .howto-hero__actions .howto-btn { width: 100%; } .howto-container { padding: 0 14px 40px; } }
@media (prefers-reduced-motion: reduce) { .howto *, .howto *::before, .howto *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }

/* Small "Watch how" deep links on other pages */
.howto-watch-link { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 700; color: #7C3AED; text-decoration: none; }
.howto-watch-link:hover { text-decoration: underline; }

/* In-app content area is narrower (sidebar + TOC): stack video above text so it stays large. */
@media (max-width: 1499.98px) {
  .howto--app .howto-step { grid-template-columns: minmax(0, 1fr); }
  .howto--app .howto-step__media { order: -1; max-width: 720px; }
}
