/* rx-tutorial.css - the Tutorial page (Assets/tutorial.html): the module cards, search, and each module's guides
   above its chapter of the user's manual. Builds on rx-home.css and rx-manual.css; same dark glass, white text, orange accent. */
.hm--tutx { grid-template-rows: auto minmax(0, 1fr) auto; }
.hm--tutx .hm-tut { align-self: start; }
.hm--tutx .hm-pill[hidden] { display: none; }
[hidden] { display: none !important; }

/* search on the Tutorial home */
.tut-find { position: relative; margin: 0 0 18px; max-width: 640px; }
.tut-find svg { position: absolute; left: 14px; top: 50%; width: 18px; height: 18px; margin-top: -9px; fill: none; stroke: var(--ink2); stroke-width: 1.7; stroke-linecap: round; pointer-events: none; }
.tut-find input { width: 100%; box-sizing: border-box; height: 46px; padding: 0 16px 0 42px; border-radius: 999px; border: 1px solid var(--ctl-line); background: var(--field); color: var(--ink); font: 400 15px var(--font); outline: none; }
.tut-find input::placeholder { color: var(--placeholder); }
.tut-find input:focus-visible { border-color: var(--ac); box-shadow: 0 0 0 2px rgba(var(--ac-rgb),.35); }
.tut-find--toc { margin: 0 0 10px; }
.tut-find--toc input { height: 40px; font-size: 14px; }

.tut-hits { display: grid; gap: 8px; margin: 0 0 8px; }
.tut-hits__n { margin: 0 0 4px !important; font-size: 14px !important; color: var(--ink2); }
.tut-hit { display: block; padding: 12px 16px; border-radius: 16px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); color: var(--ink); text-decoration: none; }
.tut-hit:hover { box-shadow: inset 0 0 0 1px var(--line-hover); background: var(--tint); }
.tut-hit:focus-visible { outline: 2px solid var(--ac-text); outline-offset: 2px; }
.tut-hit b { display: block; font-weight: 500; font-size: 15px; }
.tut-hit small { display: block; margin-top: 2px; font-size: 12.5px; color: var(--ac-text); }
.tut-hit span { display: block; margin-top: 4px; font-size: 13.5px; line-height: 1.45; color: var(--ink2); }
.tut-hit mark { background: none; color: var(--ink); font-weight: 500; text-decoration: underline; text-decoration-color: var(--ac-text); text-underline-offset: 2px; }

/* the reading view: contents on the left fold away on phones */
.man-toc details > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; margin: 0 0 8px 6px; font-weight: 500; }
.man-toc details > summary::-webkit-details-marker { display: none; }
.man-toc details > summary::after { content: ""; width: 8px; height: 8px; margin-right: 6px; border-right: 1.6px solid var(--ink2); border-bottom: 1.6px solid var(--ink2); transform: rotate(45deg); transition: transform .15s; }
.man-toc details[open] > summary::after { transform: rotate(-135deg); }
.man-toc__group { display: block; margin: 12px 0 4px 10px; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--ink2); }
.man-toc a.man-toc__back { color: var(--ink2); }
.man-toc { max-height: calc(100vh - 32px); overflow: auto; scrollbar-width: thin; scrollbar-color: var(--scroll) transparent; }

/* which parts show in each view */
.hm--tutx[data-view="full"] .tut-guide { display: none; }
.hm--tutx[data-view="module"] .man-doc > h1, .hm--tutx[data-view="module"] .man-lead { display: none; }
.hm--tutx[data-view="module"] .man-doc section { margin-top: 0; padding-top: 0; border-top: 0; }
.tut-crumb { margin: 0 0 14px !important; font-size: 13.5px; color: var(--ink2); }
.tut-crumb a { color: var(--ink2) !important; }

