/* Latency Lens codelab: a step-by-step tutorial page in the style of the QNX codelabs.
   Copyright (C) 2026 chinesepowered. SPDX-License-Identifier: AGPL-3.0-or-later */
:root {
  --blue: #1a73e8;
  --blue-dark: #1967d2;
  --ink: #202124;
  --ink-2: #3c4043;
  --muted: #5f6368;
  --line: #dadce0;
  --paper: #ffffff;
  --page: #f1f3f4;
  --code: #f8f9fa;
  --term: #202124;
  --green: #1e8e3e;
  --green-bg: #e6f4ea;
  --amber: #f9ab00;
  --amber-bg: #fef7e0;
  --drawer: 272px;
  --bar: 64px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: Roboto, "Helvetica Neue", Arial, sans-serif; color: var(--ink); background: var(--page); font-size: 16px; line-height: 1.6; }
a { color: var(--blue); }
code, pre, kbd { font-family: "Roboto Mono", "Source Code Pro", Menlo, Consolas, monospace; }

/* app bar */
.appbar { position: fixed; inset: 0 0 auto 0; height: var(--bar); display: flex; align-items: center; gap: 14px; padding: 0 20px; background: var(--paper);
  border-bottom: 1px solid var(--line); z-index: 10; }
.appbar .home { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; color: var(--muted); text-decoration: none; }
.appbar .home:hover { background: #f1f3f4; }
.appbar h1 { margin: 0; font-size: 20px; font-weight: 400; color: var(--ink-2); flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appbar .remaining { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 14px; white-space: nowrap; }
.appbar .menu { display: none; border: 0; background: none; width: 40px; height: 40px; border-radius: 50%; color: var(--muted); cursor: pointer; }
.progress { position: fixed; top: var(--bar); left: 0; right: 0; height: 4px; background: #e8eaed; z-index: 10; }
.progress div { height: 100%; width: 0; background: var(--blue); transition: width 0.25s; }

/* steps drawer */
.drawer { position: fixed; top: calc(var(--bar) + 4px); bottom: 0; left: 0; width: var(--drawer); overflow-y: auto; padding: 16px 0 24px; background: var(--paper); border-right: 1px solid var(--line); }
.drawer ol { list-style: none; margin: 0; padding: 0; }
.drawer li a { display: flex; align-items: flex-start; gap: 12px; padding: 9px 20px 9px 18px; color: var(--ink-2); text-decoration: none; font-size: 14px; line-height: 1.4; border-left: 4px solid transparent; }
.drawer li a:hover { background: #f8f9fa; }
.drawer .n { flex: none; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: #e8eaed; color: var(--muted); font-size: 12px; font-weight: 500; }
.drawer li.done .n { background: #d2e3fc; color: var(--blue-dark); }
.drawer li.active a { border-left-color: var(--blue); background: #e8f0fe; color: var(--blue-dark); font-weight: 500; }
.drawer li.active .n { background: var(--blue); color: #fff; }
.drawer .t { padding-top: 2px; }
.drawer .d { margin-left: auto; padding-top: 2px; color: #80868b; font-size: 12px; white-space: nowrap; }
.drawer .foot { margin: 18px 20px 0; padding-top: 14px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }

/* step content */
main { margin-left: var(--drawer); padding: calc(var(--bar) + 28px) 32px 120px; }
.card { max-width: 860px; margin: 0 auto; background: var(--paper); border-radius: 8px; box-shadow: 0 1px 2px rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15); padding: 28px 40px 36px; }
.step-title { margin: 0 0 18px; font-size: 28px; font-weight: 400; color: var(--ink); }
.step h3 { font-size: 20px; font-weight: 500; margin: 28px 0 8px; }
.step p, .step li { color: var(--ink-2); }
.step img.shot { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: 6px; margin: 14px 0 6px; }
.step figure { margin: 18px 0; }
.step figcaption { font-size: 13px; color: var(--muted); }
.step code { background: #f1f3f4; border-radius: 4px; padding: 1px 5px; font-size: 0.92em; }
.step pre code { background: none; padding: 0; font-size: inherit; }
.step kbd { border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; font-size: 0.85em; background: #fff; }
.duration { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin: -8px 0 16px; }

/* code blocks */
.block { position: relative; margin: 14px 0; }
.block .tag { display: inline-block; font-size: 11px; font-weight: 500; letter-spacing: 0.6px; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
pre { margin: 0; padding: 14px 16px; border-radius: 6px; overflow-x: auto; font-size: 14px; line-height: 1.55; }
pre.cmd { background: var(--term); color: #e8eaed; padding-right: 76px; }
pre.cmd .c { color: #9aa0a6; }
pre.out { background: var(--code); color: var(--ink-2); border: 1px solid #e8eaed; }
pre.src { background: var(--code); color: var(--ink-2); border: 1px solid #e8eaed; }
pre .hl { background: #fce8b2; color: var(--ink); border-radius: 2px; }
pre .add { color: var(--green); }
pre .del { color: #c5221f; }
.copy { position: absolute; right: 8px; top: 30px; border: 1px solid #5f6368; background: #303134; color: #e8eaed; border-radius: 4px; font: 500 12px Roboto, sans-serif; padding: 4px 9px; cursor: pointer; }
.copy:hover { background: #3c4043; }
.copy.ok { border-color: var(--green); color: #81c995; }

/* asides */
aside { margin: 18px 0; padding: 12px 16px; border-radius: 6px; border-left: 4px solid; }
aside p { margin: 6px 0; }
aside.special { background: var(--green-bg); border-color: var(--green); }
aside.warning { background: var(--amber-bg); border-color: var(--amber); }
aside.capy { display: flex; gap: 14px; align-items: flex-start; background: #fff4e5; border-color: #e8a15c; }
aside.capy svg { flex: none; width: 76px; height: 60px; }
.hero { display: flex; align-items: center; gap: 22px; margin: 6px 0 10px; }
.hero svg { flex: none; width: 210px; height: 162px; }
.hero p { margin: 0; }
table.facts { border-collapse: collapse; width: 100%; font-size: 14px; margin: 10px 0; }
table.facts th, table.facts td { border-bottom: 1px solid #e8eaed; padding: 7px 8px; text-align: left; vertical-align: top; }
table.facts th { color: var(--muted); font-weight: 500; }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }

/* back / next */
.controls { position: fixed; right: 32px; bottom: 24px; display: flex; gap: 12px; z-index: 5; }
.controls button, .controls a { font: 500 15px Roboto, sans-serif; border-radius: 4px; padding: 10px 22px; cursor: pointer; text-decoration: none; box-shadow: 0 1px 3px rgba(60, 64, 67, 0.3); }
#prev { background: #fff; color: var(--blue); border: 1px solid var(--line); }
#next { background: var(--blue); color: #fff; border: 0; }
#next:hover { background: var(--blue-dark); }
#prev[hidden], #next[hidden] { display: none; }

@media (max-width: 900px) {
  .drawer { transform: translateX(-100%); transition: transform 0.2s; z-index: 9; box-shadow: 0 0 24px rgba(0, 0, 0, 0.2); }
  body.nav-open .drawer { transform: none; }
  .appbar .menu { display: grid; place-items: center; }
  main { margin-left: 0; padding: calc(var(--bar) + 16px) 12px 110px; }
  .card { padding: 20px 18px 28px; }
  .hero { flex-direction: column; align-items: flex-start; }
  .appbar .remaining span { display: none; }
  .controls { right: 12px; bottom: 12px; }
}
