@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500&family=IBM+Plex+Sans:wght@400;450;500;600&display=swap');

/* ============================================================
   MATI Docs
   Tokens first, then shell, then content.
   ============================================================ */

:root {
  --accent: #C8102E;

  --ink:       #16181D;
  --ink-2:     #3D434E;
  --muted:     #5F6672;
  --paper:     #FFFFFF;
  --surface:   #F5F6F8;
  --surface-2: #EDEFF3;
  --line:      #E1E4E9;
  --line-soft: #EDEFF2;

  --role-admin-bg:  #FCEBEE;
  --role-admin-fg:  #96122A;
  --role-tech-bg:   #E8F1FA;
  --role-tech-fg:   #14548C;
  --role-dev-bg:    #EDEAF7;
  --role-dev-fg:    #4B3A8C;
  --role-user-bg:   #ECEFF3;
  --role-user-fg:   #4A525E;
  --role-super-bg:  #EDEAF7;
  --role-super-fg:  #4B3A8C;

  --sans: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --rail-l: 264px;
  --rail-r: 232px;
  --topbar: 57px;
  --measure: 72ch;

  --r-sm: 3px;
  --r-md: 5px;
}

[data-scheme="dark"] {
  --ink:       #E7E9ED;
  --ink-2:     #B4BAC5;
  --muted:     #878F9C;
  --paper:     #14161A;
  --surface:   #1A1D23;
  --surface-2: #22262E;
  --line:      #2B3038;
  --line-soft: #23272E;

  --role-admin-bg:  #35161C;
  --role-admin-fg:  #F09AA9;
  --role-tech-bg:   #142534;
  --role-tech-fg:   #8FC2EC;
  --role-dev-bg:    #221E33;
  --role-dev-fg:    #B5A8E8;
  --role-user-bg:   #23272E;
  --role-user-fg:   #A9B0BC;
  --role-super-bg:  #221E33;
  --role-super-fg:  #B5A8E8;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--topbar) + 16px); }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ============================================================
   Top bar
   ============================================================ */

.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  height: var(--topbar);
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 20px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex: 0 0 auto;
  color: var(--ink);
  font-weight: 600;
  letter-spacing: -0.01em;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  font-size: 1.0625rem;
  padding-left: 10px;
  border-left: 3px solid var(--accent);
  line-height: 1.2;
}
.brand-sub {
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--muted);
}

.topbar-search { flex: 1 1 auto; max-width: 420px; position: relative; }

.topbar-search input {
  width: 100%;
  height: 34px;
  padding: 0 12px 0 32px;
  font-family: var(--sans);
  font-size: 0.875rem;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.topbar-search input::placeholder { color: var(--muted); }
.topbar-search input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent);
}
.topbar-search svg {
  position: absolute;
  left: 10px; top: 50%;
  transform: translateY(-50%);
  width: 15px; height: 15px;
  color: var(--muted);
  pointer-events: none;
}

.topbar-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }

.tb-link {
  padding: 6px 10px;
  font-size: 0.875rem;
  color: var(--ink-2);
  border-radius: var(--r-md);
}
.tb-link:hover { background: var(--surface); text-decoration: none; color: var(--ink); }

.tb-icon {
  display: grid;
  place-items: center;
  width: 32px; height: 32px;
  padding: 0;
  color: var(--ink-2);
  background: none;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  cursor: pointer;
}
.tb-icon:hover { background: var(--surface); border-color: var(--line); }
.tb-icon svg { width: 16px; height: 16px; }
[data-scheme="dark"] .icon-sun { display: block; }
[data-scheme="dark"] .icon-moon { display: none; }
.icon-sun { display: none; }
.icon-moon { display: block; }

.nav-toggle { display: none; }

/* ============================================================
   Shell
   ============================================================ */

.shell {
  display: grid;
  grid-template-columns: var(--rail-l) minmax(0, 1fr) var(--rail-r);
  align-items: start;
  max-width: 1560px;
  margin: 0 auto;
}
.shell.no-toc { grid-template-columns: var(--rail-l) minmax(0, 1fr); }

