/* ============================================================
   TotePath help site.
   Same family as the marketing site: white paper, dark ink, copper
   as the one brand colour, Libre Franklin, hairline rules, no
   animation. Tuned for reading: a 40rem text column, large type for
   bench PCs, steps joined by a copper route line, quiet callouts.
   ============================================================ */

:root {
  --paper:  #ffffff;
  --band:   #f3f5f7;
  --ink:    #1b2030;
  --body:   #3f4756;
  --quiet:  #5d6574;
  --rule:   #d5dae1;
  --copper: #cf6b2c;
  --link:   #a84e17;
  --link-deep: #8a3f11;

  --note-bg: #f1f4f8;   --note-bar: #4a5f7d;
  --tip-bg:  #eef6f1;   --tip-bar:  #2f7550;
  --warn-bg: #fdf3e6;   --warn-bar: #b3560f;

  --font: 'Libre Franklin', 'Franklin Gothic Medium', 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  --header-h: 64px;
  --side-w: 264px;
  --toc-w: 216px;
  --radius: 6px;
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 20px); }

body {
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.65;
  color: var(--body);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { color: var(--ink); font-weight: 700; letter-spacing: -0.015em; text-wrap: balance; }
h1 { font-size: clamp(2rem, 4vw, 2.7rem); line-height: 1.1; letter-spacing: -0.025em; }
h2 { font-size: 1.55rem; line-height: 1.25; }
h3 { font-size: 1.15rem; line-height: 1.35; letter-spacing: 0; }
p { text-wrap: pretty; }
b, strong { color: var(--ink); font-weight: 600; }

a { color: var(--link); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--copper); outline-offset: 2px; border-radius: 2px; }

img, svg, video { display: block; max-width: 100%; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 12px; background: var(--paper); padding: 8px 12px; z-index: 50; border: 2px solid var(--copper); }

