/* Getting-started guide — extends ../styles.css (brand tokens, nav, cards, footer).
   Only guide-specific layout lives here: the two-column doc layout, the sticky
   contents rail, mobile contents sheet, steps, tables and callouts. */

:root {
  --guide-rail: 250px;
  --guide-gap: 40px;
}

/* ---------- Hero ---------- */
.guide-hero {
  padding: 48px 0 24px;
}

.guide-hero h1 {
  margin: 18px 0 0;
  max-width: 820px;
  font-family: var(--serif);
  font-size: clamp(2.6rem, 6vw, 4.6rem);
  line-height: 1;
  letter-spacing: -0.04em;
}

.guide-hero .hero-lead {
  max-width: 700px;
}

.guide-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.guide-meta span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 13px;
  border-radius: 999px;
  border: 1px solid rgba(30, 27, 24, 0.08);
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink-soft);
  font-size: 0.86rem;
  font-weight: 700;
}

.guide-meta img {
  width: 18px;
  height: 18px;
  opacity: 0.75;
}

/* ---------- Two-column layout ---------- */
.guide-layout {
  display: grid;
  grid-template-columns: var(--guide-rail) minmax(0, 1fr);
  gap: var(--guide-gap);
  align-items: start;
  padding: 24px 0 64px;
}

.guide-body {
  min-width: 0;
}

/* ---------- Contents rail (desktop) ---------- */
.guide-toc {
  position: sticky;
  top: 88px;
  max-height: calc(100vh - 104px);
  overflow-y: auto;
  padding: 18px 18px 18px 0;
}

.guide-toc-title {
  margin: 0 0 10px;
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.guide-toc-list {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: toc;
}

.guide-toc-list li {
  counter-increment: toc;
  margin: 0;
}

.guide-toc-list a {
  display: flex;
  gap: 10px;
  align-items: baseline;
  padding: 7px 10px 7px 12px;
  border-left: 2px solid transparent;
  border-radius: 0 10px 10px 0;
  color: var(--ink-soft);
  font-size: 0.94rem;
  font-weight: 600;
  line-height: 1.35;
  transition: color 140ms ease, background 140ms ease, border-color 140ms ease;
}

.guide-toc-list a::before {
  content: counter(toc, decimal-leading-zero);
  flex: 0 0 auto;
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.guide-toc-list a:hover,
.guide-toc-list a:focus-visible {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.6);
}

.guide-toc-list a.is-active {
  color: var(--ink);
  border-left-color: var(--accent);
  background: rgba(217, 114, 30, 0.08);
}

/* ---------- Mobile contents: floating pill + bottom sheet ---------- */
.toc-fab {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 30;
  display: none;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 18px 0 14px;
  border: 0;
  border-radius: 999px;
  background: var(--charcoal);
  color: #fff;
  font: inherit;
  font-size: 0.94rem;
  font-weight: 800;
  box-shadow: var(--shadow-lg);
  cursor: pointer;
}

.toc-fab svg {
  width: 18px;
  height: 18px;
}

.toc-sheet {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
  align-items: flex-end;
  background: rgba(30, 27, 24, 0.42);
}

.toc-sheet[data-open="true"] {
  display: flex;
}

.toc-sheet-panel {
  width: 100%;
  max-height: 78vh;
  overflow-y: auto;
  padding: 14px 20px calc(20px + env(safe-area-inset-bottom));
  border-radius: 24px 24px 0 0;
  background: var(--surface-strong);
  box-shadow: var(--shadow-lg);
  animation: cookie-slide-up 240ms ease both;
}

.toc-sheet-grip {
  width: 44px;
  height: 5px;
  margin: 0 auto 14px;
  border-radius: 999px;
  background: rgba(30, 27, 24, 0.16);
}

.toc-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.toc-sheet-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.4rem;
  letter-spacing: -0.02em;
}

.toc-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.8);
  color: var(--ink);
  font: inherit;
  font-size: 1.2rem;
  cursor: pointer;
}