/* ============================================================
   Sidebar
   ============================================================ */

.sidebar {
  position: sticky;
  top: var(--topbar);
  height: calc(100vh - var(--topbar));
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 22px 12px 48px 20px;
  border-right: 1px solid var(--line);
}

.nav-filter {
  width: 100%;
  height: 30px;
  margin-bottom: 14px;
  padding: 0 10px;
  font-family: var(--sans);
  font-size: 0.8125rem;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.nav-filter::placeholder { color: var(--muted); }
.nav-filter:focus { outline: none; border-color: var(--accent); }

.nav-group { margin-bottom: 4px; }

.nav-group-head {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 6px 8px;
  font-family: var(--sans);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink);
  text-align: left;
  background: none;
  border: 0;
  border-radius: var(--r-sm);
  cursor: pointer;
}
.nav-group-head:hover { background: var(--surface); }
.nav-group-head .chev {
  width: 13px; height: 13px;
  flex: 0 0 13px;
  color: var(--muted);
  transition: transform .15s ease;
}
.nav-group[open] > .nav-group-head .chev { transform: rotate(90deg); }
.nav-group-head::-webkit-details-marker { display: none; }

.nav-list { margin: 0 0 6px; padding: 0 0 0 13px; list-style: none; border-left: 1px solid var(--line-soft); }
.nav-list .nav-list { padding-left: 12px; }

.nav-list a {
  display: block;
  position: relative;
  padding: 5px 8px 5px 10px;
  font-size: 0.8438rem;
  line-height: 1.45;
  color: var(--ink-2);
  border-radius: var(--r-sm);
}
.nav-list a:hover { background: var(--surface); color: var(--ink); text-decoration: none; }

.nav-list a.active {
  color: var(--ink);
  font-weight: 500;
  background: var(--surface);
}
.nav-list a.active::before {
  content: "";
  position: absolute;
  left: -14px; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 17px;
  background: var(--accent);
  border-radius: 2px;
}

.nav-empty { padding: 8px 10px; font-size: 0.8125rem; color: var(--muted); }

/* ============================================================
   Main column
   ============================================================ */

.main { min-width: 0; padding: 30px 44px 96px; }

.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  margin-bottom: 18px;
  font-size: 0.8125rem;
  color: var(--muted);
}
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--ink); }
.crumbs .sep { color: var(--line); }
.crumbs .here { color: var(--ink-2); }

.page-head { margin-bottom: 30px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }

.page-head h1 {
  margin: 0;
  font-size: 2rem;
  line-height: 1.22;
  font-weight: 600;
  letter-spacing: -0.021em;
}

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; align-items: center; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  font-family: var(--mono);
  font-size: 0.75rem;
  line-height: 1.7;
  color: var(--role-user-fg);
  background: var(--role-user-bg);
  border-radius: var(--r-sm);
  white-space: nowrap;
}
.chip-key { opacity: .62; }
.chip-role-admin     { background: var(--role-admin-bg); color: var(--role-admin-fg); }
.chip-role-technician{ background: var(--role-tech-bg);  color: var(--role-tech-fg); }
.chip-role-developer { background: var(--role-dev-bg);   color: var(--role-dev-fg); }

.updated { margin-left: auto; font-size: 0.75rem; color: var(--muted); }

/* ============================================================
   Content
   ============================================================ */

.content { max-width: var(--measure); }

.content > *:first-child { margin-top: 0; }

.content h2 {
  margin: 2.4em 0 .7em;
  font-size: 1.375rem;
  line-height: 1.3;
  font-weight: 600;
  letter-spacing: -0.014em;
  scroll-margin-top: calc(var(--topbar) + 20px);
}
.content h3 {
  margin: 2em 0 .6em;
  font-size: 1.0625rem;
  line-height: 1.4;
  font-weight: 600;
  scroll-margin-top: calc(var(--topbar) + 20px);
}
.content h4 {
  margin: 1.8em 0 .5em;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ink-2);
}

