/* Editorial pages share the data site's tokens; prose gets a comfortable measure. */
.guide-layout { display: grid; grid-template-columns: minmax(0, 1fr) 248px; column-gap: 48px; align-items: start; }
.guide-layout > .guide-header { grid-column: 1; grid-row: 1; min-width: 0; }
.guide-main { grid-column: 1; grid-row: 2; min-width: 0; }
.guide-sidebar { grid-column: 2; grid-row: 1 / span 2; align-self: stretch; min-width: 0; }
.guide-header { margin-bottom: 28px; max-width: 1040px; }
.guide-header h1 { margin: 8px 0 20px; font-size: clamp(30px, 3.4vw, 48px); line-height: 1.3; letter-spacing: -.025em; }
.guide-breadcrumb { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; color: var(--muted); font-size: 13px; }
.guide-kicker { color: var(--accent); font-size: 13px; font-weight: 600; margin: 0 0 10px; }
.guide-lead { color: var(--muted); font-size: 18px; line-height: 1.8; max-width: 78ch; }
.guide-meta { color: var(--muted); margin: 18px 0 0; font-size: 13px; }
.guide-answer { max-width: 1040px; padding: 22px 26px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--accent-soft); }
.guide-answer p { margin: 0; line-height: 1.85; }
.guide-toc { position: sticky; top: 96px; margin: 28px 0 0; padding: 0 0 0 20px; border-left: 1px solid var(--border); }
.guide-toc > summary { display: flex; align-items: center; gap: 10px; list-style: none; padding: 0 10px 16px; line-height: 1.5; }
.guide-toc > summary::-webkit-details-marker { display: none; }
.guide-toc-heading { color: var(--text); font-size: 14px; font-weight: 600; flex: none; }
.guide-toc-current, .guide-toc-chevron { display: none; }
.guide-toc nav { max-height: calc(100vh - 164px); max-height: calc(100dvh - 164px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.guide-toc ol { display: grid; gap: 4px; list-style: none; margin: 0; padding: 0; }
.guide-toc li { margin: 0; padding: 0; min-width: 0; }
.guide-toc a { display: block; padding: 9px 10px; border-radius: 6px; border-left: 2px solid transparent; color: var(--muted); font-size: 13px; line-height: 1.7; text-decoration: none; }
.guide-toc a:hover { color: var(--accent); background: var(--surface); text-decoration: none; }
.guide-toc a[aria-current="location"] { color: var(--accent); background: var(--accent-soft); border-left-color: var(--accent); font-weight: 600; }
.guide-toc a:focus-visible { outline-offset: -2px; }
.guide-toc.toc-enhanced > summary { cursor: default; }
.guide-body { max-width: 1040px; }
.guide-section { margin: 44px 0; scroll-margin-top: 110px; }
.guide-page h2[id], #home-guides-title { scroll-margin-top: 110px; }
.guide-section h2, .guide-related h2 { margin: 0 0 18px; font-size: 25px; line-height: 1.45; }
.guide-section > p, .guide-section li, .guide-related > p { max-width: 80ch; color: var(--muted); line-height: 1.9; }
.guide-section > p { margin: 14px 0; }
.guide-section > ul { padding-left: 24px; }
.guide-section li { padding: 5px 0; }
.guide-formula { padding: 18px 22px; margin: 20px 0; border-left: 3px solid var(--accent); background: var(--surface); border-radius: 0 var(--radius) var(--radius) 0; }
.guide-formula p { margin: 6px 0; font-variant-numeric: tabular-nums; line-height: 1.8; overflow-wrap: anywhere; }
.guide-table-wrap { max-width: 100%; margin: 22px 0; border: 1px solid var(--border); border-radius: var(--radius); overflow-x: auto; }
.guide-table { min-width: 560px; }
.guide-table caption { caption-side: top; text-align: left; padding: 14px 18px; color: var(--muted); font-size: 13px; font-weight: 500; background: var(--surface); }
.guide-table th, .guide-table td { padding: 14px 18px; white-space: normal; min-width: 120px; line-height: 1.7; }
.guide-table th[scope="row"] { color: var(--text); font-weight: 500; font-size: 14px; }
.guide-links { display: flex; flex-wrap: wrap; gap: 12px 24px; margin-top: 18px; font-size: 14px; line-height: 1.7; }
.guide-links a { padding-block: 6px; }
.guide-breadcrumb a, .guide-card a, .guide-card-link, .guide-links a { text-decoration: none; }
.guide-breadcrumb a:hover, .guide-card a:hover, .guide-card-link:hover, .guide-links a:hover { text-decoration: underline; }
.guide-sources { padding-top: 30px; border-top: 1px solid var(--border); }
.guide-related { margin: 40px 0 48px; padding: 26px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.guide-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.guide-card { min-width: 0; padding: 28px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); }
.guide-card h2 { font-size: 24px; margin: 8px 0 16px; line-height: 1.5; }
.guide-card h2 a { color: var(--text); }
.guide-card h2 a:hover { color: var(--accent); }
.guide-card > p:not(.guide-kicker), .guide-card li { color: var(--muted); font-size: 14px; line-height: 1.8; }
.guide-card ul { padding-left: 18px; margin: 18px 0 24px; }
.guide-card li { padding: 4px 0; }
.guide-card-link { display: inline-flex; gap: 12px; align-items: center; font-size: 14px; font-weight: 600; min-height: 40px; }
.home-guides { margin: 36px 0 32px; }
.home-guides .section-head { margin-bottom: 18px; }
.home-guides .guide-card { padding: 24px; }
.home-guides .guide-card h3 { font-size: 19px; line-height: 1.5; margin: 0 0 10px; }
.home-guides .guide-card h3 a { color: var(--text); }
.home-guides .guide-card p { margin: 0 0 12px; }
.funding-fee-example { max-width: 1040px; margin: 28px 0 36px; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.fee-example-heading { padding: 24px 26px 8px; }
.fee-example-heading h2 { margin: 0 0 12px; font-size: 24px; line-height: 1.5; }
.fee-example-heading p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.8; }
.fee-example-fields { padding: 20px 26px 24px; display: grid; grid-template-columns: 1fr 1fr .65fr; gap: 22px; }
.fee-example-fields label { min-width: 0; display: flex; flex-direction: column; gap: 10px; font-size: 14px; font-weight: 600; }
.fee-example-fields input, .fee-example-fields select { min-width: 0; width: 100%; height: 46px; padding: 10px 12px; font: inherit; color: var(--text); background: white; border: 1px solid var(--border); border-radius: 7px; font-weight: 400; }
.fee-example-fields small { font-size: 12px; line-height: 1.7; color: var(--muted); font-weight: 400; }
.fee-example-fields [aria-invalid="true"] { border-color: #c83333; }
.fee-example-result { padding: 22px 26px; background: var(--accent-soft); display: flex; flex-wrap: wrap; align-items: baseline; gap: 12px; }
.fee-example-result[hidden], .fee-example-error[hidden] { display: none; }
.fee-example-result strong { font-size: clamp(28px, 3vw, 40px); color: var(--accent); line-height: 1.3; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.fee-example-result span { font-size: 14px; color: var(--muted); }
.fee-example-result [data-fee-direction] { color: var(--text); font-weight: 600; }
.fee-example-error { margin: 0; padding: 18px 26px; background: #fff7f5; color: #a62a25; line-height: 1.75; font-size: 14px; }
.fee-example-note, .funding-fee-example noscript p { padding: 18px 26px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.8; }
@media (max-width: 1100px) {
  .guide-layout { display: block; }
  .guide-toc { position: static; margin: 0 0 28px; padding: 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
  .guide-toc > summary { padding: 14px 18px; min-height: 52px; cursor: pointer; }
  .guide-toc.toc-enhanced > summary { cursor: pointer; }
  .guide-toc-current { display: block; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 12px; }
  .guide-toc-chevron { display: block; flex: none; margin-left: auto; }
  .guide-toc[open] .guide-toc-chevron { transform: rotate(180deg); }
  .guide-toc nav { max-height: none; overflow: visible; padding: 0 8px 10px; }
  .guide-toc a { padding: 12px 10px; min-height: 44px; font-size: 14px; }
}
@media (max-width: 720px) {
  .guide-header h1 { font-size: 30px; }
  .guide-lead { font-size: 16px; }
  .guide-answer, .guide-related, .guide-card { padding: 20px; }
  .guide-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .guide-section { margin: 32px 0; scroll-margin-top: 90px; }
  .guide-page h2[id], #home-guides-title { scroll-margin-top: 90px; }
  .guide-section h2, .guide-related h2, .guide-card h2 { font-size: 22px; }
  .guide-body { font-size: 15px; }
  .guide-formula { padding: 14px 18px; }
  .fee-example-heading { padding: 20px 20px 0; }
  .fee-example-heading h2 { font-size: 21px; }
  .fee-example-fields { grid-template-columns: minmax(0, 1fr); padding: 20px; gap: 20px; }
  .fee-example-result { padding: 20px; }
  .fee-example-note, .fee-example-error { padding: 16px 20px; }
  .home-guides .guide-card { padding: 20px; }
}
