/* BetterThanSPY tutorial: one reading column, optional sticky contents on wide screens. */
.eg { display: grid; grid-template-columns: 220px minmax(0, 720px); justify-content: center; gap: 64px; padding-top: 40px; padding-bottom: 80px; }
.eg-main { min-width: 0; color: var(--eb-ink-2); font-size: 16.5px; line-height: 1.72; }

/* Contents */
.eg-toc { position: sticky; top: 100px; align-self: start; max-height: calc(100vh - 120px); overflow-y: auto; padding-top: 6px; }
.eg-toc__title { margin: 0 0 10px; font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--eb-ink-4); }
.eg-toc ol { margin: 0; padding: 0; list-style: none; counter-reset: toc; border-left: 1px solid var(--eb-line); }
.eg-toc li { counter-increment: toc; }
.eg-toc a { display: block; margin-left: -1px; padding: 5px 0 5px 14px; border-left: 2px solid transparent; font-size: 13.5px; line-height: 1.4; color: var(--eb-ink-3); text-decoration: none; transition: color 0.12s ease, border-color 0.12s ease; }
.eg-toc a::before { content: counter(toc) '. '; color: var(--eb-ink-4); }
.eg-toc a:hover { color: var(--eb-ink); }
.eg-toc a.is-active { border-left-color: var(--eb-beat-solid); color: var(--eb-ink); font-weight: 600; }

/* Hero */
.eg-hero { margin-bottom: 56px; }
.eg-kicker { margin: 0 0 12px; font-size: 13px; font-weight: 600; color: var(--eb-beat); }
.eg-hero h1 { margin: 0 0 18px; font-size: 40px; line-height: 1.15; font-weight: 750; letter-spacing: -0.03em; color: var(--eb-ink); }
.eg-lede { margin: 0 0 18px; font-size: 19px; line-height: 1.6; color: var(--eb-ink-2); }
.eg-asof { margin: 0; padding: 12px 16px; border-radius: 10px; background: var(--eb-na-bg); font-size: 14px; line-height: 1.6; color: var(--eb-ink-3); }
.eg-try-inline { font-weight: 600; color: var(--eb-beat); }

/* Sections */
.eg-section { padding-top: 8px; margin-bottom: 56px; scroll-margin-top: 96px; }
.eg-section h2 { display: flex; align-items: baseline; gap: 12px; margin: 0 0 16px; font-size: 27px; line-height: 1.25; font-weight: 720; letter-spacing: -0.02em; color: var(--eb-ink); }
.eg-num { flex: none; display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--eb-beat-bg); color: var(--eb-beat); font-size: 14px; font-weight: 700; transform: translateY(-3px); }
.eg-section h3 { margin: 32px 0 10px; font-size: 19px; font-weight: 680; letter-spacing: -0.01em; color: var(--eb-ink); }
.eg-section p { margin: 0 0 16px; }
.eg-section a:not(.eg-try):not(.eb-cta) { color: var(--eb-beat); text-underline-offset: 3px; }
.eg-main strong { color: var(--eb-ink); font-weight: 650; }

.eg-quote { margin: 20px 0; padding: 4px 0 4px 20px; border-left: 3px solid var(--eb-beat-solid); font-size: 19px; line-height: 1.55; font-weight: 550; color: var(--eb-ink); }

.eg-list { margin: 0 0 18px; padding-left: 22px; }
.eg-list li { margin-bottom: 10px; padding-left: 4px; }
.eg-steps { margin: 0 0 18px; padding-left: 24px; }
.eg-steps li { margin-bottom: 10px; padding-left: 6px; }
.eg-steps li::marker { font-weight: 700; color: var(--eb-beat); }

/* Definition boxes, takeaways, Try it links */
.eg-def { margin: 24px 0 0; padding: 14px 18px; border-radius: 12px; background: var(--eb-surface); box-shadow: var(--eb-shadow-sm); }
.eg-def p { margin: 0; font-size: 15px; }
.eg-def__term { margin-bottom: 4px !important; font-size: 12px !important; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--eb-beat); }

.eg-takeaway { margin: 28px 0 20px; padding: 18px 22px; border-radius: 14px; background: var(--eb-beat-bg); box-shadow: inset 0 0 0 1px var(--eb-beat-ring); }
.eg-takeaway__title { margin: 0 0 8px !important; font-size: 13px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--eb-beat); }
.eg-takeaway ul { margin: 0; padding-left: 20px; font-size: 15.5px; }
.eg-takeaway li { margin-bottom: 6px; }
.eg-takeaway li:last-child { margin-bottom: 0; }