.content h2 + h3 { margin-top: 1.1em; }

.content p { margin: 0 0 1.15em; }
.content strong { font-weight: 600; }

.content ul, .content ol { margin: 0 0 1.2em; padding-left: 1.4em; }
.content li { margin-bottom: .45em; }
.content li > ul, .content li > ol { margin-top: .45em; margin-bottom: .2em; }

.content img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1.5em 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.zoomable .content img { cursor: zoom-in; }

.content blockquote {
  margin: 1.5em 0;
  padding: 2px 0 2px 18px;
  color: var(--ink-2);
  border-left: 3px solid var(--accent);
}
.content blockquote p:last-child { margin-bottom: 0; }

.content code {
  padding: 1px 5px;
  font-family: var(--mono);
  font-size: 0.8438em;
  color: var(--ink);
  background: var(--surface-2);
  border-radius: var(--r-sm);
}

.content pre {
  margin: 1.5em 0;
  padding: 15px 17px;
  overflow-x: auto;
  font-size: 0.8438rem;
  line-height: 1.6;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.content pre code { padding: 0; background: none; font-size: inherit; }

.table-scroll { overflow-x: auto; margin: 1.5em 0; }

.content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.content table th {
  padding: 9px 13px;
  text-align: left;
  font-weight: 600;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  white-space: nowrap;
}
.content table td {
  padding: 9px 13px;
  vertical-align: top;
  border: 1px solid var(--line);
}
.content table td code { white-space: nowrap; }

.content hr { margin: 2.2em 0; border: 0; border-top: 1px solid var(--line); }

/* Section landing cards */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
  gap: 12px;
  margin: 26px 0;
  max-width: 100%;
}

.card {
  display: block;
  padding: 15px 16px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.card:hover { border-color: var(--accent); text-decoration: none; }
.card-title { font-size: 0.9375rem; font-weight: 500; line-height: 1.35; }
.card-meta { margin-top: 7px; font-family: var(--mono); font-size: 0.6875rem; color: var(--muted); }
.card-count { margin-top: 6px; font-size: 0.8125rem; color: var(--muted); }

/* Prev / next */

.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 52px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
  max-width: var(--measure);
}

.pager-link {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 12px 15px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.pager-link:hover { border-color: var(--accent); text-decoration: none; }
.pager-next { text-align: right; grid-column: 2; }
.pager-dir { font-size: 0.75rem; color: var(--muted); }
.pager-title { font-size: 0.9062rem; font-weight: 500; line-height: 1.35; }

/* ============================================================
   On-page contents
   ============================================================ */

.toc {
  position: sticky;
  top: var(--topbar);
  max-height: calc(100vh - var(--topbar));
  overflow-y: auto;
  padding: 34px 20px 48px 4px;
}
.toc-head {
  margin: 0 0 10px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ink);
}
.toc ul { margin: 0; padding: 0; list-style: none; border-left: 1px solid var(--line); }
.toc li a {
  display: block;
  padding: 4px 0 4px 12px;
  margin-left: -1px;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--muted);
  border-left: 2px solid transparent;
}
.toc li a:hover { color: var(--ink); text-decoration: none; }
.toc li a.active { color: var(--accent); border-left-color: var(--accent); }
.toc .lvl-3 a { padding-left: 24px; font-size: 0.7812rem; }
.toc[hidden] { display: none; }

/* ============================================================
   Image zoom
   ============================================================ */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  place-items: center;
  padding: 36px;
  background: rgba(10, 12, 15, .86);
  cursor: zoom-out;
}
.lightbox.open { display: grid; }
.lightbox img {
  max-width: 100%;
  max-height: 100%;
  border-radius: var(--r-md);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .45);
}

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 1280px) {
  :root { --rail-l: 248px; --rail-r: 208px; }
  .main { padding-left: 34px; padding-right: 34px; }
}

@media (max-width: 1080px) {
  .shell, .shell.no-toc { grid-template-columns: var(--rail-l) minmax(0, 1fr); }
  .toc { display: none; }
}

