:root {
    --rs-ink: #2d2d2d;
    --rs-accent: #2454c9;
    --rs-bg: #fafafa;
    --rs-card: #ffffff;
    --rs-border: #eaeaea;
}

.rs-mast-brand-row {
    display: flex;
    justify-content: center;
    padding-block: 22px 16px;
}

.rs-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 21px;
    color: var(--rs-ink);
    text-decoration: none;
}

.rs-brand img { border-radius: 8px; }

.rs-mast-nav {
    border-top: 1px solid var(--rs-border);
    border-bottom: 1px solid var(--rs-border);
    position: sticky;
    top: 0;
    background: #ffffff;
    z-index: 30;
}

.rs-mast-nav-row {
    display: flex;
    justify-content: center;
    gap: 28px;
    flex-wrap: wrap;
    padding-block: 12px;
}

.rs-mast-nav-row a {
    color: #5a5a5a;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
}

.rs-mast-nav-row a[aria-current] { color: var(--rs-accent); }

.rs-hero {
    background: linear-gradient(180deg, var(--rs-bg), #ffffff);
    padding-block: 88px 56px;
}

.rs-eyebrow {
    color: var(--rs-accent);
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    font-size: 13px;
    margin: 0 0 12px;
}

.rs-hero h1 {
    font-size: 44px;
    line-height: 1.15;
    margin: 0 0 16px;
    color: var(--rs-ink);
}

.rs-lede {
    font-size: 19px;
    line-height: 1.6;
    color: #4a5568;
    max-width: 640px;
}

.rs-topics { padding-block: 56px; }

.rs-topics h2 {
    font-size: 26px;
    margin: 0 0 24px;
    color: var(--rs-ink);
}

.rs-topics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.rs-topics-grid article {
    background: var(--rs-card);
    border: 1px solid var(--rs-border);
    border-radius: 12px;
    padding: 22px;
}

.rs-topics-grid h3 {
    margin: 0 0 8px;
    font-size: 17px;
    color: var(--rs-accent);
}

.rs-topics-grid p {
    margin: 0;
    font-size: 14px;
    line-height: 1.55;
    color: #5a6472;
}

.rs-status {
    padding-block: 56px 88px;
}

.rs-status-inner h2 {
    font-size: 24px;
    margin: 0 0 12px;
    color: var(--rs-ink);
}

.rs-status-inner p {
    font-size: 16px;
    line-height: 1.65;
    color: #4a5568;
    max-width: 720px;
}

.rs-base { border-top: 1px solid var(--rs-border); margin-top: 40px; }

.rs-base-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding-block: 36px;
    text-align: center;
}

.rs-base-brand {
    font-weight: 700;
    font-size: 15px;
    color: var(--rs-ink);
    text-decoration: none;
}

.rs-base-inner nav {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    justify-content: center;
}

.rs-base-inner nav a {
    color: #5a5a5a;
    text-decoration: none;
    font-size: 13px;
}

.rs-base-inner > span {
    color: #a0a0a0;
    font-size: 12px;
}

@media (max-width: 900px) {
    .rs-topics-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
    .rs-mast-nav-row { gap: 16px; }
    .rs-hero h1 { font-size: 32px; }
    .rs-topics-grid { grid-template-columns: 1fr; }
    .rs-topic-grid { grid-template-columns: 1fr 1fr; }
}

/* Library (listing / category archive) */

.rs-library { padding-block: 40px 80px; }

.rs-crumbs {
    display: flex;
    gap: 8px;
    font-size: 13px;
    color: #8a93a0;
    margin-bottom: 20px;
}