/* ----------------------------- header ----------------------------- */
.hdr { position: sticky; top: 0; z-index: 30; background: var(--paper); border-bottom: 1px solid var(--rule); }
.hdr__in { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; min-height: var(--header-h); padding: 8px 24px; max-width: 1400px; margin-inline: auto; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 20px; letter-spacing: -0.02em; color: var(--ink); text-decoration: none; white-space: nowrap; }
.brand svg { width: 28px; height: 28px; }
.brand__help { font-weight: 500; color: var(--quiet); padding-left: 12px; margin-left: 2px; border-left: 1px solid var(--rule); }
.hdr__links { display: flex; align-items: center; gap: 22px; margin-left: auto; white-space: nowrap; }
.hdr__links a { color: var(--body); font-size: 15px; font-weight: 500; text-decoration: none; }
.hdr__links a:hover { color: var(--ink); text-decoration: underline; }
.hdr__links a.signin { color: var(--ink); }
.menu-btn { display: none; font: inherit; font-size: 15px; font-weight: 600; color: var(--ink); background: transparent; border: 1px solid #9aa2ae; border-radius: var(--radius); padding: 7px 12px; cursor: pointer; }
.menu-btn:hover { background: var(--band); border-color: var(--ink); }

/* ----------------------------- search ----------------------------- */
.search { position: relative; flex: 1 1 280px; max-width: 420px; }
.search[hidden] { display: none; }
.search__input { width: 100%; font: inherit; font-size: 15px; color: var(--ink); background: var(--band); border: 1px solid transparent; border-radius: var(--radius); padding: 9px 38px 9px 36px; }
.search__input::placeholder { color: var(--quiet); }
.search__input:hover { border-color: var(--rule); }
.search__input:focus { background: #fff; border-color: var(--ink); outline: 2px solid var(--copper); outline-offset: 1px; }
.search__input::-webkit-search-cancel-button { display: none; }
.search__icon { position: absolute; left: 11px; top: 50%; width: 16px; height: 16px; margin-top: -8px; color: var(--quiet); pointer-events: none; }
.search__key { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); font-size: 12px; color: var(--quiet); border: 1px solid var(--rule); border-radius: 4px; padding: 0 6px; background: #fff; pointer-events: none; }
.search__list { position: absolute; left: 0; right: 0; top: calc(100% + 6px); min-width: min(520px, 92vw); max-height: 70vh; overflow: auto; list-style: none; padding: 6px; background: #fff; border: 1px solid var(--ink); border-radius: var(--radius); box-shadow: 0 8px 28px rgba(27,32,48,.14); z-index: 40; }
.search__list[hidden] { display: none; }
.search__opt a { display: block; padding: 10px 12px; border-radius: 4px; text-decoration: none; color: var(--body); }
.search__opt[aria-selected="true"] a, .search__opt a:hover { background: var(--band); }
.search__opt b { display: block; color: var(--ink); font-size: 16px; line-height: 1.3; }
.search__opt small { display: block; font-size: 14px; line-height: 1.4; color: var(--quiet); margin-top: 2px; }
.search__opt .where { font-weight: 600; color: var(--link); }
.search__none { padding: 12px; font-size: 15px; color: var(--quiet); }
mark { background: #fde9cf; color: var(--ink); padding: 0 1px; border-radius: 2px; }

/* ----------------------------- shell ----------------------------- */
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); max-width: 1400px; margin-inline: auto; padding-inline: 24px; gap: 0 48px; }
.shell--toc { grid-template-columns: var(--side-w) minmax(0, 1fr) var(--toc-w); }
.shell > .side { grid-column: 1; grid-row: 1; }
.shell > .main { grid-column: 2; grid-row: 1; }
.shell > .toc { grid-column: 3; grid-row: 1; }

.side { position: sticky; top: var(--header-h); align-self: start; max-height: calc(100vh - var(--header-h)); overflow: auto; padding: 28px 0 40px; font-size: 15.5px; line-height: 1.4; }
.side__sec + .side__sec { margin-top: 24px; }
.side__title { font-weight: 700; color: var(--ink); font-size: 15px; padding-bottom: 8px; margin-bottom: 4px; border-bottom: 1px solid var(--rule); }
.side ul { list-style: none; padding: 0; }
.side li a { display: block; padding: 6px 10px 6px 12px; margin-left: -12px; border-left: 3px solid transparent; color: var(--body); text-decoration: none; }
.side li a:hover { color: var(--ink); background: var(--band); }
.side li a[aria-current="page"] { color: var(--ink); font-weight: 600; border-left-color: var(--copper); background: var(--band); }
.side__home { display: block; margin-bottom: 18px; font-weight: 600; color: var(--ink); text-decoration: none; }
.side__home:hover { text-decoration: underline; }
.side__home[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--copper); text-decoration-thickness: 2px; text-underline-offset: 5px; }

.main { min-width: 0; padding: 40px 0 72px; }
.article { max-width: 42rem; }

.crumbs { font-size: 14.5px; color: var(--quiet); margin-bottom: 14px; }
.crumbs a { color: var(--quiet); }
.crumbs a:hover { color: var(--ink); }

.article__head .summary { margin-top: 16px; font-size: 1.2rem; line-height: 1.55; color: var(--body); }
.tag { display: inline-block; margin-top: 18px; font-size: 14px; font-weight: 600; color: var(--ink); border: 1px solid #9aa2ae; border-radius: 999px; padding: 2px 12px; line-height: 1.5; }
.tag::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--copper); margin-right: 8px; vertical-align: 1px; }