@media (max-width: 900px) {
  .shell, .shell.no-toc { grid-template-columns: minmax(0, 1fr); }

  .nav-toggle { display: grid; }

  .sidebar {
    position: fixed;
    top: var(--topbar);
    left: 0;
    z-index: 55;
    width: min(88vw, 320px);
    height: calc(100vh - var(--topbar));
    background: var(--paper);
    border-right: 1px solid var(--line);
    transform: translateX(-102%);
    transition: transform .2s ease;
  }
  body.nav-open .sidebar { transform: translateX(0); }

  body.nav-open::after {
    content: "";
    position: fixed;
    inset: var(--topbar) 0 0 0;
    z-index: 50;
    background: rgba(10, 12, 15, .4);
  }

  .main { padding: 22px 20px 72px; }
  .page-head h1 { font-size: 1.625rem; }
  .topbar { gap: 12px; padding: 0 14px; }
  .brand-sub { display: none; }
  .tb-link { display: none; }
  .pager { grid-template-columns: 1fr; }
  .pager-next { grid-column: 1; text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

@media print {
  .topbar, .sidebar, .toc, .pager, .crumbs { display: none; }
  .shell { display: block; }
  .main { padding: 0; }
  .content { max-width: none; }
  .content img { break-inside: avoid; }
}

/* ============================================================
   Roles — v2
   Each role owns a colour pair, reused on the home card, the
   top-bar pill and the role landing header, so a reader always
   knows which guide they are in.
   ============================================================ */

[data-role="user"],       .role-card-user,       .role-pill-user,       .role-head-user       { --role-fg: var(--role-user-fg);  --role-bg: var(--role-user-bg); }
[data-role="technician"], .role-card-technician, .role-pill-technician, .role-head-technician { --role-fg: var(--role-tech-fg);  --role-bg: var(--role-tech-bg); }
[data-role="admin"],      .role-card-admin,      .role-pill-admin,      .role-head-admin      { --role-fg: var(--role-admin-fg); --role-bg: var(--role-admin-bg); }
[data-role="superadmin"], .role-card-superadmin, .role-pill-superadmin, .role-head-superadmin { --role-fg: var(--role-super-fg); --role-bg: var(--role-super-bg); }

/* top-bar pill */

.role-pill {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  flex: 0 0 auto;
  padding: 3px 10px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--role-fg, var(--ink-2));
  background: var(--role-bg, var(--surface));
  border-radius: var(--r-sm);
}
.role-pill:hover { text-decoration: none; filter: brightness(.97); }
.role-pill-key { font-family: var(--mono); font-size: 0.6875rem; font-weight: 400; opacity: .7; }

/* sidebar role switcher */

.role-switch {
  margin: 0 0 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.role-switch-label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.75rem;
  color: var(--muted);
}
.role-select {
  width: 100%;
  height: 34px;
  padding: 0 30px 0 10px;
  font-family: var(--sans);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink);
  background: var(--paper) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%235F6672' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E") no-repeat right 9px center / 14px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--role-fg, var(--accent));
  border-radius: var(--r-md);
  appearance: none;
  cursor: pointer;
}
.role-select:focus { outline: none; border-color: var(--accent); border-left-color: var(--role-fg, var(--accent)); }

.nav-home, .nav-single {
  display: block;
  margin: 0 0 2px;
  padding: 6px 8px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink);
  border-radius: var(--r-sm);
}
.nav-home { margin-bottom: 10px; color: var(--ink-2); font-weight: 400; }
.nav-home:hover, .nav-single:hover { background: var(--surface); text-decoration: none; }
.nav-home.active, .nav-single.active { background: var(--surface); color: var(--ink); font-weight: 500; }

.nav-group-link { color: inherit; flex: 1; }
.nav-group-link:hover { text-decoration: none; }
.nav-group-head.active .nav-group-link { color: var(--accent); }

.nav-list a.in-path { color: var(--ink); }

.nav-intro { margin: 0 0 12px; font-size: 0.8125rem; line-height: 1.55; color: var(--muted); }
.nav-roles { border-left: 0; padding-left: 0; }

