/* Applications + Guides pages: presentation layer built on the site's ip-* components. */
.rs-sec .container > * + * { margin-top: 40px; }
.rs-sec .container > .rs-head + * { margin-top: 0; }
.rs-sec .container > .ip-head + * { margin-top: 0; }

/* Body copy */
.rs-text { max-width: 72ch; font-size: 16px; line-height: 1.65; color: var(--steel); }
.ip-dark .rs-text { color: var(--steel-light); }
.rs-text a, .rs-links a, .rs-card .ip-d a, .rs-callout a { color: var(--graphite); text-underline-offset: 3px; }
.ip-dark .rs-text a { color: var(--white); }
.rs-text strong, .rs-callout strong { font-weight: 600; color: inherit; }
.rs-links { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: baseline; padding-top: 16px; border-top: 1px solid var(--rule-strong); font-size: 14px; color: var(--steel); }
.rs-links strong { font-weight: 500; }

/* Cards */
.rs-cards .rs-card { gap: 0; }
.rs-card > .ip-k { margin: 0 0 14px; }
.rs-card > h3 { font-size: 19px; line-height: 1.25; }
.rs-card > h3 a { color: inherit; text-decoration: none; }
.rs-card > h3 a:hover { text-decoration: underline; text-underline-offset: 4px; }
.rs-card > h3 + .ip-d { margin-top: 10px; }
.rs-row { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--rule); }
.rs-row .ip-d { margin-top: 6px; font-size: 14.5px; line-height: 1.55; }
.rs-card-action { margin-top: auto; padding-top: 24px; }
.ip-dark .rs-row { border-top-color: var(--rule-light); }
.ip-dark .rs-card > h3 { color: var(--white); }
.rs-brief .rs-bullets { margin-top: 18px; }
.ip-dark .ip-bullets { border-top-color: var(--rule-light); }
.ip-dark .ip-bullets li { border-bottom-color: var(--rule-light); color: var(--steel-light); }
.ip-dark .rs-brief h3 { color: var(--white); }

/* Callout (cross-reference block) */
.rs-callout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 12px 48px; padding: 28px 30px; background: var(--white); border: 1px solid var(--rule-strong); border-left: 3px solid var(--graphite); }
.ip-paper .rs-callout { background: var(--white); }
.ip-light .rs-callout { background: var(--paper); }
.rs-callout h3 { font-size: 19px; line-height: 1.3; }
.rs-callout .ip-d { margin: 0; }

/* Tables */
.rs-table-wrap { overflow-x: auto; border: 1px solid var(--rule-strong); background: var(--white); }
.rs-table th, .rs-table td { padding: 14px 16px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--rule); }
.rs-table td + td, .rs-table th + td { border-left: 1px solid var(--rule); }
.rs-table thead th { font: 500 11px/1.4 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--steel-2); background: var(--paper); border-bottom: 1px solid var(--rule-strong); }
.rs-table tbody th { width: 18%; }
.rs-table a { font-weight: 500; }

/* Bullets */
.rs-bullets { max-width: 80ch; }

/* Figures */
.rs-fig { margin: 0; }
.rs-fig-frame { background: var(--white); border: 1px solid var(--rule-strong); overflow-x: auto; -webkit-overflow-scrolling: touch; }
.rs-fig-img { display: block; width: 100%; height: auto; }
.rs-fig figcaption { display: block; margin-top: 14px; max-width: 90ch; font-size: 13px; line-height: 1.55; color: var(--steel); }
.rs-legend { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); border-left: 1px solid var(--rule-strong); border-bottom: 1px solid var(--rule-strong); }
.rs-legend .rs-key { display: flex; gap: 12px; align-items: baseline; padding: 12px 16px; border-right: 1px solid var(--rule-strong); border-top: 1px solid var(--rule); font-size: 13.5px; line-height: 1.4; color: var(--graphite); background: var(--white); }
.rs-legend .rs-key b { flex: none; min-width: 26px; font: 500 11px/1.4 var(--font-mono); letter-spacing: .06em; color: var(--steel-2); }
.rs-fig .rs-legend { margin-top: -1px; }
.rs-fig-notes { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin-top: -1px; border: 1px solid var(--rule-strong); background: var(--white); }
.rs-note { padding: 14px 16px 16px; border-top: 1px solid var(--rule); }
.rs-note + .rs-note { border-left: 1px solid var(--rule); }
.rs-note-t { margin: 0; font: 600 14px/1.35 var(--font-display); color: var(--graphite); }
.rs-note .ip-d { margin: 6px 0 0; font-size: 13.5px; line-height: 1.5; }
.ip-dark .rs-fig figcaption { color: var(--steel-light); }

.rs-overview { padding-top: clamp(48px, 5vw, 72px); }
.rs-actions { margin-top: 32px; }

@media (max-width: 900px) {
  .rs-callout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
  .rs-fig-img { min-width: 720px; }
  .rs-table tbody th { width: auto; }
}