.eg-try { display: inline-flex; align-items: center; gap: 8px; margin: 4px 0 0; padding: 9px 16px; border-radius: 10px; background: var(--eb-ink); color: #fff; font-size: 14px; font-weight: 600; line-height: 1.35; text-decoration: none; transition: background 0.12s ease, transform 0.12s ease; }
.eg-try::after { content: '→'; transition: transform 0.12s ease; }
.eg-try:hover { background: #27272a; }
.eg-try:hover::after { transform: translateX(3px); }

.eg-pro { display: inline-block; padding: 1px 7px; border-radius: 999px; background: var(--eb-accent-soft); color: var(--eb-accent); font-size: 11px; font-weight: 700; letter-spacing: 0.02em; vertical-align: 2px; }

/* Figures */
.eg-figure { margin: 22px 0 24px; }
.eg-caption { margin: 8px 0 0 !important; font-size: 13px; color: var(--eb-ink-4); }
.eg-table { width: 100%; border-collapse: collapse; font-size: 14.5px; font-variant-numeric: tabular-nums; }
.eg-table th { padding: 8px 12px; border-bottom: 1.5px solid var(--eb-line); font-size: 12.5px; font-weight: 600; text-align: right; color: var(--eb-ink-4); }
.eg-table td { padding: 9px 12px; border-bottom: 1px solid var(--eb-line-soft); text-align: right; color: var(--eb-ink-2); }
.eg-table th:first-child, .eg-table td:first-child { padding-left: 0; text-align: left; }
.eg-table td:first-child { font-weight: 550; color: var(--eb-ink); }
.eg-table td:last-child { font-weight: 650; color: var(--eb-ink); }
.eg-table--metrics td:last-child { font-weight: 500; }
.eg-table tr.is-bench td { background: #f5f9ff; font-weight: 600; }
.eg-table td.is-beat { color: var(--eb-beat); font-weight: 600; }
.eg-table td.is-miss { color: var(--eb-miss); }
.eg-shot { margin: 22px 0 24px; }
.eg-shot a { display: block; border-radius: 12px; overflow: hidden; background: var(--eb-surface); box-shadow: 0 0 0 1px var(--eb-line), var(--eb-shadow-sm); cursor: zoom-in; transition: box-shadow 0.15s ease; }
.eg-shot a:hover { box-shadow: 0 0 0 1px var(--eb-line), 0 10px 28px -12px rgba(9, 9, 11, 0.28); }
.eg-shot img { display: block; width: 100%; height: auto; }
.eg-shot figcaption { margin-top: 8px; font-size: 13px; line-height: 1.5; color: var(--eb-ink-4); }
.eg-shot--narrow { max-width: 400px; }

.eg-mark { display: inline-grid; place-items: center; width: 20px; height: 20px; margin-right: 8px; border-radius: 50%; background: #7c3aed; color: #fff; font-size: 11.5px; font-weight: 700; line-height: 1; vertical-align: 2px; }
.eg-steps--marked { padding-left: 0; list-style: none; counter-reset: mark; }
.eg-steps--marked li { counter-increment: mark; padding-left: 30px; position: relative; }
.eg-steps--marked li::before { content: counter(mark); position: absolute; left: 0; top: 4px; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: #7c3aed; color: #fff; font-size: 11.5px; font-weight: 700; line-height: 1; }
.eg-figure--wide { overflow-x: auto; }
.eg-figure--wide .eg-table { min-width: 620px; }

.eg-bars { display: grid; gap: 8px; }
.eg-bar { display: grid; grid-template-columns: 180px 1fr 52px; align-items: center; gap: 14px; font-size: 14px; }
.eg-bar__label { color: var(--eb-ink-3); }
.eg-bar__track { height: 14px; border-radius: 4px; background: var(--eb-na-bg); overflow: hidden; }
.eg-bar__track span { display: block; min-width: 3px; height: 100%; border-radius: 4px; background: #a7f3d0; }
.eg-bar__value { text-align: right; font-weight: 650; font-variant-numeric: tabular-nums; color: var(--eb-ink); }
.eg-bar.is-top .eg-bar__label, .eg-bar.is-top .eg-bar__value { color: var(--eb-beat); font-weight: 700; }
.eg-bar.is-top .eg-bar__track span { background: var(--eb-beat-solid); }

/* Definition lists */
.eg-dl { margin: 0 0 18px; }
.eg-dl dt { margin-top: 16px; font-weight: 650; color: var(--eb-ink); }
.eg-dl dd { margin: 4px 0 0; }
.eg-dl em { font-style: normal; font-weight: 600; color: var(--eb-beat); }
.eg-dl--glossary { display: grid; grid-template-columns: 150px 1fr; gap: 10px 20px; font-size: 15px; }
.eg-dl--glossary dt, .eg-dl--glossary dd { margin: 0; }

/* Workflow cards */
.eg-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.eg-card { display: flex; flex-direction: column; padding: 20px; border-radius: 14px; background: var(--eb-surface); box-shadow: var(--eb-shadow-sm); }
.eg-card h3 { margin: 0 0 6px !important; font-size: 16.5px !important; }
.eg-card p { flex: 1; font-size: 15px; line-height: 1.6; }
.eg-card .eg-try { align-self: flex-start; }

.eg-end { margin-top: 40px; padding: 28px; border-radius: 16px; background: var(--eb-surface); box-shadow: var(--eb-shadow-sm); text-align: center; }
.eg-end p { margin: 0 0 14px; }
.eg-end__more { margin: 16px 0 0 !important; font-size: 14px; color: var(--eb-ink-3); }

@media (max-width: 1100px) {
  .eg { grid-template-columns: minmax(0, 720px); }
  .eg-toc { display: none; }
}

@media (max-width: 640px) {
  .eg { padding-top: 24px; }
  .eg-main { font-size: 16px; }
  .eg-hero h1 { font-size: 29px; }
  .eg-lede { font-size: 17px; }
  .eg-section h2 { font-size: 22px; }
  .eg-bar { grid-template-columns: 112px 1fr 44px; gap: 10px; font-size: 13px; }
  .eg-cards { grid-template-columns: 1fr; }
  .eg-dl--glossary { grid-template-columns: 1fr; gap: 2px; }
  .eg-dl--glossary dd { margin-bottom: 10px; }
}