.side-foot {
  margin-top: 26px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.side-foot-note { margin: 6px 0 0; font-size: 0.75rem; color: var(--muted); }

/* export button */

.export-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  font-family: var(--sans);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  cursor: pointer;
  text-align: left;
}
.side-foot .export-btn { width: 100%; }
.export-btn svg { width: 15px; height: 15px; flex: 0 0 15px; color: var(--muted); }
.export-btn:hover { border-color: var(--accent); }
.export-btn[aria-busy="true"] { opacity: .6; cursor: progress; }

/* role landing header */

.role-head { border-bottom: 0; padding-bottom: 0; margin-bottom: 8px; }
.role-head-kicker { margin: 0 0 4px; font-size: 0.8125rem; color: var(--muted); }
.role-head h1 {
  display: inline-block;
  padding-bottom: 4px;
  border-bottom: 3px solid var(--role-fg, var(--accent));
}
.role-head-summary { margin: 14px 0 0; max-width: 62ch; font-size: 1.0625rem; line-height: 1.6; color: var(--ink-2); }

.export-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 34px;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  max-width: var(--measure);
}
.export-panel-head { margin: 0 0 3px; font-size: 0.9375rem; font-weight: 600; }
.export-panel-text { margin: 0; font-size: 0.8438rem; line-height: 1.55; color: var(--muted); }
.export-panel .export-btn { flex: 0 0 auto; }

/* ============================================================
   Home — role picker
   ============================================================ */

.home {
  padding: 64px 28px 96px;
}
.home-inner { max-width: 1080px; margin: 0 auto; }

.home-head { max-width: 640px; margin-bottom: 40px; }
.home-kicker {
  margin: 0 0 12px;
  font-size: 0.875rem;
  color: var(--muted);
  padding-left: 10px;
  border-left: 3px solid var(--accent);
}
.home-title {
  margin: 0;
  font-size: 2.5rem;
  line-height: 1.15;
  font-weight: 600;
  letter-spacing: -0.025em;
}
.home-lead, .home-lead p {
  margin: 16px 0 0;
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--ink-2);
}
.home-lead p:first-child { margin-top: 16px; }

.home-resume {
  margin: -16px 0 24px;
  font-size: 0.9375rem;
  color: var(--ink-2);
}
.home-resume a { font-weight: 500; }

.role-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.role-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 188px;
  padding: 22px 20px 18px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-top: 4px solid var(--role-fg, var(--accent));
  border-radius: var(--r-md);
  transition: border-color .15s ease, transform .15s ease;
}
.role-card:hover {
  text-decoration: none;
  border-color: var(--role-fg, var(--accent));
  transform: translateY(-2px);
}
.role-card-label { font-size: 1.25rem; font-weight: 600; letter-spacing: -0.012em; }
.role-card-summary { font-size: 0.875rem; line-height: 1.55; color: var(--ink-2); }
.role-card-meta {
  margin-top: auto;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--role-fg, var(--muted));
}
.role-card.is-last {
  box-shadow: 0 0 0 2px var(--role-fg, var(--accent));
}

.home-empty { grid-column: 1 / -1; color: var(--muted); }

.home-export {
  margin-top: 56px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  max-width: 720px;
}
.home-export-head { margin: 0; font-size: 1.0625rem; font-weight: 600; }
.home-export-text { margin: 8px 0 16px; font-size: 0.9062rem; line-height: 1.6; color: var(--ink-2); }
.home-export-list { display: flex; flex-wrap: wrap; gap: 8px; }

.chip-locked { background: var(--role-admin-bg); color: var(--role-admin-fg); }

@media (max-width: 960px) {
  .home-title { font-size: 2rem; }
}

