:root {
  --bg: #f7f6f3;
  --surface: #ffffff;
  --text: #1f2328;
  --muted: #5d6470;
  --line: #e3e1dc;
  --accent: #c2410c;
  --accent-soft: #fff1e8;
  --tip: #0f6b5c;
  --tip-soft: #e7f5f1;
  --warn: #9a3412;
  --warn-soft: #fdeee4;
  --kbd: #eceae5;
  --shadow: 0 1px 2px rgba(20, 20, 20, 0.06), 0 4px 16px rgba(20, 20, 20, 0.06);
  --radius: 12px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15171a;
    --surface: #1d2024;
    --text: #e8e6e3;
    --muted: #a3a8b0;
    --line: #2e3238;
    --accent: #fb923c;
    --accent-soft: #33221a;
    --tip: #5fd3bc;
    --tip-soft: #17302b;
    --warn: #fdba74;
    --warn-soft: #3a2519;
    --kbd: #2c3036;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #15171a;
  --surface: #1d2024;
  --text: #e8e6e3;
  --muted: #a3a8b0;
  --line: #2e3238;
  --accent: #fb923c;
  --accent-soft: #33221a;
  --tip: #5fd3bc;
  --tip-soft: #17302b;
  --warn: #fdba74;
  --warn-soft: #3a2519;
  --kbd: #2c3036;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font:
    16px/1.6 system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    "Noto Sans",
    sans-serif;
}
a {
  color: var(--accent);
}
h1,
h2,
h3 {
  line-height: 1.25;
  margin: 0 0 0.4em;
}
h1 {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
}
h2 {
  font-size: 1.4rem;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.brand {
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}
.brand span {
  color: var(--muted);
  font-weight: 500;
}
.topbar nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
}

.layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 40px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 32px 24px;
}
.toc {
  position: sticky;
  top: 80px;
  align-self: start;
  max-height: calc(100vh - 100px);
  overflow: auto;
  font-size: 0.92rem;
}
.toc p {
  margin: 0 0 8px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.75rem;
}
.toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
}
.toc a {
  display: block;
  padding: 5px 10px;
  border-radius: 6px;
  color: var(--text);
  text-decoration: none;
  border-left: 2px solid transparent;
}
.toc a:hover,
.toc a.active {
  background: var(--accent-soft);
  border-left-color: var(--accent);
}

.hero {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 32px;
}
.hero.center {
  justify-content: center;
  text-align: center;
  padding: 48px 0 24px;
}
.role-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent);
}
.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.lede {
  font-size: 1.15rem;
  color: var(--muted);
  max-width: 62ch;
  margin: 0 auto 0 0;
}
.hero.center .lede {
  margin: 0 auto;
}
.meta,
.small {
  color: var(--muted);
  font-size: 0.88rem;
}

.before {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 40px;
}
.before > div {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 24px;
}
.before h2 {
  font-size: 1.05rem;
}
.before ul {
  margin: 0;
  padding-left: 20px;
}
.before .ask {
  background: var(--warn-soft);
  border-color: transparent;
}

.flow {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0;
  margin: 0 0 48px;
}
.flow li {
  position: relative;
}
.flow li:not(:last-child)::after {
  content: "→";
  margin-left: 10px;
  color: var(--muted);
}
.flow a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
  text-decoration: none;
  font-size: 0.92rem;
}
.flow a:hover {
  border-color: var(--accent);
}
.flow b {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 0.75rem;
}

.task {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 32px;
  margin-bottom: 28px;
  box-shadow: var(--shadow);
}
.goal {
  color: var(--muted);
  margin: 0 0 8px;
}
.where {
  margin: 0 0 20px;
  font-size: 0.92rem;
}
.where span {
  display: inline-block;
  margin-right: 8px;
  padding: 1px 8px;
  border-radius: 4px;
  background: var(--kbd);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
}
.step {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 16px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
}
.step:first-child {
  border-top: 0;
}
.step-num {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}
.action {
  margin: 4px 0 6px;
  font-size: 1.05rem;
}
.result {
  margin: 0 0 14px;
  color: var(--muted);
}
.result span {
  font-weight: 600;
  color: var(--text);
}
strong.ui {
  font-weight: 650;
}
kbd {
  display: inline-block;
  min-width: 1.6em;
  padding: 0 6px;
  border-radius: 5px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  background: var(--kbd);
  font:
    600 0.82em/1.6 ui-monospace,
    Consolas,
    monospace;
  text-align: center;
}
code {
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--kbd);
  font-size: 0.9em;
}

.shot {
  margin: 0 0 14px;
}
.shot img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  cursor: zoom-in;
}
.shot figcaption {
  margin-top: 6px;
}
.shot.missing {
  padding: 28px;
  border: 2px dashed var(--line);
  border-radius: 10px;
  color: var(--muted);
  text-align: center;
  font-size: 0.9rem;
}
.linkish {
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  font-size: 0.88rem;
  cursor: pointer;
}
.note {
  margin: 10px 0 0;
  padding: 12px 14px;
  border-radius: 8px;
  border-left: 4px solid;
}
.note span {
  display: block;
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}
.note.tip {
  background: var(--tip-soft);
  border-color: var(--tip);
}
.note.tip span {
  color: var(--tip);
}
.note.important {
  background: var(--warn-soft);
  border-color: var(--warn);
}
.note.important span {
  color: var(--warn);
}