.toc-sheet .guide-toc-list a {
  padding: 11px 12px;
  border-bottom: 1px solid rgba(30, 27, 24, 0.06);
  border-left: 0;
  border-radius: 0;
  font-size: 1rem;
}

body.toc-open {
  overflow: hidden;
}

/* ---------- Sections ---------- */
.guide-section {
  padding: 28px 0 40px;
  scroll-margin-top: 96px;
}

.guide-section + .guide-section {
  border-top: 1px solid rgba(30, 27, 24, 0.08);
}

.guide-section h2 {
  margin: 14px 0 0;
  font-family: var(--serif);
  font-size: clamp(1.9rem, 3.6vw, 2.7rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
}

.guide-section h3 {
  margin: 30px 0 10px;
  font-family: var(--serif);
  font-size: 1.35rem;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.guide-section > p,
.guide-section li,
.guide-lead {
  color: var(--ink-soft);
  line-height: 1.75;
}

.guide-section > p {
  max-width: 720px;
  margin: 14px 0 0;
}

.guide-section ul {
  max-width: 720px;
  margin: 12px 0 0;
  padding-left: 1.2rem;
}

.guide-section li + li {
  margin-top: 6px;
}

.guide-section strong {
  color: var(--ink);
}

.guide-section a:not(.button-primary):not(.button-secondary) {
  color: var(--accent-strong);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* An on-screen control or label as it appears in the app. */
.ui {
  display: inline-block;
  padding: 1px 8px;
  border: 1px solid rgba(30, 27, 24, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.85);
  color: var(--ink);
  font-size: 0.9em;
  font-weight: 700;
  white-space: nowrap;
}

/* ---------- Split: copy beside a phone screenshot ---------- */
.guide-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 32px;
  align-items: start;
  margin-top: 8px;
}

.guide-split > div:first-child > p:first-child {
  margin-top: 14px;
}

.guide-shot {
  position: sticky;
  top: 100px;
  margin: 18px 0 0;
}

.guide-shot .phone-frame {
  padding: 8px;
  border-radius: 34px;
}

.guide-shot .phone-frame img {
  border-radius: 26px;
}

.guide-shot figcaption {
  margin: 10px 6px 0;
  color: var(--ink-soft);
  font-size: 0.86rem;
  line-height: 1.5;
  text-align: center;
}

/* ---------- Numbered steps ---------- */
.steps {
  display: grid;
  gap: 14px;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 16px;
  padding: 20px;
  border: 1px solid rgba(30, 27, 24, 0.08);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow-md);
}

.steps li + li {
  margin-top: 0;
}

.steps li::before {
  content: counter(step);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: #fff;
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(180, 79, 0, 0.22);
}

.steps h3 {
  margin: 4px 0 6px;
  font-size: 1.25rem;
}

.steps p {
  margin: 0;
  color: var(--ink-soft);
}

/* ---------- Compact card grid (types, tabs, settings) ---------- */
.guide-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 20px;
}

.guide-grid .feature-card {
  padding: 20px;
}

.guide-grid .feature-card h3 {
  margin: 10px 0 6px;
  font-size: 1.2rem;
}

.guide-grid .feature-card p {
  font-size: 0.97rem;
}

.guide-grid .feature-title {
  margin-bottom: 8px;
}

.guide-grid .feature-icon {
  width: 28px;
  height: 28px;
}

.guide-example {
  display: block;
  margin-top: 10px;
  color: var(--accent-strong);
  font-size: 0.86rem;
  font-weight: 700;
}

/* ---------- Callouts ---------- */
.callout {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 12px;
  max-width: 720px;
  margin: 20px 0 0;
  padding: 16px 18px;
  border: 1px solid rgba(217, 114, 30, 0.22);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  background: rgba(217, 114, 30, 0.07);
  color: var(--ink-soft);
  line-height: 1.65;
}