/* English or Taglish: a guide written in both shows the chosen one; one in English only shows in both */
html:not([data-tutlang="fil"]) .tut-guide [lang="fil"], html[data-tutlang="fil"] .tut-guide [lang="en"] { display: none !important; }
.tut-langbar { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; font-size: 13.5px; color: var(--ink2); }
.tut-hub-lang { margin: -6px 0 18px; }

/* a module's guides */
.tut-guide { margin: 6px 0 0; }
.tut-for { margin: 8px 0 4px !important; color: var(--ink2); }
.tut-for b { color: var(--ink); }
.tut-how, .tut-q { margin: 8px 0; border-radius: 18px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); scroll-margin-top: 16px; }
.tut-how > summary, .tut-q > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 8px 16px; border-radius: 18px; font-weight: 500; }
.tut-how > summary::-webkit-details-marker, .tut-q > summary::-webkit-details-marker { display: none; }
.tut-how > summary::before { content: ""; flex: none; width: 30px; height: 30px; border-radius: 10px; background: var(--ac) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 7l5 5-5 5'/%3E%3C/svg%3E") center / 18px no-repeat; transition: transform .15s; }
.tut-how[open] > summary::before { transform: rotate(90deg); }
.tut-q > summary { font-weight: 400; }
.tut-q > summary::after { content: "+"; margin-left: auto; color: var(--ac-text); font-size: 20px; line-height: 1; }
.tut-q[open] > summary::after { content: "\2212"; }
.tut-how > summary:hover, .tut-q > summary:hover { background: var(--tint); }
.tut-how > summary:focus-visible, .tut-q > summary:focus-visible { outline: 2px solid var(--ac-text); outline-offset: 2px; }
.tut-how > :not(summary), .tut-q > :not(summary) { margin-left: 16px !important; margin-right: 16px !important; }
.tut-how > ol { counter-reset: q; list-style: none; padding-left: 0 !important; }
.tut-how > ol > li { counter-increment: q; position: relative; padding-left: 40px; margin: 10px 0; }
.tut-how > ol > li::before { content: counter(q); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%; background: var(--tint-2); color: var(--ink); font-weight: 500; font-size: 13.5px; line-height: 28px; text-align: center; }
.tut-how > ol > li.is-saying::before { background: var(--ac); color: #fff; }
.tut-q > p { margin: 0 0 14px !important; color: var(--ink2); }
.tut-more { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 4px 0 14px !important; font-size: 14px; }
.tut-listen { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border: 1px solid var(--ctl-line); border-radius: 999px; background: var(--ctl); color: var(--ink); font: 500 13.5px var(--font); cursor: pointer; }
.tut-listen:hover { border-color: var(--line-hover); }
.tut-listen:focus-visible { outline: 2px solid var(--ac-text); outline-offset: 2px; }
.tut-listen svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tut-listen.is-on { background: var(--ac); border-color: var(--ac); color: #fff; }
.tut-manhead { margin-top: 30px !important; padding-top: 18px; border-top: 1px solid var(--line); font-size: 13px !important; letter-spacing: .04em; text-transform: uppercase; color: var(--ink2); }

/* Other ways: a second route through a step, such as typing a brand when there is no barcode */
.tut-other, .tut-pop__other { margin-top: 10px; padding: 10px 14px; border-radius: 14px; background: var(--tint); font-size: 14.5px; }
.tut-other > b { font-weight: 500; }
.tut-other ul, .tut-pop__other ul { margin: 4px 0 0 !important; padding-left: 20px !important; }
.tut-pop__other { margin-top: 12px; }
.tut-pop__otherhead { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tut-pop__other h3 { margin: 0; font-size: 15px; font-weight: 500; }
.tut-pop__other li { margin: 4px 0; line-height: 1.5; }
.tut-pop__other li::marker { color: var(--ac-text); }
.tut-pop__say svg { fill: none; }

/* pictures and short videos in a guide: loaded only when the guide is opened */
.tut-media { margin: 10px 16px 12px !important; }
.tut-media img, .tut-media video { display: block; width: 100%; height: auto; max-height: 70vh; object-fit: contain; border-radius: 14px; background: rgba(0,0,0,.35); box-shadow: inset 0 0 0 1px var(--line); }
.tut-media figcaption { margin-top: 6px; font-size: 13px; color: var(--ink2); }
.tut-media--phone img, .tut-media--phone video { max-width: 320px; margin: 0 auto; }

/* a guide with a video: Watch opens it in a pop-up, text beside the video */
.tut-watch { margin-left: auto; display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 12px; border-radius: 999px; background: var(--ac); color: #fff; font-size: 12.5px; font-weight: 500; }
.tut-watch svg, .tut-pop svg { width: 15px; height: 15px; fill: currentColor; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.tut-pop__again svg { fill: none; }
.tut-pop__play svg, .tut-pop__big svg { fill: currentColor; }
html.tut-locked { overflow: hidden; }
.tut-pop { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 16px; background: var(--scrim); }
.tut-pop__card { width: min(1180px, 100%); max-height: calc(100dvh - 32px); overflow: auto; padding: 20px 22px 22px; border-radius: 28px; box-sizing: border-box; color: var(--ink); background: var(--solid); }
.tut-pop__head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.tut-pop__head h2 { margin: 0 auto 0 0; font-size: 22px; font-weight: 400; letter-spacing: -.01em; }
.tut-lang { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--field); box-shadow: inset 0 0 0 1px var(--ctl-line); }
.tut-lang button { height: 34px; padding: 0 14px; border: 0; border-radius: 999px; background: none; color: var(--ink); font: 500 13.5px var(--font); cursor: pointer; }
.tut-lang button[aria-pressed="true"] { background: var(--ac); color: #fff; }
.tut-lang button:focus-visible, .tut-pop__x:focus-visible, .tut-pop__steps button:focus-visible, .tut-pop__big:focus-visible { outline: 2px solid var(--ac-text); outline-offset: 2px; }
.tut-pop__x { flex: none; width: 40px; height: 40px; border: 1px solid var(--ctl-line); border-radius: 50%; background: var(--ctl); color: var(--ink); font: 300 24px/1 var(--font); cursor: pointer; }
.tut-pop__body { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(260px, 1fr); gap: 20px; align-items: start; }
.tut-pop__frame { position: relative; border-radius: 16px; overflow: hidden; background: #000; box-shadow: inset 0 0 0 1px var(--line); }
.tut-pop__frame video { display: block; width: 100%; height: auto; aspect-ratio: 1280 / 760; cursor: pointer; }
.tut-pop__big { position: absolute; left: 50%; top: 50%; width: 68px; height: 68px; margin: -34px 0 0 -34px; border: 0; border-radius: 50%; background: var(--ac); color: #fff; display: grid; place-items: center; cursor: pointer; box-shadow: 0 8px 24px rgba(0,0,0,.45); }
.tut-pop__big svg { width: 28px; height: 28px; margin-left: 3px; }
.tut-pop__cap { position: absolute; left: 12px; right: 12px; bottom: 12px; margin: 0; padding: 8px 12px; border-radius: 12px; background: rgba(8,9,12,.78); color: #fff; font-size: 15px; line-height: 1.4; text-align: center; pointer-events: none; }
.tut-pop__cap:empty { display: none; }
.tut-pop__bar { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.tut-pop__fwd svg { fill: currentColor; }
.tut-pop__again:disabled, .tut-pop__fwd:disabled { opacity: .4; cursor: default; }
.tut-pop__where { margin-left: auto; font-size: 13px; color: var(--ink2); font-variant-numeric: tabular-nums; }
.tut-pop__play.is-next { background: var(--ac); border-color: var(--ac); color: #fff; }
.tut-pop__play svg, .tut-pop__again svg { fill: none; }
.tut-pop__play.is-next svg, .tut-pop__play:not(.is-next) svg path[d^="M8 5.5v13l"] { fill: currentColor; }
.tut-pop__steps li.is-done button::before { content: "\2713"; background: rgba(var(--ac-rgb),.35); color: #fff; }
.tut-pop__text { font-size: 15px; line-height: 1.55; }
.tut-pop__lead { margin: 0 0 10px; color: var(--ink2); }
.tut-pop__steps { counter-reset: q; list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.tut-pop__steps li { counter-increment: q; }
.tut-pop__steps button { position: relative; display: block; width: 100%; padding: 10px 12px 10px 50px; border: 0; border-radius: 14px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); color: var(--ink); font: 400 15px/1.5 var(--font); text-align: left; cursor: pointer; }
.tut-pop__steps button::before { content: counter(q); position: absolute; left: 12px; top: 10px; width: 26px; height: 26px; border-radius: 50%; background: var(--tint-2); font-weight: 500; font-size: 13px; line-height: 26px; text-align: center; }
.tut-pop__steps li.is-on button { background: rgba(var(--ac-rgb),.16); box-shadow: inset 0 0 0 1px var(--ac); }
.tut-pop__steps li.is-on button::before { background: var(--ac); color: #fff; }
.tut-pop__steps b { font-weight: 500; }
.tut-pop__note { margin: 10px 0 0; font-size: 13px; color: var(--ink2); }
@media (max-width: 860px) {
  .tut-pop { padding: 0; align-items: stretch; }
  .tut-pop__card { max-height: none; height: 100dvh; border-radius: 0; padding: 14px 14px 20px; }
  .tut-pop__head { flex-wrap: wrap; }
  .tut-pop__head h2 { flex: 1 1 100%; order: 3; font-size: 19px; }
  .tut-lang { margin-right: auto; }
  .tut-pop__body { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .tut-pop__media { position: sticky; top: -14px; z-index: 1; padding-top: 4px; background: var(--solid); }
  .tut-pop__cap { display: none; }   /* on a phone the lit step below is the caption, so the video stays clear */
  .tut-pop__big { width: 56px; height: 56px; margin: -28px 0 0 -28px; }
}

/* the top bar stays at the top while the page scrolls; beside the text, the side panel stays put and scrolls inside itself.
   --tut-bar is the bar's bottom edge plus a gap, set by rx-tutorial.js */
.hm--tutx > .hm-bar { position: sticky; top: max(8px, env(safe-area-inset-top, 0px)); z-index: 50; }
.hm--tutx .man-toc { top: var(--tut-bar, 84px); max-height: calc(100vh - var(--tut-bar, 84px) - 16px); }
.hm--tutx .man-doc section, .hm--tutx .man-doc h3, .hm--tutx .man-doc h4, .hm--tutx .tut-how, .hm--tutx .tut-q { scroll-margin-top: var(--tut-bar, 84px); }

/* nine cards: the last row keeps its cards at card width.
   Phones: only the top bar stays; the side panel sits above the text (folded), so it does not cover the guide */
@media (orientation: portrait), (max-width: 760px) {
  .hm--tutx { grid-template-rows: none; }
  .man-toc { max-height: none; overflow: visible; }
  .hm--tutx .man-toc { position: static; max-height: none; }
  .tut-find input { height: 48px; }
  .tut-how > summary, .tut-q > summary { padding: 8px 12px; }
  .tut-how > :not(summary), .tut-q > :not(summary) { margin-left: 12px !important; margin-right: 12px !important; }
  .tut-media { margin: 10px 12px 12px !important; }
}

@media print {
  .tut-find, .tut-hits, .tut-listen, .tut-crumb { display: none !important; }
  .tut-how, .tut-q { box-shadow: none; background: none; }
  .tut-how > ol > li::before { background: none; box-shadow: inset 0 0 0 1px #999; color: #000; }
  .tut-media { display: none; }
}