.home {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px 48px;
}
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}
.card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 24px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
  text-decoration: none;
  box-shadow: var(--shadow);
  transition:
    transform 0.15s,
    border-color 0.15s;
}
.card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}
.card h2 {
  margin-top: 10px;
}
.card p {
  margin: 0;
  color: var(--muted);
}
.cta {
  margin-top: auto;
  padding-top: 12px;
  color: var(--accent);
  font-weight: 600;
}

.narrow {
  max-width: 820px;
  margin: 0 auto;
  padding: 32px 24px;
}
.ref {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
}
.ref th,
.ref td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}
.ref th {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

dialog#lightbox {
  max-width: 96vw;
  max-height: 94vh;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: var(--surface);
}
dialog#lightbox::backdrop {
  background: rgba(0, 0, 0, 0.75);
}
dialog#lightbox img {
  display: block;
  max-width: 96vw;
  max-height: 94vh;
}
dialog#lightbox .close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 0;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 22px;
  cursor: pointer;
}

.foot {
  padding: 24px;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}

@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
    padding: 20px 16px;
    gap: 0;
  }
  .toc {
    display: none;
  }
  .before {
    grid-template-columns: 1fr;
  }
  .task {
    padding: 20px 16px;
  }
  .step {
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 12px;
  }
  .step-num {
    width: 28px;
    height: 28px;
    font-size: 0.9rem;
  }
  .hero {
    flex-direction: column;
  }
  .topbar {
    padding: 12px 16px;
  }
  .home {
    padding: 0 16px 32px;
  }
}
/* Phone screenshots are tall: keep them a readable width on desktop. */
.shot img[src*="/captain/"] {
  max-width: 360px;
}

@media print {
  @page {
    size: A4;
    margin: 14mm;
  }
  body {
    background: #fff;
    color: #000;
    font-size: 11pt;
  }
  .topbar,
  .toc,
  .foot,
  .linkish,
  dialog {
    display: none !important;
  }
  .layout {
    display: block;
    padding: 0;
  }
  .task {
    break-before: page;
    box-shadow: none;
    border: 0;
    padding: 0;
  }
  .step {
    break-inside: avoid;
  }
  .shot img {
    box-shadow: none;
    max-height: 120mm;
    width: auto;
  }
  a {
    color: inherit;
    text-decoration: none;
  }
}

/* ── Docs portal additions ───────────────────────────────────────────── */
.skip {
  position: absolute;
  left: -999px;
  top: 8px;
  padding: 8px 12px;
  background: var(--surface);
  border-radius: 6px;
  z-index: 20;
}
.skip:focus {
  left: 16px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.brand .mark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
}
.topbar nav {
  display: flex;
  gap: 18px;
}
.crumbs {
  max-width: 1180px;
  margin: 0 auto;
  padding: 14px 24px 0;
  font-size: 0.88rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.crumbs a {
  color: var(--muted);
  text-decoration: none;
}
.crumbs a:hover {
  color: var(--accent);
}
.crumbs [aria-current] {
  color: var(--text);
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0 0;
}
.actions.center {
  justify-content: center;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--accent);
}
.btn:hover {
  filter: brightness(1.08);
}
.btn.ghost {
  background: transparent;
  color: var(--accent);
}
.hero-text {
  min-width: 0;
}
.role-icon.big {
  width: 64px;
  height: 64px;
  margin: 0 auto 14px;
  border-radius: 18px;
}
.section-title {
  margin: 8px 0 16px;
  font-size: 1.3rem;
}
.card.soon {
  opacity: 0.72;
  box-shadow: none;
}
.card.soon:hover {
  transform: none;
  border-color: var(--line);
}
.badge {
  align-self: flex-start;
  margin-top: auto;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--kbd);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
}
.portal h1 {
  max-width: 20ch;
  margin: 0 auto 0.4em;
}
.search {
  position: relative;
  max-width: 620px;
  margin: 26px auto 0;
  text-align: left;
}
.search input {
  width: 100%;
  padding: 14px 16px 14px 46px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  box-shadow: var(--shadow);
}
.search input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.search-icon {
  position: absolute;
  left: 15px;
  top: 14px;
  color: var(--muted);
}
.results {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 5;
  list-style: none;
  margin: 0;
  padding: 6px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
  max-height: 60vh;
  overflow: auto;
}
.results a {
  display: block;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
}
.results a:hover,
.results a:focus {
  background: var(--accent-soft);
  outline: none;
}
.results small {
  display: block;
  color: var(--muted);
}
.results .empty {
  padding: 10px 12px;
  color: var(--muted);
}
.how {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin: 48px 0 8px;
}
.how h3 {
  margin: 0 0 6px;
  font-size: 1.05rem;
}
.how p {
  margin: 0;
  color: var(--muted);
}
.print-body {
  max-width: 182mm;
  margin: 0 auto;
}
.print .shot img {
  max-height: 115mm;
  width: auto;
  max-width: 100%;
}
@media (max-width: 900px) {
  .crumbs {
    padding: 12px 16px 0;
  }
  .topbar nav a:last-child {
    display: none;
  }
}
@media print {
  .btn,
  .actions,
  .crumbs,
  .search,
  .skip {
    display: none !important;
  }
}