.callout img {
  width: 22px;
  height: 22px;
  margin-top: 2px;
  opacity: 0.8;
}

.callout strong {
  display: block;
  margin-bottom: 2px;
  color: var(--ink);
}

.callout p {
  margin: 0;
}

.callout--note {
  border-color: rgba(30, 27, 24, 0.12);
  border-left-color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.6);
}

/* ---------- Tables ---------- */
.table-wrap {
  max-width: 100%;
  margin-top: 20px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid rgba(30, 27, 24, 0.08);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow-md);
}

.guide-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.guide-table th,
.guide-table td {
  padding: 12px 16px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid rgba(30, 27, 24, 0.08);
  color: var(--ink-soft);
}

.guide-table th {
  color: var(--ink);
  font-weight: 800;
  background: rgba(217, 114, 30, 0.07);
}

.guide-table tbody tr:last-child td {
  border-bottom: 0;
}

.guide-table td:first-child {
  color: var(--ink);
  font-weight: 700;
}

.guide-table .is-plus {
  color: var(--good);
  font-weight: 800;
}

/* ---------- Status legend (reuses .status-panel) ---------- */
.guide-status {
  margin-top: 20px;
  max-width: 720px;
}

.guide-status .status-panel {
  padding: 22px;
}

.status-swatch--striped {
  background: repeating-linear-gradient(135deg, var(--unknown) 0 3px, rgba(255, 255, 255, 0.85) 3px 6px);
}

/* ---------- Lock legend ---------- */
.lock-legend {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  max-width: 720px;
  margin-top: 18px;
}

.lock-card {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(30, 27, 24, 0.08);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.72);
}

.lock-card span:first-child {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: #fff;
}

.lock-card svg {
  width: 20px;
  height: 20px;
}

.lock-gold {
  background: linear-gradient(135deg, #e0a83a, #b8781a);
}

.lock-red {
  background: linear-gradient(135deg, #c85a44, #9c3f2e);
}

.lock-card strong {
  display: block;
  color: var(--ink);
}

.lock-card p {
  margin: 2px 0 0;
  color: var(--ink-soft);
  font-size: 0.93rem;
}

/* ---------- FAQ ---------- */
.faq {
  max-width: 760px;
  margin-top: 18px;
}

.faq details {
  border: 1px solid rgba(30, 27, 24, 0.08);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.72);
}

.faq details + details {
  margin-top: 10px;
}

.faq summary {
  padding: 14px 18px;
  color: var(--ink);
  font-weight: 800;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  flex: 0 0 auto;
  color: var(--accent);
  font-size: 1.2rem;
  line-height: 1;
}

.faq details[open] summary::after {
  content: "–";
}

.faq details p {
  margin: 0;
  padding: 0 18px 16px;
  color: var(--ink-soft);
  line-height: 1.7;
}

/* ---------- Closing CTA ---------- */
.guide-cta {
  padding: 8px 0 72px;
}

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .guide-layout {
    grid-template-columns: 1fr;
  }

  .guide-toc {
    display: none;
  }

  .toc-fab {
    display: inline-flex;
  }

  .guide-split {
    grid-template-columns: minmax(0, 1fr) 260px;
  }
}