/* ----------------------------- film ----------------------------- */
.film { margin-top: 28px; }
.film video { width: 100%; height: auto; aspect-ratio: 16 / 10; background: #10131c; border-radius: var(--radius); border: 1px solid var(--rule); }
.film__title { font-size: 0.95rem; font-weight: 600; color: var(--ink); margin-bottom: 8px; }
.film details { margin-top: 10px; border-top: 1px solid var(--rule); }
.film summary { cursor: pointer; padding: 12px 0; font-size: 15.5px; font-weight: 600; color: var(--ink); }
.film .transcript { padding-bottom: 8px; font-size: 16px; max-width: 40rem; }
.film .transcript p + p { margin-top: 0.7em; }

/* ----------------------------- prose ----------------------------- */
.prose { margin-top: 36px; }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { margin-top: 2.1em; padding-top: 1.1em; border-top: 1px solid var(--rule); }
.prose h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.prose h3 { margin-top: 1.7em; }
.prose h2 + *, .prose h3 + * { margin-top: 0.7em; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: 0.4em; }
.prose li > ul, .prose li > ol { margin-top: 0.4em; }
.prose ul > li::marker { color: var(--copper); }
.prose code { font-family: var(--mono); font-size: 0.86em; background: var(--band); border: 1px solid var(--rule); border-radius: 4px; padding: 1px 5px; color: var(--ink); overflow-wrap: anywhere; }
.prose pre { background: var(--band); border: 1px solid var(--rule); border-radius: var(--radius); padding: 14px 16px; overflow: auto; font-size: 15px; line-height: 1.5; }
.prose pre code { background: none; border: 0; padding: 0; font-size: inherit; }
.prose hr { border: 0; border-top: 1px solid var(--rule); margin-block: 2em; }
.prose kbd { font-family: var(--mono); font-size: 0.85em; color: var(--ink); background: #fff; border: 1px solid #9aa2ae; border-bottom-width: 2px; border-radius: 4px; padding: 0 6px; }

/* Numbered procedures: a copper route joins the steps. */
.prose ol { list-style: none; counter-reset: step; padding-left: 0; }
.prose ol > li { counter-increment: step; position: relative; padding-left: 3.1rem; padding-bottom: 1.1rem; margin-top: 0; }
.prose ol > li:last-child { padding-bottom: 0; }
.prose ol > li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 2.1rem; height: 2.1rem; border-radius: 50%; background: #fff; border: 2px solid var(--copper); color: var(--ink); font-weight: 700; font-size: 0.95rem; line-height: 1; display: grid; place-items: center; z-index: 1; }
.prose ol > li::after { content: ""; position: absolute; left: calc(1.05rem - 1px); top: 2.1rem; bottom: 0; width: 2px; background: var(--copper); opacity: .45; }
.prose ol > li:last-child::after { display: none; }
.prose ol > li > p:first-child { padding-top: 0.2rem; }
.prose ol > li > * + * { margin-top: 0.6em; }
.prose ol ol, .prose ol ul { margin-top: 0.6em; }
.prose ol ol > li { padding-left: 2.4rem; }
.prose ol ol > li::before { width: 1.6rem; height: 1.6rem; font-size: .8rem; border-width: 1.5px; }
.prose ol ol > li::after { left: calc(.8rem - 1px); top: 1.6rem; }

.prose figure { margin-block: 1.6em; }
.prose figure img { border: 1px solid var(--rule); border-radius: var(--radius); width: 100%; height: auto; }
.prose figcaption { margin-top: 8px; font-size: 14.5px; color: var(--quiet); }

/* Callouts: a coloured bar plus a text label, so colour is never the only cue. */
.callout { border-left: 4px solid var(--note-bar); background: var(--note-bg); padding: 12px 18px 12px 16px; border-radius: 0 var(--radius) var(--radius) 0; font-size: 17px; }
.callout > * + * { margin-top: 0.6em; }
.callout__label { font-weight: 700; color: var(--ink); font-size: 0.82em; letter-spacing: 0.02em; }
.callout--tip { background: var(--tip-bg); border-left-color: var(--tip-bar); }
.callout--warning { background: var(--warn-bg); border-left-color: var(--warn-bar); }
.prose blockquote:not(.callout) { border-left: 3px solid var(--rule); padding-left: 16px; color: var(--quiet); }

/* Tables */
.tablewrap { overflow-x: auto; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--rule); -webkit-overflow-scrolling: touch; }
.tablewrap:focus-visible { outline-offset: 2px; }
.prose table { width: 100%; border-collapse: collapse; font-size: 16px; line-height: 1.45; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 10px 14px 10px 0; border-bottom: 1px solid var(--rule); }
.prose th { color: var(--ink); font-weight: 600; background: #fff; white-space: nowrap; padding-right: 20px; }
.prose thead th { border-bottom: 1px solid var(--ink); font-size: 14.5px; }
.prose tbody tr:last-child td, .prose tbody tr:last-child th { border-bottom: 0; }
.prose td { min-width: 9em; }
.prose td:first-child { min-width: 0; }

/* ----------------------------- toc ----------------------------- */
.toc-m { display: none; margin-bottom: 20px; border: 1px solid var(--rule); border-radius: var(--radius); }
.toc-m summary { cursor: pointer; padding: 12px 14px; font-weight: 600; color: var(--ink); }
.toc-m ul { list-style: none; padding: 0 14px 10px; font-size: 16px; }
.toc-m li a { display: block; padding: 7px 0; }
.toc-m li.sub a { padding-left: 14px; }
.film__print { display: none; }
.toc { position: sticky; top: calc(var(--header-h) + 28px); align-self: start; padding: 40px 0 40px; font-size: 14.5px; line-height: 1.4; max-height: calc(100vh - var(--header-h)); overflow: auto; }
.toc__title { font-weight: 700; color: var(--ink); padding-bottom: 8px; margin-bottom: 6px; border-bottom: 1px solid var(--rule); }
.toc ul { list-style: none; padding: 0; }
.toc li a { display: block; padding: 5px 0; color: var(--quiet); text-decoration: none; }
.toc li a:hover { color: var(--ink); text-decoration: underline; }
.toc li.sub a { padding-left: 14px; font-size: 14px; }

/* ----------------------------- prev / next ----------------------------- */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--rule); max-width: 42rem; }
.pager a { display: block; padding: 14px 16px; border: 1px solid var(--rule); border-radius: var(--radius); text-decoration: none; color: var(--ink); line-height: 1.35; }
.pager a:hover { border-color: var(--ink); background: var(--band); }
.pager small { display: block; font-size: 13.5px; color: var(--quiet); margin-bottom: 2px; }
.pager b { font-size: 16.5px; }
.pager .next { grid-column: 2; text-align: right; }
.pager .prev { grid-column: 1; }

