/* Subtext user guide — sidebar + article, layered on /styles.css.
   Inherits --bg/--ink/--navy/--hairline and the light+dark palette from there. */

.guide {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 56px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px 96px;
  align-items: start;
}

/* ---- Sidebar (desktop) ---- */
.toc {
  position: sticky;
  top: 64px; /* clears the sticky site header */
  max-height: calc(100vh - 64px);
  overflow-y: auto;
  padding: 40px 0 40px;
  border-right: 1px solid var(--hairline);
  margin-right: -20px;
  padding-right: 20px;
}
.toc-home {
  display: block;
  font-size: 15px;
  font-weight: 800;
  font-style: italic;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
  margin-bottom: 26px;
}
.toc-sec + .toc-sec { margin-top: 26px; }
.toc-h {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ash);
  margin-bottom: 10px;
}
/* The same list styling drives the desktop rail and the mobile disclosure. */
.toc ul, .toc-m ul { list-style: none; margin: 0; padding: 0; }
.toc li, .toc-m li { margin: 0; }
.toc a, .toc-m nav a {
  display: block;
  padding: 6px 12px;
  margin-left: -12px;
  border-radius: 8px;
  color: var(--ink-dim);
  text-decoration: none;
  font-size: 15px;
  line-height: 1.45;
}
/* The chapter number in front of a sidebar link. */
.toc .tn, .toc-m nav .tn {
  display: inline-block;
  width: 18px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--ash);
}
.toc a.on .tn, .toc-m nav a.on .tn { color: var(--navy); }
.toc a:hover, .toc-m nav a:hover { color: var(--ink); background: color-mix(in srgb, var(--navy) 6%, transparent); }
.toc a.on, .toc-m nav a.on {
  color: var(--navy);
  font-weight: 650;
  background: color-mix(in srgb, var(--navy) 10%, transparent);
}

/* ---- Sidebar (mobile) — a disclosure above the article ---- */
.toc-m { display: none; }
.toc-m summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 0;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--navy);
}
.toc-m summary::-webkit-details-marker { display: none; }
.toc-m summary::after { content: "▾"; margin-left: auto; font-size: 13px; color: var(--ash); }
.toc-m[open] summary::after { content: "▴"; }
.toc-m-now {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ash);
}
/* The 12px left pad offsets the negative margin the links carry for the rail. */
.toc-m nav { padding: 4px 0 22px 12px; }

/* ---- Article ---- */
.doc { padding-top: 48px; min-width: 0; }
.doc article { max-width: 68ch; }
.doc h1 {
  font-size: clamp(34px, 5.6vw, 52px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.02;
  font-style: italic;
  margin: 14px 0 0;
}
.doc .lede {
  margin-top: 18px;
  font-size: clamp(18px, 2.3vw, 21px);
  font-weight: 500;
  line-height: 1.6;
  color: var(--ink-dim);
}
.doc h2 {
  font-size: clamp(21px, 2.6vw, 26px);
  font-weight: 800;
  letter-spacing: -0.025em;
  margin: 52px 0 14px;
  scroll-margin-top: 84px;
}
.doc p { color: var(--ink-dim); font-size: 17px; line-height: 1.68; margin-bottom: 16px; }
.doc p b, .doc li b, .doc dd b { color: var(--ink); font-weight: 600; }
.doc a { color: var(--navy); text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }
.doc code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: color-mix(in srgb, var(--navy) 8%, transparent);
  padding: 2px 6px;
  border-radius: 5px;
  color: var(--ink);
}

/* Numbered steps — the guide's spine. */
.steps { list-style: none; margin: 22px 0 26px; padding: 0; counter-reset: step; }
.steps li {
  position: relative;
  counter-increment: step;
  padding-left: 46px;
  margin-bottom: 16px;
  color: var(--ink-dim);
  font-size: 17px;
  line-height: 1.62;
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 1px;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--navy);
  color: #fff;
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* The welcome page's eight chapters. */
.chapters { list-style: none; margin: 24px 0 8px; padding: 0; }
.chapters li { margin-bottom: 10px; }
.chapters a {
  display: flex;
  gap: 16px;
  align-items: baseline;
  padding: 16px 18px;
  border: 1px solid var(--hairline);
  border-radius: 14px;
  background: var(--surface);
  text-decoration: none;
  transition: transform .16s ease, border-color .16s ease;
}
.chapters a:hover { transform: translateY(-1px); border-color: color-mix(in srgb, var(--navy) 40%, transparent); }
.chapters .cn { flex: none; font-family: var(--mono); font-size: 13px; font-weight: 700; color: var(--navy); }
.chapters .ct { display: flex; flex-direction: column; gap: 3px; }
.chapters .ct b { font-size: 17px; font-weight: 700; letter-spacing: -0.015em; color: var(--ink); }
.chapters .ct i { font-style: normal; font-size: 15px; line-height: 1.5; color: var(--ink-dim); }

