/* Takeoffs Help Centre: the knowledge base served at /help/ (hand-written; build.py copies nothing here) */
:root {
  --navy: #05183b; --blue: #1976d2; --blue-soft: #e8f1fb; --ink: #1f2937; --muted: #5b6474; --line: #e5e7eb;
  --bg: #f6f7f9; --card: #ffffff; --green: #16a34a; --red: #dc2626; --amber: #b45309; --code: #f1f5f9;
  --focus: #1976d2; --shadow: 0 6px 18px rgba(15,23,42,.08);
  --t-all: #05183b; --t-electrical: #b45309; --t-security: #4338ca; --t-fire: #b91c1c;
  --t-all-soft: #e8edf6; --t-electrical-soft: #fdf1e3; --t-security-soft: #ecebfb; --t-fire-soft: #fde9e9;
}
@media (prefers-color-scheme: dark) {
  :root { --navy: #e6edf7; --blue: #6aa8ea; --blue-soft: #16263b; --ink: #d9dee7; --muted: #9aa4b2; --line: #2a3340; --bg: #0f141b; --card: #161d26; --code: #1d2631;
    --focus: #8ec0f2; --shadow: 0 6px 18px rgba(0,0,0,.35);
    --t-all: #c9d6ea; --t-electrical: #f2b56d; --t-security: #b7b3f5; --t-fire: #f4a2a2;
    --t-all-soft: #1d2a3d; --t-electrical-soft: #3a2a14; --t-security-soft: #262449; --t-fire-soft: #3d1c1c; }
}
* { box-sizing: border-box; }
html { scroll-padding-top: 84px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.6 Inter, system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-text-size-adjust: 100%; }
a { color: var(--blue); }
img, video { max-width: 100%; height: auto; }
button { font: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.vh { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 8px 14px; background: var(--card); color: var(--blue); border: 2px solid var(--blue); border-radius: 8px; font-weight: 600; }
.skip:focus { top: 12px; }
main:focus { outline: none; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

/* ---- header */
.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 16px; padding: 10px 24px; background: var(--card); border-bottom: 1px solid var(--line); min-height: 60px; }
.top .brand { font-weight: 700; color: var(--navy); text-decoration: none; white-space: nowrap; font-size: 17px; }
.top .brand span { color: var(--muted); font-weight: 500; }
.top .quick { display: flex; gap: 4px; }
.top .quick a { padding: 6px 10px; border-radius: 8px; color: var(--ink); text-decoration: none; font-size: 14px; font-weight: 500; }
.top .quick a:hover { background: var(--blue-soft); }
.top .quick a[aria-current] { color: var(--blue); background: var(--blue-soft); }
.top .search { flex: 1; max-width: 480px; position: relative; margin-left: auto; }
.top input[type=search], .hero-search input[type=search] { width: 100%; padding: 9px 12px 9px 36px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); font: inherit; font-size: 15px; }
.top .search::before, .hero-search::before { content: ''; position: absolute; left: 12px; top: 50%; width: 16px; height: 16px; margin-top: -8px; pointer-events: none;
  background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235b6474' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.8-3.8'/%3E%3C/svg%3E"); }
.top .back { white-space: nowrap; font-size: 14px; }
.results { position: absolute; left: 0; right: 0; top: calc(100% + 6px); background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 30px rgba(0,0,0,.18); max-height: 60vh; overflow: auto; z-index: 20; text-align: left; }
.results a { display: block; padding: 10px 14px; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.results a:last-child { border-bottom: 0; }
.results a:hover, .results a.on { background: var(--blue-soft); }
.results b { color: var(--navy); display: block; font-size: 15px; }
.results small { color: var(--muted); display: block; font-size: 13px; line-height: 1.45; }
.results .where { display: inline-block; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-right: 6px; }
.results .where.video { color: var(--blue); }
.results .none { color: var(--muted); }

/* ---- layout and side nav */
.layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 32px; max-width: 1200px; margin: 0 auto; padding: 24px; }
nav.side { position: sticky; top: 76px; align-self: start; max-height: calc(100vh - 92px); overflow: auto; font-size: 14px; padding-right: 6px; scrollbar-width: thin; }
nav.side .grp { margin: 16px 0 4px; padding: 0 10px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
nav.side .grp[data-open] { color: var(--navy); }
nav.side a { display: block; padding: 5px 10px; border-radius: 8px; color: var(--ink); text-decoration: none; }
nav.side a:hover { background: var(--blue-soft); }
nav.side a[aria-current] { background: var(--blue-soft); color: var(--blue); font-weight: 600; }
nav.side a.grp.hub { display: flex; align-items: center; gap: 6px; padding: 4px 10px; color: var(--navy); font-weight: 700; }
nav.side a.grp.hub::before { content: '▶'; font-size: 9px; color: var(--blue); }
nav.side a.grp.hub[aria-current] { background: none; color: var(--blue); }
nav.side a small { color: var(--muted); font-size: 12px; margin-left: 4px; }
main { min-width: 0; }

/* ---- articles */
article, .hub, .path, .tcard, .topic, .featured { background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
main > article { padding: 32px 40px; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.crumbs a { color: var(--muted); }
h1 { margin: 0 0 6px; font-size: 30px; line-height: 1.25; color: var(--navy); letter-spacing: -.01em; }
.lede { font-size: 18px; color: var(--muted); margin: 0 0 18px; }
h2 { margin: 34px 0 10px; font-size: 21px; color: var(--navy); }
h3 { margin: 24px 0 6px; font-size: 17px; color: var(--navy); }
.toc { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; margin: 0 0 22px; padding: 10px 14px; background: var(--bg); border-radius: 10px; font-size: 14px; }
.toc span { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; margin-right: 4px; }
ol.steps { counter-reset: s; list-style: none; padding: 0; margin: 12px 0; }
ol.steps > li { counter-increment: s; position: relative; padding-left: 42px; margin: 12px 0; }
ol.steps > li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%; background: var(--blue); color: #fff; font-weight: 700; font-size: 14px; display: grid; place-items: center; }
kbd { font: 600 12px/1 ui-monospace, SFMono-Regular, Menlo, monospace; padding: 3px 6px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; background: var(--code); color: var(--ink); white-space: nowrap; }
.ui { font-weight: 600; color: var(--navy); }
code { font: 13px ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--code); padding: 1px 5px; border-radius: 4px; }
figure { margin: 18px 0; }
figure img { display: block; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); cursor: zoom-in; }
figure.phone img { max-width: 320px; }
figcaption { font-size: 13px; color: var(--muted); margin-top: 6px; }
.note, .tip, .warn { border-radius: 10px; padding: 12px 16px; margin: 16px 0; border-left: 4px solid; }
.note { background: var(--blue-soft); border-color: var(--blue); }
.tip { background: rgba(22,163,74,.08); border-color: var(--green); }
.warn { background: rgba(180,83,9,.09); border-color: var(--amber); }
.note b:first-child, .tip b:first-child, .warn b:first-child { display: block; margin-bottom: 2px; }
table { border-collapse: collapse; width: 100%; margin: 12px 0; font-size: 15px; }
th, td { border-bottom: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
th { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .04em; }
.related { margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 15px; }
.pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 18px; }
.pager a { flex: 1; padding: 12px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); text-decoration: none; }
.pager a.next { text-align: right; }
.pager small { display: block; color: var(--muted); }
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.85); display: grid; place-items: center; z-index: 50; cursor: zoom-out; padding: 24px; border: 0; }
.lightbox img { max-width: 96vw; max-height: 92vh; border-radius: 8px; }