/* ----------------------------- home ----------------------------- */
.wrap { max-width: 1400px; margin-inline: auto; padding-inline: 24px; }
.home-hero { padding-block: 64px 48px; }
.home-hero h1 { max-width: 16em; }
.home-hero .lede { margin-top: 20px; font-size: 1.25rem; max-width: 34em; line-height: 1.55; }
.home-hero .search { margin-top: 28px; max-width: 560px; flex: none; }
.home-hero .search__input { font-size: 17px; padding: 14px 44px 14px 42px; background: #fff; border: 1px solid #9aa2ae; }
.home-hero .search__icon { left: 14px; width: 18px; height: 18px; margin-top: -9px; }

.band { background: var(--band); border-block: 1px solid var(--rule); }
.block { padding-block: 56px; }
.block__head { margin-bottom: 28px; max-width: 40rem; }
.block__head p { margin-top: 8px; }

.roles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 32px; }
.role { border-top: 2px solid var(--ink); padding-top: 16px; }
.role h3 { font-size: 1.2rem; }
.role p { margin-top: 6px; font-size: 16px; line-height: 1.5; }
.role ul { list-style: none; padding: 0; margin-top: 14px; font-size: 16px; line-height: 1.4; }
.role li + li { margin-top: 8px; }
.role li a { text-decoration: none; }
.role li a:hover { text-decoration: underline; }
.role .go { display: inline-block; margin-top: 16px; font-weight: 600; font-size: 15.5px; }

.topics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 56px; }
.topic { border-top: 1px solid var(--rule); padding-top: 16px; }
.topic h3 { font-size: 1.25rem; }
.topic h3 a { color: var(--ink); text-decoration: none; }
.topic h3 a:hover { text-decoration: underline; text-decoration-color: var(--copper); text-decoration-thickness: 2px; }
.topic > p { margin-top: 6px; font-size: 16px; }
.topic ul { list-style: none; padding: 0; margin-top: 12px; font-size: 16px; }
.topic li { padding-block: 7px; border-top: 1px solid var(--rule); }
.topic li:first-child { border-top: 0; padding-top: 0; }
.topic li span { display: block; color: var(--quiet); font-size: 14.5px; line-height: 1.4; }