/* Multi-panel figures */
.rs-vignettes { display: grid; gap: 0; }
.rs-vignettes.rs-v2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.rs-vignettes.rs-v3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.rs-vignettes .rs-fig-img + .rs-fig-img { border-left: 1px solid var(--rule); }
.rs-note-wide { grid-column: 1 / -1; }
.rs-note-wide .rs-bullets { margin: 0; }
.rs-chain { list-style: none; padding: 0; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.rs-chain .rs-note { border-top: 2px solid var(--graphite); }
.rs-chain .rs-other { border-top-color: var(--steel-light); }
.rs-step { display: block; font: 500 11px/1.3 var(--font-mono); letter-spacing: .1em; color: var(--steel-2); }
.rs-chain .ip-k { margin: 4px 0 10px; }
.rs-chain .ip-d + .ip-d { margin-top: 4px; }

/* Hero scenario links */
.rs-paths { max-width: 760px; margin-top: 28px; border-top-color: var(--rule-light); }
.rs-paths li { color: var(--steel-light); border-bottom-color: var(--rule-light); }
.rs-paths li::before { background: var(--white); }
.rs-paths a { color: var(--white); font-weight: 500; text-underline-offset: 3px; }

/* Guide worksheets */
.rs-main .worksheet { border: 1px solid var(--rule-strong); background: var(--white); }
.rs-main .worksheet-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 16px; border-bottom: 1px solid var(--rule); background: var(--paper); }
.rs-main .worksheet table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.5; }
.rs-main .worksheet caption { caption-side: top; text-align: left; padding: 14px 16px; font: 600 16px/1.3 var(--font-display); color: var(--graphite); border-bottom: 1px solid var(--rule); }
.rs-main .worksheet th, .rs-main .worksheet td { padding: 12px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--rule); }
.rs-main .worksheet td + td, .rs-main .worksheet th + th { border-left: 1px solid var(--rule); }
.rs-main .worksheet thead th { font: 500 11px/1.4 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--steel-2); background: var(--paper); }
.rs-main .worksheet td { color: var(--steel); }
.ip-dark .worksheet td { color: var(--steel); }
.rs-main .table-hint { padding: 10px 16px 0; font: 500 11px/1.5 var(--font-mono); color: var(--steel-2); }
@media (max-width: 720px) {
  .rs-vignettes.rs-v2, .rs-vignettes.rs-v3 { grid-template-columns: minmax(0, 1fr); }
  .rs-vignettes .rs-fig-img { min-width: 0; }
  .rs-vignettes .rs-fig-img + .rs-fig-img { border-left: 0; border-top: 1px solid var(--rule); }
}
.rs-main .ip-light .worksheet-tools .btn-line, .rs-main .ip-paper .worksheet-tools .btn-line { color: var(--graphite); border-color: var(--rule-strong); --tgt-c: var(--graphite); }
.rs-main .worksheet { min-width: 0; max-width: 100%; }
/* Phones: worksheet rows become labelled cards (each td carries data-label). */
@media (max-width: 720px) {
  .rs-main :is(.worksheet, .rs-table-wrap) table, .rs-main :is(.worksheet, .rs-table-wrap) tbody, .rs-main :is(.worksheet, .rs-table-wrap) tr, .rs-main :is(.worksheet, .rs-table-wrap) :is(td, tbody th) { display: block; width: 100%; }
  .rs-main :is(.worksheet, .rs-table-wrap) thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .rs-main :is(.worksheet, .rs-table-wrap) tr { border: 1px solid var(--rule-strong); margin: 0 12px 16px; width: auto; padding: 0 16px; background: var(--paper); }
  .rs-main :is(.worksheet, .rs-table-wrap) :is(td, tbody th), .rs-main :is(.worksheet, .rs-table-wrap) :is(td, th) + td { padding: 14px 0; border-left: 0; font-size: 14px; }
  .rs-main :is(.worksheet, .rs-table-wrap) tr > :last-child { border-bottom: 0; }
  .rs-main :is(.worksheet, .rs-table-wrap) :is(td, th[scope=row])::before { content: attr(data-label); display: block; font: 500 11px/1.5 var(--font-mono); letter-spacing: .04em; color: var(--steel-2); margin-bottom: 6px; }
  .rs-main :is(.worksheet, .rs-table-wrap) tr > :first-child { font-size: 16px; color: var(--graphite); }
  .rs-main :is(.worksheet, .rs-table-wrap) tbody { padding-top: 12px; }
  .rs-main .rs-table-wrap { border: 0; background: none; overflow: visible; }
  .rs-main .rs-table-wrap tr { margin: 0 0 16px; }
  .rs-main .rs-table tbody th { width: auto; }
  .rs-main :is(.worksheet, .rs-table-wrap) table { min-width: 0 !important; table-layout: auto; }
}
.rs-actions { flex-wrap: wrap; }
.rs-actions .btn { max-width: 100%; white-space: normal; text-align: center; }
@media print {
  .rs-main.guide-main .rs-fig, .rs-main.guide-main .rs-actions, .rs-main.guide-main .rs-overview { display: none !important; }
  .rs-main .rs-text, .rs-main .ip-d, .rs-main .ip-bullets li, .rs-main .rs-paths li, .rs-main .eyebrow { color: #16191C !important; }
  .rs-main .rs-card, .rs-main .rs-callout { break-inside: avoid; }
}
.rs-fig-note { margin: 14px 0 0; max-width: 90ch; font-size: 13.5px; line-height: 1.55; color: var(--graphite); }
.ip-dark .rs-fig-note { color: var(--steel-light); }
/* Hero: two buttons at most; a further in-page jump is a quiet text link under them. */
.rs-hero .ip-hero-actions .rs-hero-link { flex-basis: 100%; margin-top: 6px; font-size: 15px; font-weight: 500; color: var(--steel-light); text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--rule-light); }
.rs-hero .ip-hero-actions .rs-hero-link:hover { color: var(--white); text-decoration-color: currentColor; }
.rs-hero .ip-hero-copy > .ip-head { margin: 0; }
/* Figure notes: explicit columns per note count, hairlines drawn by a 1px grid gap so wrapped rows never break the frame. */
.rs-fig-notes { gap: 1px; background: var(--rule); border: 1px solid var(--rule-strong); }
.rs-fig-notes > .rs-note, .rs-fig-notes > .rs-note + .rs-note { border: 0; background: var(--white); }
.rs-fig-notes.rs-chain > .rs-note { border-top: 2px solid var(--graphite); }
.rs-fig-notes.rs-chain > .rs-note.rs-other { border-top-color: var(--steel-light); }
.rs-fig-notes.rs-n1 { grid-template-columns: minmax(0, 1fr); }
.rs-fig-notes.rs-n2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.rs-fig-notes.rs-n4:has(.rs-note-wide) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.rs-fig-notes.rs-n3, .rs-fig-notes.rs-n6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.rs-fig-notes.rs-n5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.rs-fig-notes.rs-n4:not(:has(.rs-note-wide)) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.rs-fig-notes.rs-lead2 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.rs-fig-notes.rs-lead2 > :nth-child(-n+2) { grid-column: span 2; }
.rs-fig-notes .rs-note-wide { grid-column: 1 / -1; }
@media (max-width: 1080px) {
  .rs-fig-notes.rs-n4:not(:has(.rs-note-wide)), .rs-fig-notes.rs-lead2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rs-fig-notes.rs-lead2 > :nth-child(-n+2) { grid-column: auto; }
  .rs-fig-notes.rs-n3, .rs-fig-notes.rs-n5, .rs-fig-notes.rs-n6, .rs-fig-notes.rs-n4:has(.rs-note-wide) { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
  .rs-fig-notes[class*="rs-n"] { grid-template-columns: minmax(0, 1fr); }
  .rs-fig-notes .rs-note-wide, .rs-fig-notes.rs-lead2 > :nth-child(-n+2) { grid-column: auto; }
}
.rs-fig-notes .rs-note-wide .rs-bullets { max-width: none; }
/* Scenario / context cards above the overview map (pages 18, 19). */
.rs-scopes .rs-scope { background: var(--white); }
.rs-scope .ip-d { margin: 0; font-size: 15px; line-height: 1.55; color: var(--steel); }
.rs-scope .ip-d a { display: block; margin-bottom: 8px; font: 600 17px/1.3 var(--font-display); color: var(--graphite); text-decoration: none; }
.rs-scope .ip-d a:hover { text-decoration: underline; text-underline-offset: 4px; }
@media (max-width: 900px) { .rs-scopes { grid-template-columns: minmax(0, 1fr); } }

/* ---- single-use application pages (apps.py) ---- */
.rs-app .rs-fig { margin: 0 0 28px; }
.rs-mark { display: inline-block; min-width: 24px; margin-right: 10px; padding: 1px 6px; border: 1px solid var(--graphite); font: 500 11px/1.6 var(--font-mono); letter-spacing: .04em; text-align: center; color: var(--graphite); vertical-align: 1px; }
.rs-where td:nth-child(2) { white-space: nowrap; }
.rs-app #why .rs-text + .rs-text { margin-top: 14px; }
.rs-app #why .rs-links { margin-top: 28px; }
.rs-app .rs-brief { max-width: 720px; margin-bottom: 32px; }
.rs-app-card h3 a { color: inherit; text-decoration: none; }
.rs-app-card h3 a::after { content: " →"; color: var(--steel-2); }
.rs-app-card h3 a:hover { text-decoration: underline; text-underline-offset: 4px; }
.rs-app-card .ip-d { margin: 10px 0 16px; }
@media (max-width: 720px) { .rs-where td:nth-child(2) { white-space: normal; } }

/* Application site plans: the 3D drawing sits directly on the page, no card. */
.rs-fig-bare .rs-fig-frame { background: none; border: 0; }