.rs-crumbs a { color: #8a93a0; text-decoration: none; }
.rs-crumbs [aria-current] { color: var(--rs-ink); }

.rs-library-head p {
    color: var(--rs-accent);
    font-weight: 700;
    font-size: 12px;
    letter-spacing: .06em;
    margin: 0 0 8px;
}

.rs-library-head h1 { font-size: 34px; margin: 0 0 8px; color: var(--rs-ink); }
.rs-library-head span { color: #5a6472; font-size: 15px; }

.rs-library-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 32px;
    margin-top: 32px;
}

.rs-library-filters {
    display: flex;
    flex-direction: column;
    gap: 2px;
    align-self: start;
    position: sticky;
    top: 90px;
}

.rs-library-filters a {
    display: flex;
    justify-content: space-between;
    padding: 8px 10px;
    border-radius: 6px;
    color: #4a5568;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
}

.rs-library-filters a span { color: #a0aab8; font-weight: 400; }
.rs-library-filters a[aria-current] { background: var(--rs-bg); color: var(--rs-accent); }

.rs-library-list {
    display: flex;
    flex-direction: column;
}

.rs-entry {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    padding-block: 24px;
    border-bottom: 1px solid var(--rs-border);
}

.rs-entry:first-child { padding-top: 0; }

.rs-entry-tag {
    display: inline-block;
    font-family: 'SFMono-Regular', Consolas, Menlo, monospace;
    font-size: 12px;
    color: var(--rs-accent);
    margin-bottom: 6px;
}

.rs-entry h2 { font-size: 19px; margin: 0 0 6px; font-weight: 600; }
.rs-entry h2 a { color: var(--rs-ink); text-decoration: none; }
.rs-entry h2 a:hover { text-decoration: underline; }
.rs-entry p { font-size: 14px; color: #666; line-height: 1.55; margin: 0; max-width: 620px; }
.rs-entry time { flex-shrink: 0; font-size: 12px; color: #a0a0a0; padding-top: 4px; }

.rs-library .empty { color: #8a93a0; padding: 40px 0; }

.rs-topic-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.rs-topic-chip {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 18px 20px;
    border: 1px solid var(--rs-border);
    border-radius: 10px;
    text-decoration: none;
    background: var(--rs-card);
}

.rs-topic-chip:hover { border-color: var(--rs-accent); }
.rs-topic-chip span { font-weight: 600; color: var(--rs-ink); font-size: 15px; }
.rs-topic-chip small { color: #8a93a0; font-size: 12px; }

/* Article */

.rs-article-head { background: var(--rs-bg); padding-block: 32px 28px; }
.rs-article-tag {
    display: inline-block;
    font-family: 'SFMono-Regular', Consolas, Menlo, monospace;
    font-size: 12px;
    color: var(--rs-accent);
    margin-bottom: 10px;
}
.rs-article-head h1 { font-size: 32px; margin: 0 0 10px; color: var(--rs-ink); line-height: 1.2; }
.rs-article-lede { font-size: 17px; color: #4a5568; margin: 0 0 16px; max-width: 720px; }
.rs-article-meta { display: flex; gap: 24px; margin: 0; }
.rs-article-meta div { display: flex; gap: 6px; }
.rs-article-meta dt { font-size: 12px; color: #8a93a0; margin: 0; }
.rs-article-meta dd { font-size: 12px; color: var(--rs-ink); font-weight: 600; margin: 0; }

.rs-article-layout {
    display: grid;
    grid-template-columns: 1fr 260px;
    gap: 40px;
    padding-block: 40px 80px;
    align-items: start;
}

.rs-article-content { font-size: 16px; line-height: 1.7; color: #2b3444; }
.rs-article-content img.featured { width: 100%; border-radius: 10px; margin-bottom: 24px; }
.rs-article-content pre {
    background: var(--rs-ink);
    color: #e6ebf5;
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
    font-size: 14px;
}
.rs-article-content code {
    background: var(--rs-bg);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: .9em;
}
.rs-article-content pre code { background: none; padding: 0; }

.rs-article-topics {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--rs-border);
}
.rs-article-topics span { font-size: 13px; color: #8a93a0; margin-right: 2px; }
.rs-article-topics a {
    font-size: 12px;
    color: var(--rs-accent);
    text-decoration: none;
    background: var(--rs-bg);
    padding: 5px 10px;
    border-radius: 999px;
}

.rs-article-rail { position: sticky; top: 90px; }
.rs-article-rail strong { display: block; font-size: 13px; color: var(--rs-ink); margin-bottom: 8px; }
.rs-article-rail p { font-size: 13px; color: #5a6472; line-height: 1.5; }
.rs-related { margin-top: 20px; display: flex; flex-direction: column; gap: 8px; }
.rs-related span { font-size: 13px; font-weight: 700; color: var(--rs-ink); }
.rs-related a { font-size: 13px; color: var(--rs-accent); text-decoration: none; }

nav.article-toc {
    background: var(--rs-bg);
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 24px;
}
nav.article-toc span { display: block; font-size: 12px; font-weight: 700; color: var(--rs-ink); margin-bottom: 8px; }
nav.article-toc a { display: block; font-size: 13px; color: var(--rs-accent); text-decoration: none; padding: 3px 0; }

/* Trust pages */

.rs-page-head { background: var(--rs-bg); padding-block: 40px; }
.rs-page-head span { color: var(--rs-accent); font-weight: 700; font-size: 12px; }
.rs-page-head h1 { font-size: 30px; margin: 8px 0; color: var(--rs-ink); }
.rs-page-layout { display: grid; grid-template-columns: 1fr 220px; gap: 40px; padding-block: 40px 80px; }
.rs-page-layout aside strong { display: block; font-size: 13px; margin-bottom: 10px; color: var(--rs-ink); }
.rs-page-layout aside a { display: block; font-size: 14px; color: #5a6472; text-decoration: none; padding: 4px 0; }
.rs-page-layout aside a[aria-current] { color: var(--rs-accent); font-weight: 600; }

/* Search */

.rs-search { padding-block: 60px 100px; }
.rs-search h1 { font-size: 30px; color: var(--rs-ink); }
.rs-search form { display: flex; gap: 10px; max-width: 480px; margin: 20px 0; }
.rs-search input { flex: 1; padding: 12px 14px; border: 1px solid var(--rs-border); border-radius: 8px; font-size: 15px; }
.rs-search button { padding: 12px 20px; background: var(--rs-accent); color: #fff; border: none; border-radius: 8px; font-weight: 600; cursor: pointer; }
.rs-search-results article { padding: 16px 0; border-bottom: 1px solid var(--rs-border); }
.rs-search-results span { font-size: 11px; color: var(--rs-accent); font-weight: 700; }
.rs-search-results h2 { font-size: 17px; margin: 4px 0; }
.rs-search-results h2 a { color: var(--rs-ink); text-decoration: none; }
.rs-search-results p { font-size: 14px; color: #5a6472; margin: 0; }

@media (max-width: 900px) {
    .rs-library-layout { grid-template-columns: 1fr; }
    .rs-library-filters { position: static; flex-direction: row; flex-wrap: wrap; }
    .rs-entry { flex-direction: column; gap: 6px; }
    .rs-article-layout { grid-template-columns: 1fr; }
    .rs-article-rail { position: static; }
    .rs-page-layout { grid-template-columns: 1fr; }
}