/* ---- video, chapters, chips (shared by the home page, the Tutorials page and tutorial articles) */
figure.video { margin: 18px 0 6px; }
.video video { width: 100%; aspect-ratio: 16 / 10; border-radius: 12px; background: #000; display: block; }
.chapters { margin: 10px 0 0; }
.chapters h3 { margin: 0 0 4px; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.chapters ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.seek { border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 999px; padding: 4px 10px 4px 6px; font-size: 13px; cursor: pointer; line-height: 1.4; }
.seek:hover, .seek.on { border-color: var(--blue); background: var(--blue-soft); }
.seek .t { display: inline-block; min-width: 38px; text-align: center; font: 600 12px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--blue); background: var(--blue-soft); border-radius: 999px; padding: 0 6px; margin-right: 4px; }
.seek.on .t { background: var(--blue); color: #fff; }
.step-seek { margin-left: 8px; padding: 1px 8px; font-size: 12px; color: var(--blue); vertical-align: middle; }
.hint { font-size: 14px; color: var(--muted); margin: 0 0 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.chip { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--bg); color: var(--muted); border: 1px solid var(--line); line-height: 1.5; white-space: nowrap; }
.chip.trade-all { background: var(--t-all-soft); color: var(--t-all); border-color: transparent; }
.chip.trade-electrical { background: var(--t-electrical-soft); color: var(--t-electrical); border-color: transparent; }
.chip.trade-security { background: var(--t-security-soft); color: var(--t-security); border-color: transparent; }
.chip.trade-fire { background: var(--t-fire-soft); color: var(--t-fire); border-color: transparent; }
dl.meta { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 0 0 6px; padding: 12px 16px; background: var(--bg); border-radius: 10px; font-size: 14px; }
dl.meta div { display: flex; gap: 6px; }
dl.meta dt { color: var(--muted); }
dl.meta dd { margin: 0; font-weight: 600; color: var(--navy); }
ul.learn { margin: 6px 0 12px; padding-left: 22px; }
ul.learn li { margin: 4px 0; }
.btn { display: inline-block; padding: 8px 16px; border-radius: 10px; background: var(--blue); color: #fff; text-decoration: none; font-weight: 600; font-size: 15px; }
.btn:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; color: var(--blue); border: 1px solid var(--blue); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; }

/* ---- tutorial cards */
.tgrid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.tcard { display: flex; flex-direction: column; overflow: hidden; transition: border-color .15s; }
.tcard:hover { border-color: var(--blue); }
.tcard .poster { position: relative; display: block; background: #000; }
.tcard .poster img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.tcard .poster::after { content: ''; position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 50%; background: rgba(5,24,59,.78) no-repeat 56% 50% / 20px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M7 4.5v15l12-7.5z'/%3E%3C/svg%3E"); box-shadow: 0 2px 10px rgba(0,0,0,.3); }
.tcard .dur { position: absolute; right: 8px; bottom: 8px; background: rgba(0,0,0,.75); color: #fff; font: 600 12px/1 ui-monospace, SFMono-Regular, Menlo, monospace; padding: 4px 7px; border-radius: 6px; }
.tcard .tbody { padding: 14px 16px 16px; display: flex; flex-direction: column; flex: 1; }
.tcard h3 { margin: 0 0 4px; font-size: 17px; }
.tcard h3 a { color: var(--navy); text-decoration: none; }
.tcard h3 a:hover { text-decoration: underline; }
.tcard .tlede { margin: 0; font-size: 14px; color: var(--muted); line-height: 1.5; }
.tcard ul.learn { font-size: 14px; }
.tcard .actions { margin-top: auto; padding-top: 12px; }
.tcard.compact .tbody { padding: 12px 14px 14px; }
.tcard.compact .tlede { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tcard.hide { display: none; }
.tutorial .more-tuts { margin-top: 36px; padding-top: 10px; border-top: 1px solid var(--line); }
.tutorial .more-tuts .tgrid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }

/* ---- the Tutorials page */
.hub { padding: 32px 40px; }
.hub > .tgrid { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.picker { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 22px; }
.picker span { font-size: 14px; color: var(--muted); margin-right: 4px; }
.chip.pick { cursor: pointer; font-size: 14px; padding: 6px 14px; background: var(--card); color: var(--ink); }
.chip.pick:hover { border-color: var(--blue); }
.chip.pick[aria-pressed=true] { background: var(--navy); color: var(--card); border-color: var(--navy); }
.featured { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 24px; padding: 22px 24px; margin-bottom: 30px; background: var(--bg); }
.featured h2 { margin: 4px 0 6px; font-size: 24px; }
.featured h3 { margin: 14px 0 0; font-size: 14px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.featured figure.video { margin: 0; grid-column: 2; grid-row: 1 / span 2; }
.featured .chapters { grid-column: 1 / -1; }
.featured.hide { display: none; }
.which ul { padding-left: 20px; }
.which li { margin: 8px 0; }

/* ---- the home page */
.home .hero { background: linear-gradient(135deg, #05183b, #1976d2); color: #fff; border-radius: 16px; padding: 40px 40px 32px; margin-bottom: 20px; text-align: center; }
.home .hero h1 { color: #fff; font-size: 36px; }
.home .hero .lede { margin: 6px auto 22px; color: rgba(255,255,255,.88); max-width: 620px; }
.hero-search { position: relative; display: flex; gap: 8px; max-width: 640px; margin: 0 auto; }
.hero-search input[type=search] { background: #fff; color: #1f2937; border: 0; padding: 13px 14px 13px 42px; font-size: 17px; border-radius: 12px; box-shadow: 0 4px 16px rgba(0,0,0,.2); }
.hero-search input::placeholder { color: #6b7280; }
.hero-search::before { left: 15px; }
.hero-search button { border: 0; border-radius: 12px; padding: 0 20px; background: #05183b; color: #fff; font-weight: 600; cursor: pointer; }
.hero-search button:hover { background: #0b2a5e; }
.hero-search :focus-visible { outline-color: #fff; }
.home .popular { margin: 14px 0 0; font-size: 14px; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; }
.home .popular span { opacity: .8; }
.home .popular a { color: #fff; }
.paths { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 30px; }
.path { padding: 20px 24px; }
.path h2 { margin: 0 0 4px; font-size: 20px; }
.path > p { margin: 0 0 10px; color: var(--muted); font-size: 15px; }
.path ol.steps li { margin: 10px 0; }
.path ol.steps li a { font-weight: 600; }
.path small { display: block; color: var(--muted); font-size: 14px; line-height: 1.45; }
.path ul { margin: 0; padding-left: 20px; }
.path ul li { margin: 6px 0; }
.path .small { font-size: 14px; color: var(--muted); margin: 14px 0 0; }
.path.new { border-top: 4px solid var(--blue); }
.path.stuck { border-top: 4px solid var(--amber); }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.home h2 { margin: 0 0 4px; font-size: 22px; }
.home .watch > p, .home .topics > p { margin: 0 0 14px; color: var(--muted); font-size: 15px; }
.home .watch { margin-bottom: 34px; }
.tgrid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.topics-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); margin-top: 12px; }
.topic { padding: 18px 20px; }
.topic h3 { margin: 0 0 2px; font-size: 17px; }
.topic p { margin: 0 0 8px; font-size: 14px; color: var(--muted); line-height: 1.45; }
.topic ul { margin: 0; padding: 0; list-style: none; }
.topic li { padding: 3px 0; font-size: 15px; }
.topic li a { text-decoration: none; }
.topic li a:hover { text-decoration: underline; }

/* ---- small screens */
.menu-btn { display: none; background: none; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); font-size: 18px; padding: 4px 10px; cursor: pointer; min-width: 40px; min-height: 36px; }
.menu-btn[aria-expanded=true] { background: var(--blue-soft); border-color: var(--blue); }
@media (max-width: 1100px) { .tgrid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; padding: 12px; gap: 0; }
  nav.side { display: none; position: fixed; top: 60px; left: 0; right: 0; bottom: 0; z-index: 9; max-height: none; padding: 10px 14px 24px; background: var(--card); border-top: 1px solid var(--line); overflow: auto; font-size: 15px; }
  nav.side.open { display: block; }
  nav.side a { padding: 8px 10px; }
  .menu-btn { display: inline-grid; place-items: center; }
  .top { padding: 8px 12px; gap: 10px; }
  .top .back, .top .quick { display: none; }
  .top .search { max-width: none; }
  .top .brand span { display: none; }
  .results { max-height: 70vh; }
  main > article, .hub { padding: 20px 18px; border-radius: 12px; }
  h1 { font-size: 25px; }
  .lede { font-size: 16px; }
  .home .hero { padding: 26px 18px 22px; text-align: left; border-radius: 12px; }
  .home .hero h1 { font-size: 27px; }
  .home .hero .lede { margin: 6px 0 16px; }
  .hero-search input[type=search] { flex: 1 1 0; min-width: 0; padding-right: 10px; }
  .hero-search button { padding: 0 14px; }
  .hero-search input[type=search] { font-size: 16px; }
  .home .popular { justify-content: flex-start; }
  .paths { grid-template-columns: 1fr; }
  .path { padding: 16px 18px; }
  .featured { grid-template-columns: 1fr; padding: 16px; }
  .featured figure.video { grid-column: 1; grid-row: auto; }
  .featured .chapters { grid-column: 1; }
  .tgrid, .tgrid.four, .topics-grid { grid-template-columns: 1fr; }
  .tcard.compact { flex-direction: row; align-items: stretch; }
  .tcard.compact .poster { flex: 0 0 132px; }
  .tcard.compact .poster img { height: 100%; aspect-ratio: auto; min-height: 96px; }
  .tcard.compact .poster::after { width: 36px; height: 36px; margin: -18px 0 0 -18px; background-size: 14px; }
  .tcard.compact .dur { right: 6px; bottom: 6px; font-size: 11px; }
  .tcard.compact .tbody { padding: 10px 12px; min-width: 0; }
  .tcard.compact .chips .chip:not([class*=trade-]) { display: none; }
  .tcard.compact h3 { font-size: 15px; }
  .tcard.compact .tlede { font-size: 13px; }
  .tutorial .more-tuts .tgrid { grid-template-columns: 1fr; }
  .pager { flex-direction: column; }
  .pager a.next { text-align: left; }
  dl.meta { gap: 4px 16px; font-size: 13px; }
  .toc { font-size: 13px; }
  .step-seek { display: block; margin: 4px 0 0; width: max-content; }
}
@media (max-width: 420px) {
  .top .brand { font-size: 15px; }
  .top input[type=search] { padding-left: 32px; font-size: 14px; }
  .top .search::before { left: 10px; }
}