@media (max-width: 900px) {
  .role-pill { display: none; }
  .export-panel { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 560px) {
  .role-grid { grid-template-columns: minmax(0, 1fr); }
  .role-card { min-height: 0; }
  .home { padding: 36px 18px 64px; }
}

/* ============================================================
   Scope callout — v2.1
   The reach this role has for the page's feature, taken from the
   Capability Matrix. Shown before the steps so readers know what
   they will and will not see.
   ============================================================ */

.scope-callout {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  margin: 16px 0 0;
  padding: 10px 14px;
  max-width: var(--measure);
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--ink);
  background: var(--role-bg, var(--surface));
  border-left: 3px solid var(--role-fg, var(--accent));
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
}
.scope-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--role-fg, var(--ink-2));
}

/* ============================================================
   v2.2 — branding, search, icons, read ticks, footer
   ============================================================ */

/* ---------- page-change loading bar ---------- */

.load-bar {
  position: fixed;
  top: 0; left: 0;
  z-index: 100;
  height: 2px;
  width: 0;
  background: var(--accent);
  opacity: 0;
  pointer-events: none;
}
.load-bar.is-loading { opacity: 1; width: 72%; transition: width 2.5s cubic-bezier(.1,.7,.2,1); }
.load-bar.is-done    { opacity: 0; width: 100%; transition: width .15s ease, opacity .35s ease .15s; }

.main { transition: opacity .14s ease; }
.main.is-leaving { opacity: .55; }
.main.is-entering { opacity: 0; transition: none; }

/* ---------- brand ---------- */

.brand { align-items: center; gap: 12px; }
.brand-logo { display: block; height: 32px; width: auto; }
.brand-logo-dark { display: none; }
[data-scheme="dark"] .brand-logo-light { display: none; }
[data-scheme="dark"] .brand-logo-dark { display: block; }
.brand .brand-sub {
  padding-left: 12px;
  border-left: 1px solid var(--line);
  font-size: 0.875rem;
  line-height: 1.3;
}

/* ---------- top-bar search ---------- */

.topbar-search input { padding-right: 58px; }
.topbar-search input::-webkit-search-cancel-button { display: none; }
.search-kbd {
  position: absolute;
  right: 8px; top: 50%;
  transform: translateY(-50%);
  padding: 1px 6px;
  font-family: var(--mono);
  font-size: 0.6875rem;
  color: var(--muted);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  pointer-events: none;
}
.topbar-search.is-open .search-kbd { display: none; }

.search-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: min(560px, calc(100vw - 32px));
  max-height: min(70vh, 560px);
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 16px 40px rgba(16, 20, 28, .16), 0 2px 6px rgba(16, 20, 28, .06);
  overflow: hidden;
  z-index: 70;
}
.search-panel[hidden] { display: none; }
[data-scheme="dark"] .search-panel { box-shadow: 0 16px 40px rgba(0, 0, 0, .5); }

.search-scope {
  display: flex;
  gap: 4px;
  padding: 8px 8px 0;
}
.search-scope button {
  padding: 4px 10px;
  font-family: var(--sans);
  font-size: 0.75rem;
  color: var(--muted);
  background: none;
  border: 1px solid transparent;
  border-radius: 99px;
  cursor: pointer;
}
.search-scope button:hover { color: var(--ink); }
.search-scope button.is-on { color: var(--ink); background: var(--surface); border-color: var(--line); font-weight: 500; }