@media (max-width: 760px) {
  .guide-hero {
    padding-top: 32px;
  }

  .guide-section {
    padding: 24px 0 32px;
    scroll-margin-top: 76px;
  }

  .guide-split {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .guide-shot {
    position: static;
    width: min(100%, 260px);
    margin: 20px auto 0;
  }

  .guide-grid,
  .lock-legend {
    grid-template-columns: 1fr;
  }

  .steps li {
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 12px;
    padding: 16px;
  }

  .steps li::before {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }

  .guide-table {
    font-size: 0.9rem;
  }

  .guide-table th,
  .guide-table td {
    padding: 10px 10px;
  }

  .guide-table td:first-child {
    min-width: 120px;
  }
}

/* ---------- Merged from the sibling draft: skip link, "Try this" card, per-type how-to ---------- */
.skip-link {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: 2000;
  padding: 12px 20px;
  border: 2px solid var(--accent-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-strong);
  color: var(--ink);
  font-weight: 800;
}

.skip-link:focus {
  top: 16px;
}

.try-this {
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid rgba(217, 114, 30, 0.22);
  border-radius: var(--radius-sm);
  background: var(--surface-strong);
}

.try-this span {
  display: block;
  color: var(--accent-strong);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.try-this strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 1.05rem;
}

.try-this p {
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.howto-list {
  display: grid;
  gap: 12px;
  max-width: 760px;
  margin-top: 16px;
}

.howto {
  padding: 16px 18px;
  border: 1px solid rgba(30, 27, 24, 0.08);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.72);
}

.howto h4 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 8px;
  font-family: var(--serif);
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}

.howto h4 img {
  width: 22px;
  height: 22px;
  opacity: 0.85;
}

.howto ol {
  margin: 0;
  padding-left: 1.3rem;
}

.howto li {
  color: var(--ink-soft);
  line-height: 1.65;
}

.howto li + li {
  margin-top: 4px;
}

/* Chips for controls that carry an icon in the app: the glyph sits before the label,
   text always present (screen readers, find-in-page). Text-only controls stay text-only. */
.ui img {
  display: inline-block;
  width: 0.95em;
  height: 0.95em;
  margin: 0 5px 0 0;
  vertical-align: -0.12em;
  opacity: 0.85;
}

/* Three concrete examples per action type, in place of the single "e.g." line. */
.guide-examples {
  max-width: none;
  margin: 12px 0 0;
  padding-left: 1.1rem;
  color: var(--accent-strong);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.5;
}

.guide-examples li {
  color: var(--accent-strong);
}

.guide-examples li + li {
  margin-top: 3px;
}

/* Linkable sub-headings need the same offset as sections, or the sticky nav covers them. */
.guide-section h3[id] {
  scroll-margin-top: 96px;
}

@media (max-width: 760px) {
  .guide-section h3[id] {
    scroll-margin-top: 76px;
  }
}

/* Chart crops in the right-hand column of the per-action statistics section.
   Two stacked figures instead of one phone, so they sit on the card surface and the
   whole stack scrolls with the copy rather than sticking. */
.guide-shot--charts {
  position: static;
  display: grid;
  gap: 16px;
  width: 100%;
}

.guide-shot--charts figure {
  margin: 0;
  padding: 12px;
  border: 1px solid rgba(30, 27, 24, 0.08);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow-md);
}

.guide-shot--charts img {
  width: 100%;
  height: auto;
  border-radius: 10px;
  background: #fff;
}

.guide-shot--charts figcaption {
  margin: 10px 2px 0;
  color: var(--ink-soft);
  font-size: 0.84rem;
  line-height: 1.45;
  text-align: left;
}

/* Addresses and identifiers the reader types or tells an agent (mcp.dayvil.com, list_actions). */
.guide-section code {
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(30, 27, 24, 0.06);
  font-size: 0.9em;
  overflow-wrap: anywhere;
}

/* A wide screenshot inside a step column (the agent's side of pairing), not a phone frame. */
.guide-inline-shot {
  margin: 20px 0 0;
}

.guide-inline-shot img + img {
  margin-top: 12px;
}

.guide-inline-shot img {
  display: block;
  width: 100%;
  max-width: 520px;
  height: auto;
  border-radius: 12px;
  box-shadow: var(--shadow-md);
}

.guide-inline-shot figcaption {
  margin: 10px 2px 0;
  color: var(--ink-soft);
  font-size: 0.86rem;
  line-height: 1.5;
}

/* An app crop next to a terminal capture: phone-sized, so it doesn't outweigh the terminal. */
.guide-inline-shot .guide-inline-shot__app {
  max-width: 340px;
  border: 1px solid rgba(30, 27, 24, 0.1);
}