.films { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; list-style: none; padding: 0; }
.filmcard a { display: block; text-decoration: none; color: var(--ink); }
.filmcard__thumb { position: relative; aspect-ratio: 16 / 10; background: #10131c; border-radius: var(--radius); border: 1px solid var(--rule); overflow: hidden; }
.filmcard__thumb img { width: 100%; height: 100%; object-fit: cover; }
.filmcard__play { position: absolute; left: 12px; bottom: 12px; width: 38px; height: 38px; border-radius: 50%; background: var(--copper); display: grid; place-items: center; }
.filmcard__play svg { width: 14px; height: 14px; margin-left: 2px; fill: #fff; }
.filmcard b { display: block; margin-top: 10px; font-size: 17px; line-height: 1.3; }
.filmcard a:hover b { text-decoration: underline; }
.filmcard small { display: block; font-size: 14.5px; color: var(--quiet); line-height: 1.4; margin-top: 2px; }

.filmrow { padding-block: 36px; border-top: 1px solid var(--rule); max-width: 46rem; }
.filmrow h2 { font-size: 1.35rem; }
.filmrow .film { margin-top: 14px; }
.filmrow .related { margin-top: 10px; font-size: 15.5px; }

/* ----------------------------- footer ----------------------------- */
.ftr { border-top: 1px solid var(--rule); margin-top: 24px; font-size: 14.5px; color: var(--quiet); }
.ftr__in { max-width: 1400px; margin-inline: auto; padding: 24px; display: flex; flex-wrap: wrap; gap: 8px 28px; justify-content: space-between; }
.ftr nav { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.ftr a { color: var(--body); }

/* ----------------------------- responsive ----------------------------- */
@media (max-width: 1180px) {
  .shell--toc { grid-template-columns: var(--side-w) minmax(0, 1fr); }
  .shell > .side { grid-row: 1 / span 2; }
  .shell > .toc { position: static; grid-column: 2; grid-row: 1; max-height: none; padding: 28px 0 0; }
  .shell--toc > .main { grid-column: 2; grid-row: 2; padding-top: 24px; }
  .toc ul { columns: 2; column-gap: 24px; }
  .toc li { break-inside: avoid; }
}
@media (max-width: 920px) {
  .roles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 36px 32px; }
  .films { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  :root { --header-h: 60px; }
  body { font-size: 17.5px; }
  .hdr__in { padding-inline: 16px; gap: 8px 12px; }
  .brand__help, .hdr__links .hide-sm { display: none; }
  .hdr__links { gap: 14px; }
  .search { order: 5; flex: 1 1 100%; max-width: none; }
  .hdr { position: static; }
  .menu-btn { display: none; }
  .js .menu-btn { display: inline-block; }
  .shell, .shell--toc { grid-template-columns: minmax(0, 1fr); padding-inline: 16px; }
  .side { position: static; max-height: none; overflow: visible; padding: 16px 0; border-bottom: 1px solid var(--rule); }
  .js .side { display: none; }
  .js .side.is-open { display: block; }
  .shell > .side, .shell > .toc, .shell > .main, .shell--toc > .main { grid-column: 1; grid-row: auto; }
  .shell > .side { order: 1; }
  .shell > .toc { display: none; }
  .toc-m { display: block; }
  .shell > .main { order: 3; }
  .toc { padding: 16px 0 0; }
  .toc ul { columns: 1; }
  .main { padding-block: 28px 56px; }
  .prose h2 { font-size: 1.4rem; }
  .prose ol > li { padding-left: 2.8rem; }
  .wrap { padding-inline: 16px; }
  .home-hero { padding-block: 40px 32px; }
  .block { padding-block: 40px; }
  .topics { grid-template-columns: minmax(0, 1fr); }
  .pager { grid-template-columns: 1fr; }
  .pager .next, .pager .prev { grid-column: 1; text-align: left; }
  .ftr__in { padding-inline: 16px; }
}
@media (max-width: 560px) {
  .roles, .films { grid-template-columns: minmax(0, 1fr); }
  .toc ul { columns: 1; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* ----------------------------- print ----------------------------- */
@media print {
  .film__print { display: block !important; margin-top: 12px; font-size: 11pt; }
  .toc-m { display: none !important; }
  :root { --paper: #fff; }
  body { font-size: 11.5pt; line-height: 1.5; color: #000; }
  .hdr, .side, .toc, .pager, .film, .menu-btn, .skip, .ftr nav, .search, .filmcard__play, .home-hero .search { display: none !important; }
  .shell, .shell--toc { display: block; padding: 0; max-width: none; }
  .main { padding: 0; }
  .article { max-width: none; }
  .prose a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.85em; color: #333; word-break: break-all; }
  .prose a { color: #000; text-decoration: underline; }
  .prose h2, .prose h3 { break-after: avoid; }
  .prose ol > li, .prose figure, .callout, .prose tr { break-inside: avoid; }
  .prose ol > li::before { border-color: #000; }
  .prose ol > li::after { background: #000; opacity: .4; }
  .callout { border: 1px solid #000; border-left-width: 5px; background: #fff; }
  .prose figure img { border-color: #999; }
  .tablewrap { overflow: visible; }
  .prose code { background: #fff; }
  .ftr { border-top: 1px solid #999; margin-top: 24pt; }
  .ftr__in { padding: 8pt 0; }
}
