/* Documentation: the Privacy Policy's layout (terms.css), with what a guide needs on top: running text, steps, code,
   reference tables and the names of things on screen. Builds on styles.css and terms.css. */

/* ---------- Table of contents: the parts of the guide ---------- */
.toc li.toc-group {
  margin: 18px 0 6px 14px;
  font-size: 12.5px; font-weight: 600; line-height: 1.4;
  color: var(--faint);
}
.toc li.toc-group:first-child { margin-top: 0; }

/* ---------- Where to start ---------- */
.summary-grid a.start {
  display: block; height: 100%;
  margin: -14px; padding: 14px;
  border-radius: 12px;
  transition: background-color 150ms ease, transform 160ms var(--ease-out);
}
.summary-grid a.start:hover { background: rgba(255, 255, 255, .03); }
.summary-grid a.start:active { transform: scale(var(--press)); }
.summary-grid a.start b { display: flex; align-items: center; gap: 10px; }
.summary-grid a.start .ic { width: 18px; height: 18px; flex: none; color: var(--accent); }

/* ---------- Running text ---------- */
.prose { display: grid; gap: 16px; font-size: 16px; line-height: 1.75; color: var(--doc-text); }
.prose > * { min-width: 0; }
.tldr + .prose { margin-top: 0; }
.prose strong, .prose b { color: var(--text); font-weight: 600; }
.prose h3 {
  margin-top: 18px;
  font-size: 19px; font-weight: 650; line-height: 1.35; letter-spacing: -.015em;
  color: var(--text);
  scroll-margin-top: calc(var(--nav-h) + 20px);
}
.prose h4 { margin-top: 6px; font-size: 16px; font-weight: 600; color: var(--text); }
.prose .bullets { margin: 0; }

/* The name of something on screen, as Modal writes it: Settings › Modules */
.ui { color: var(--text); font-weight: 600; white-space: nowrap; }

/* Code in a sentence */
.prose code, .defs code, .history code, .callout code, .steps code {
  padding: .1em .38em;
  border-radius: 6px;
  font-family: var(--mono); font-size: .86em;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  overflow-wrap: anywhere;
}

kbd {
  display: inline-block; min-width: 1.6em;
  padding: .05em .45em;
  border-radius: 6px;
  font-family: inherit; font-size: .82em; font-weight: 600; text-align: center;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, .06);
}

/* ---------- Steps ---------- */
.steps { display: grid; gap: 14px; counter-reset: step; }
.steps > li {
  position: relative;
  padding-left: 44px; min-height: 28px;
  counter-increment: step;
}
.steps > li::before {
  content: counter(step);
  position: absolute; left: 0; top: .1em;
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 13.5px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(92, 200, 255, .25);
}

/* ---------- Code blocks ---------- */
.code {
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  overflow: hidden;
}
.code-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 42px; padding: 4px 6px 4px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  font-size: 13.5px; font-weight: 600; color: var(--muted);
  font-family: var(--mono);
}
.code pre {
  margin: 0; padding: 16px 18px;
  overflow-x: auto;
  scrollbar-width: thin; scrollbar-color: var(--surface-3) transparent;
  font-family: var(--mono); font-size: 13.5px; line-height: 1.7;
  color: #d5dee7;
  tab-size: 2;
}
.code pre:focus-visible { outline-offset: -2px; }
/* The code inside a block isn't the code in a sentence */
.prose .code code {
  padding: 0; border: 0; border-radius: 0;
  background: none; color: inherit;
  font-size: inherit; overflow-wrap: normal;
}
.code .c { color: var(--faint); }
.copy {
  display: inline-flex; align-items: center; gap: 7px;
  min-height: 32px; padding: 0 10px;
  border-radius: 8px;
  font-family: inherit; font-size: 13px; font-weight: 600;
  color: var(--muted);
  transition: color 150ms ease, background-color 150ms ease, transform 160ms var(--ease-out);
}
.copy:hover { color: var(--text); background: rgba(255, 255, 255, .06); }
.copy:active { transform: scale(var(--press)); }
.copy .ic { width: 15px; height: 15px; }
.copy.done { color: var(--accent); }

/* ---------- Reference tables (the Privacy Policy's tables, a little denser) ---------- */
.prose .table-scroll { margin-top: 0; }
.ref td:first-child { white-space: nowrap; }
.ref td:first-child code { font-weight: 600; }
.ref td { font-size: 14.5px; }
.ref.api td:first-child { white-space: normal; }
.ref td:first-child code { white-space: nowrap; overflow-wrap: normal; } /* a name stays whole */

/* A permission's colour, as the window that adds a module shows it */
.perm {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 1px 9px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; white-space: nowrap;
  color: var(--muted); background: var(--surface-2); border: 1px solid var(--border);
}
.perm::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.perm.warn { color: var(--warn); background: var(--warn-soft); border-color: rgba(242, 194, 90, .25); }
.perm.danger { color: #ff8a80; background: rgba(255, 107, 96, .1); border-color: rgba(255, 107, 96, .3); }

/* The "Install with one click" picture, at its real size */
.one-click { display: block; width: 420px; max-width: 100%; height: auto; image-rendering: auto; }
.sample {
  padding: 18px;
  border-radius: 14px;
  border: 1px dashed var(--border-strong);
  background: var(--surface);
}

.prose > .callout { margin-top: 0; }
.prose .callout p + p { margin-top: 6px; }

@media (max-width: 760px) {
  .prose h3 { font-size: 18px; }
  .code pre { font-size: 13px; padding: 14px; }
  .summary-grid a.start { margin: -10px; padding: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .copy, .summary-grid a.start { transition: none; }
}

@media print {
  .copy { display: none !important; }
  .code, .code-head, .code pre, .prose code, kbd, .perm, .sample { background: none !important; border-color: #ccc !important; color: #111 !important; box-shadow: none !important; }
  .code pre { white-space: pre-wrap; }
  .code, .steps > li, .table-scroll { break-inside: avoid; }
  .ui, .prose h3, .prose h4 { color: #000; }
  .steps > li::before { color: #000; background: none; border-color: #999; }
}