.bullets { list-style: none; margin: 4px 0 22px; padding: 0; }
.bullets li {
  position: relative;
  padding-left: 24px;
  margin-bottom: 11px;
  color: var(--ink-dim);
  font-size: 17px;
  line-height: 1.62;
}
.bullets li::before { content: "→"; position: absolute; left: 0; color: var(--navy); font-weight: 700; }

/* Definition rows — one control, one sentence. */
.defs { margin: 22px 0 26px; }
.defs dt {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
  margin-top: 18px;
}
.defs dt:first-child { margin-top: 0; }
.defs dd {
  margin: 5px 0 0;
  padding-left: 0;
  color: var(--ink-dim);
  font-size: 16.5px;
  line-height: 1.62;
}
@media (min-width: 720px) {
  .defs { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 0 24px; }
  .defs dt { margin-top: 0; padding-top: 14px; }
  .defs dd { margin: 0; padding-top: 14px; }
  .defs dt + dd { border-top: 1px solid var(--hairline); }
  .defs dt { border-top: 1px solid var(--hairline); }
  .defs > dt:first-child, .defs > dt:first-child + dd { border-top: 0; padding-top: 0; }
}

.callout {
  margin: 28px 0;
  padding: 18px 20px;
  border-radius: 14px;
  border: 1px solid var(--hairline);
  border-left: 3px solid var(--navy);
  background: var(--surface);
}
.callout b { display: block; font-size: 15px; font-weight: 700; color: var(--ink); margin-bottom: 6px; }
.callout p { margin: 0; font-size: 16px; line-height: 1.62; }
.callout.warn { border-left-color: var(--amber); }

/* ---- Figures ---- */
.fig { margin: 34px 0 38px; }
.fig-media { display: flex; justify-content: center; }
.fig img { display: block; width: 100%; height: auto; }
.fig figcaption {
  margin-top: 14px;
  text-align: center;
  color: var(--ash);
  font-size: 14.5px;
  line-height: 1.55;
}
.fig figcaption b { color: var(--ink-dim); font-weight: 600; }

/* Portrait phone: framed like a device, kept small. */
.fig-phone .fig-media > * {
  width: 100%;
  max-width: 292px;
  border-radius: 30px;
  overflow: hidden;
  border: 1px solid var(--hairline);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.14);
}
/* Landscape phone (the teleprompter) and full-width art. */
.fig-landscape .fig-media > *,
.fig-wide .fig-media > * {
  width: 100%;
  max-width: 640px;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--hairline);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.12);
}
/* A cropped close-up of one control — no device frame. */
.fig-detail .fig-media > * {
  width: 100%;
  max-width: 470px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--hairline);
}

/* Placeholder shown until the PNG lands in web/guide/img/. */
.ph {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  padding: 28px 22px;
  min-height: 190px;
  background: color-mix(in srgb, var(--navy) 4%, transparent);
  border: 1.5px dashed color-mix(in srgb, var(--navy) 34%, transparent) !important;
  box-shadow: none !important;
}
.fig-phone .ph { aspect-ratio: 9 / 19.5; }
.fig-landscape .ph { aspect-ratio: 19.5 / 9; }
.ph-k {
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--navy);
}
.ph code { font-family: var(--mono); font-size: 12.5px; color: var(--ink); background: none; padding: 0; }
.ph p { margin: 0; font-size: 13px; line-height: 1.5; color: var(--ash); max-width: 34ch; }

/* ---- Pager + helpline ---- */
.pager {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 72px;
  padding-top: 26px;
  border-top: 1px solid var(--hairline);
}
.pg {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-decoration: none;
  padding: 14px 18px;
  border: 1px solid var(--hairline);
  border-radius: 14px;
  background: var(--surface);
  max-width: 47%;
}
.pg:hover { border-color: color-mix(in srgb, var(--navy) 40%, transparent); }
.pg.next { text-align: right; margin-left: auto; }
.pg span { font-family: var(--mono); font-size: 10px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ash); }
.pg b { font-size: 16px; font-weight: 650; letter-spacing: -0.015em; color: var(--ink); }
.helpline { margin-top: 34px; font-size: 14px; color: var(--ash); }
.helpline a { color: var(--ink-dim); }

@media (max-width: 900px) {
  .guide { grid-template-columns: minmax(0, 1fr); gap: 0; padding-bottom: 64px; }
  .toc { display: none; }
  .toc-m { display: block; border-bottom: 1px solid var(--hairline); margin-top: 8px; }
  .doc { padding-top: 28px; }
  .doc h2 { margin-top: 42px; }
  .pg { max-width: 100%; }
}