.search-list {
  margin: 0;
  padding: 6px;
  list-style: none;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.search-list:empty { display: none; }

.search-hit {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 9px 11px;
  color: var(--ink);
  border-radius: 6px;
}
.search-hit:hover { text-decoration: none; }
.is-sel > .search-hit { background: var(--surface); box-shadow: inset 3px 0 0 var(--accent); }
.search-hit-title { font-size: 0.9062rem; font-weight: 500; line-height: 1.35; }
.search-hit-path { font-size: 0.75rem; color: var(--muted); }
.search-hit-text {
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--ink-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.search-hit mark {
  color: inherit;
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  border-radius: 2px;
  padding: 0 1px;
}

.search-status {
  margin: 0;
  padding: 8px 14px;
  font-size: 0.75rem;
  color: var(--muted);
  border-top: 1px solid var(--line-soft);
}
.search-list:empty + .search-status { border-top: 0; padding: 14px; font-size: 0.8125rem; }
.search-link {
  padding: 0;
  font: inherit;
  color: var(--accent);
  background: none;
  border: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.search-toggle { display: none; }

/* ---------- sidebar icons and read ticks ---------- */

.nav-filter-wrap { position: relative; }
.nav-filter-wrap .icon {
  position: absolute;
  left: 9px; top: 7px;
  width: 15px; height: 15px;
  color: var(--muted);
  pointer-events: none;
}
.nav-filter-wrap .nav-filter { padding-left: 31px; }

.nav-ico {
  display: grid;
  place-items: center;
  flex: 0 0 20px;
  width: 20px; height: 20px;
  color: var(--muted);
}
.nav-ico .icon { width: 17px; height: 17px; }

.nav-home, .nav-single {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-group-head { gap: 10px; padding: 6px 8px; }
.nav-group-head .chev { margin-left: auto; order: 3; }
.nav-group-link { display: flex; align-items: center; gap: 8px; min-width: 0; }

.nav-home:hover .nav-ico, .nav-single:hover .nav-ico, .nav-group-head:hover .nav-ico { color: var(--ink-2); }
.nav-home.active .nav-ico, .nav-single.active .nav-ico,
.nav-group-head.active .nav-ico, .nav-group-head.in-path .nav-ico { color: var(--accent); }

.nav-single.active, .nav-home.active { box-shadow: inset 3px 0 0 var(--accent); }
.nav-group-head.active { background: var(--surface); box-shadow: inset 3px 0 0 var(--accent); }

.nav-list { margin-left: 18px; }
.nav-list .nav-list { margin-left: 0; }

.nav-list a { display: flex; align-items: flex-start; gap: 6px; }

.nav-label { flex: 1 1 auto; min-width: 0; }

.read-tick {
  flex: 0 0 14px;
  width: 14px; height: 14px;
  margin-top: 3px;
  border-radius: 50%;
  opacity: 0;
  transform: scale(.6);
  transition: opacity .2s ease, transform .2s ease;
  background: var(--read, #1F9D55) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 8.4 2.6 2.6L12 5.6'/%3E%3C/svg%3E") center / 11px no-repeat;
}
.nav-home .read-tick, .nav-single .read-tick, .nav-group-link .read-tick { margin-top: 0; }
.is-read > .read-tick,
.is-read .read-tick { opacity: 1; transform: none; }

/* A finished section gets a tick on its heading too */
.nav-group.is-complete > .nav-group-head .nav-ico { color: var(--read, #1F9D55); }

[data-scheme="dark"] { --read: #3BB273; }

.read-progress {
  margin-top: 22px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.read-progress[hidden] { display: none; }
.read-progress-bar { height: 4px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.read-progress-bar span { display: block; height: 100%; width: 0; background: var(--read, #1F9D55); border-radius: 99px; transition: width .3s ease; }
.read-progress-text {
  margin: 7px 0 0;
  font-size: 0.75rem;
  color: var(--muted);
}
.read-clear {
  float: right;
  padding: 0;
  font: inherit;
  color: var(--muted);
  background: none;
  border: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.read-clear:hover { color: var(--ink); }

.read-sentinel { height: 1px; }

/* ---------- on-page contents ---------- */

.toc-head {
  font-size: 0.6875rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.toc-top {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  font-size: 0.75rem;
  color: var(--muted);
}
.toc-top svg { width: 13px; height: 13px; }
.toc-top:hover { color: var(--ink); text-decoration: none; }

/* ---------- pager ---------- */

.pager-dir { display: inline-flex; align-items: center; gap: 4px; }
.pager-next .pager-dir { justify-content: flex-end; }
.pager-dir svg { width: 13px; height: 13px; }

/* ---------- footer ---------- */

.site-foot {
  margin-top: 64px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  max-width: var(--measure);
}
.site-foot-inner, .foot-bottom { font-size: 0.8125rem; }
.site-foot a { color: var(--ink-2); }
.site-foot a:hover { color: var(--ink); }

.site-foot-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 24px 40px;
}
.foot-logo { display: inline-block; }
.foot-logo img { display: block; width: auto; }
.foot-logo .brand-logo-dark { display: none; }
[data-scheme="dark"] .foot-logo .brand-logo-light { display: none; }
[data-scheme="dark"] .foot-logo .brand-logo-dark { display: block; }

.foot-head {
  margin: 0 0 8px;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.foot-col ul { margin: 0; padding: 0; list-style: none; }
.foot-col li { margin-bottom: 6px; }

.social-list { display: flex; gap: 8px; }
.social-list li { margin: 0; }
.social-link {
  display: grid;
  place-items: center;
  width: 34px; height: 34px;
  color: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: 50%;
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.social-link svg { width: 15px; height: 15px; }
.social-link:hover { text-decoration: none; color: #fff; border-color: transparent; }
.social-linkedin:hover { background: #0A66C2; }
.social-facebook:hover { background: #1877F2; }
.social-youtube:hover  { background: #FF0000; }
.social-website:hover  { background: var(--accent); }

.foot-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 20px;
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
}
.foot-bottom p { margin: 0; }
.foot-legal { display: flex; flex-wrap: wrap; gap: 4px 8px; }

/* Inside a guide: logo + social on one row, legal links in the bottom line */
.site-foot-compact .site-foot-inner { align-items: center; justify-content: space-between; }
.site-foot-compact .foot-col:not(.foot-social) { display: none; }
.site-foot-compact .foot-social .foot-head { display: none; }

/* Home page: full-width footer with columns */
.site-foot-full {
  max-width: none;
  margin-top: 0;
  padding: 44px 28px 36px;
  background: var(--surface);
}
.site-foot-full .site-foot-inner,
.site-foot-full .foot-bottom { max-width: 1080px; margin-left: auto; margin-right: auto; }
.site-foot-full .site-foot-inner { justify-content: space-between; }
.site-foot-full .foot-brand { max-width: 300px; }
.site-foot-full .foot-tagline { margin: 12px 0 0; line-height: 1.55; }
.site-foot-full .foot-legal { display: none; }

/* ---------- home: company band ---------- */

.home-company {
  display: flex;
  align-items: center;
  gap: 28px;
  margin-top: 56px;
  padding: 26px 28px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.home-company-logo { flex: 0 0 auto; }
.home-company-logo img { display: block; width: 114px; height: auto; }
.home-company-logo .brand-logo-dark { display: none; }
[data-scheme="dark"] .home-company-logo .brand-logo-light { display: none; }
[data-scheme="dark"] .home-company-logo .brand-logo-dark { display: block; }
.home-company-text h2 { margin: 0; font-size: 1.125rem; font-weight: 600; letter-spacing: -0.01em; }
.home-company-text p { margin: 6px 0 0; max-width: 62ch; font-size: 0.9375rem; line-height: 1.6; color: var(--ink-2); }
.home-company-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; padding: 0; list-style: none; }
.home-company-links a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 99px;
}
.home-company-links a:hover { border-color: var(--accent); text-decoration: none; }
.home-company-links .icon { width: 15px; height: 15px; color: var(--muted); }

.home-export { max-width: none; }

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  .brand .brand-sub { display: none; }
  .brand-logo { height: 28px; }

  .topbar-search { display: none; }
  .search-toggle { display: grid; }
  body.search-open .topbar-search {
    display: block;
    position: absolute;
    left: 10px; right: 10px; top: 11px;
    max-width: none;
    z-index: 75;
  }
  body.search-open .search-panel { width: 100%; }
  .search-kbd { display: none; }

  .site-foot-full .site-foot-inner { flex-direction: column; }
}

@media (max-width: 560px) {
  .home-company { flex-direction: column; align-items: flex-start; padding: 22px 20px; }
  .foot-bottom { flex-direction: column; }
}

@media print {
  .site-foot, .load-bar, .read-progress { display: none; }
}
