/* Resources & Companies page styles */
:root {
    --earth: #8a7a6a;
    --earth-dark: #5c4e40;
    --earth-light: #a09080;
    --earth-subtle: rgba(138, 122, 106, 0.07);
    --res-sidebar-w: 220px;
    --res-content-w: 760px;
}
.res-layout {
    display: flex;
    flex: 1;
    min-height: calc(100vh - 52px - 52px);
}

/* Sidebar */
.res-sidebar {
    flex: 0 0 var(--res-sidebar-w);
    width: var(--res-sidebar-w);
    background: var(--bg-alt);
    border-right: 1px solid var(--border);
    overflow-y: auto;
    position: sticky;
    top: 0;
    height: calc(100vh - 52px);
}

.res-sidebar-inner {
    padding: 20px 12px 40px;
}

.res-sidebar-group {
    margin: 0 0 12px;
}

.res-sidebar-group:last-child {
    margin-bottom: 0;
}

.res-sidebar-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(181, 156, 128, 0.88);
    margin: 0 0 6px;
    padding: 0 8px;
    font-family: 'Inter', system-ui, sans-serif;
    font-weight: 600;
    list-style: none;
    cursor: pointer;
}

.res-sidebar-label::-webkit-details-marker { display: none; }
.res-sidebar-label::marker { display: none; }

.res-sidebar-caret {
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-top: -1px;
    border-right: 1.6px solid currentColor;
    border-bottom: 1.6px solid currentColor;
    transform: rotate(45deg);
    text-indent: -9999px;
    overflow: hidden;
    transition: transform 0.16s ease;
}

.res-sidebar-group:not([open]) .res-sidebar-caret {
    transform: rotate(-45deg);
}

.res-sidebar-links {
    display: grid;
    gap: 1px;
}

.res-nav-link {
    display: block;
    padding: 7px 8px;
    font-size: 0.875rem;
    color: rgba(193, 170, 143, 0.82);
    text-decoration: none;
    border-radius: 5px;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    line-height: 1.3;
}

.res-nav-link:hover { color: rgba(219, 198, 174, 0.98); background: rgba(255,255,255,0.05); }
.res-nav-link.active { color: rgba(230, 210, 184, 1); background: var(--earth-subtle, rgba(138,122,106,0.07)); }

/* Main content */
.res-main {
    flex: 1;
    overflow-y: auto;
    padding: 0 0 80px;
    min-width: 0;
}

.res-section {
    display: none;
    padding: 40px 48px;
    max-width: 960px;
    width: 100%;
    box-sizing: border-box;
    /* Optically center in the viewport (half sidebar offset) */
    margin-left: max(0px, calc(50vw - var(--res-sidebar-w) - 480px));
    margin-right: auto;
}

.res-section.active { display: block; }

.res-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 10px;
    letter-spacing: -0.01em;
}

.res-h2 {
    font-size: 1.0625rem;
    font-weight: 700;
    margin: 32px 0 12px;
    color: var(--text);
}

.res-desc {
    color: var(--text-secondary);
    margin: 0 0 28px;
    font-size: 0.9375rem;
    line-height: 1.7;
}

.res-text {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    margin: 0 0 12px;
    line-height: 1.7;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

.res-note {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-style: italic;
    margin-top: 8px;
}

/* Callouts */
.res-callout {
    background: rgba(196, 168, 122, 0.04);
    border: 1px solid rgba(196, 168, 122, 0.15);
    border-left: 3px solid var(--earth);
    border-radius: 6px;
    padding: 14px 16px;
    font-size: 0.875rem;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 24px 0;
}

.res-callout strong { color: var(--text); }

.res-callout-warn {
    border-left-color: #f59e0b;
    background: rgba(245, 158, 11, 0.05);
}

/* Tables */
.res-table-wrap {
    overflow-x: auto;
    margin: 4px 0 16px;
}

.res-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

.res-table th {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
}

.res-table td {
    padding: 9px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    color: var(--text);
    vertical-align: top;
    line-height: 1.5;
}

.res-table tr:hover td { background: rgba(255,255,255,0.02); }
.positive { color: #6ee7b7; }
.negative { color: #f87171; }

.res-matrix td,
.res-matrix th {
    min-width: 140px;
}

.res-arch-diagram {
    margin: 10px 0 22px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: 'SF Mono', 'Fira Code', 'Fira Mono', 'Cascadia Code', monospace;
    font-size: 0.76rem;
    line-height: 1.65;
    color: #d8d2c6;
    white-space: pre;
    overflow-x: auto;
}

/* Lists */
.res-list {
    color: var(--text-secondary);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 0.9rem;
    line-height: 1.8;
    padding-left: 20px;
    margin: 0 0 16px;
}

.res-list li { margin-bottom: 4px; }
.res-list strong { color: var(--text); }

/* AI Prompt blocks */
.ai-prompt-block {
    margin: 12px 0 24px;
    border: 1px solid rgba(138, 122, 106, 0.25);
    border-radius: 10px;
    overflow: hidden;
}

.ai-prompt-label {
    background: rgba(138, 122, 106, 0.1);
    border-bottom: 1px solid rgba(138, 122, 106, 0.2);
    padding: 7px 10px 7px 14px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--earth-light);
    font-family: 'Inter', system-ui, sans-serif;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.ai-prompt-copy {
    border: 1px solid rgba(138, 122, 106, 0.35);
    background: rgba(138, 122, 106, 0.18);
    color: var(--earth-light);
    border-radius: 6px;
    padding: 5px 9px;
    font-family: inherit;
    font-size: 0.65rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-weight: 700;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.ai-prompt-copy:hover {
    background: rgba(138, 122, 106, 0.3);
    border-color: rgba(138, 122, 106, 0.55);
    color: var(--text);
}

.ai-prompt-copy.is-copied {
    color: #c6f6d5;
    border-color: rgba(134, 239, 172, 0.5);
    background: rgba(134, 239, 172, 0.16);
}

.ai-prompt-code {
    margin: 0;
    padding: 14px 16px;
    background: rgba(255,255,255,0.02);
    font-family: 'SF Mono', 'Fira Code', 'Fira Mono', 'Cascadia Code', monospace;
    font-size: 0.8rem;
    line-height: 1.65;
    color: var(--text);
    white-space: pre-wrap;
    word-break: break-word;
    overflow-x: auto;
}

/* Checklists */
.res-checklist {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.checklist-item {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 0.875rem;
    color: var(--text-secondary);
    padding: 8px 12px;
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border);
    border-radius: 5px;
}

/* Steps */
.res-steps {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 0 0 16px;
}

.res-step {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.step-num {
    flex: 0 0 28px;
    height: 28px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--text);
    margin-top: 1px;
}

.res-step strong { color: var(--text); }

/* External links */
.res-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 8px 0 16px;
}

.res-ext-link {
    display: inline-block;
    padding: 7px 12px;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.8125rem;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    transition: color 0.15s, border-color 0.15s;
}

.res-ext-link:hover {
    color: var(--text);
    border-color: rgba(255,255,255,0.3);
}

.res-link-groups {
    display: grid;
    gap: 14px;
}

.res-link-group {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.02);
    padding: 12px 14px;
}

.res-link-group-title {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--earth-light);
    margin-bottom: 8px;
    font-weight: 700;
}

/* Card grids */
.res-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
    margin: 4px 0 16px;
}

.res-card {
    display: block;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    text-decoration: none;
    transition: border-color 0.15s, background 0.15s;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

.res-card:hover {
    border-color: rgba(255,255,255,0.25);
    background: rgba(255,255,255,0.04);
}

.res-card-featured {
    border-color: rgba(255,255,255,0.2);
}

.res-card-title {
    font-weight: 700;
    font-size: 0.9375rem;
    color: var(--text);
    margin-bottom: 6px;
}

.res-card-desc {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 10px;
}

.res-card-tag {
    font-size: 0.75rem;
    color: var(--text-secondary);
    opacity: 0.7;
}

/* Compact directory list (Open-Source Tools, etc.) */
.res-section-directory {
    max-width: var(--res-content-w);
    /* 380px = half of --res-content-w (760px) */
    margin-left: max(0px, calc(50vw - var(--res-sidebar-w) - 380px));
}

.res-section-directory .res-title {
    font-size: 1.375rem;
    margin-bottom: 6px;
}

.res-section-directory .res-desc {
    margin-bottom: 22px;
    line-height: 1.5;
    max-width: 48ch;
}

.res-section-directory .res-h2 {
    margin: 28px 0 10px;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--earth-light);
}

.res-section-directory .res-h2:first-of-type {
    margin-top: 0;
}

.res-section-directory .res-callout {
    margin: 18px 0 0;
    padding: 10px 12px;
}

.res-tool-list {
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    margin: 0;
    background: rgba(255, 255, 255, 0.015);
}

.res-tool-row {
    display: block;
    padding: 12px 16px;
    text-decoration: none;
    border-bottom: 1px solid var(--border);
    transition: background 0.12s ease;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

.res-tool-row:last-child {
    border-bottom: none;
}

.res-tool-row:hover {
    background: rgba(196, 168, 122, 0.07);
}

.res-tool-row:hover .res-tool-name {
    color: rgba(230, 210, 184, 1);
}

.res-tool-featured {
    box-shadow: inset 2px 0 0 var(--earth);
    background: rgba(196, 168, 122, 0.035);
}

.res-tool-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 4px;
}

.res-tool-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text);
    letter-spacing: -0.01em;
    transition: color 0.12s ease;
}

.res-tool-tag {
    font-size: 0.6875rem;
    color: rgba(196, 168, 122, 0.85);
    letter-spacing: 0.02em;
    padding: 2px 7px;
    border-radius: 4px;
    background: rgba(196, 168, 122, 0.08);
    border: 1px solid rgba(196, 168, 122, 0.12);
}

.res-tool-desc {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.45;
    max-width: 58ch;
}

/* Color code grid (utility colors) */
.color-code-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 8px;
    margin: 8px 0;
}

.color-chip {
    display: flex;
    flex-direction: column;
    padding: 12px 14px;
    border-radius: 6px;
    gap: 4px;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

.color-chip span:first-child {
    font-weight: 700;
    font-size: 0.875rem;
    color: inherit;
}

.color-chip span:last-child {
    font-size: 0.8125rem;
    color: inherit;
    opacity: 0.85;
}

/* Company table layout */
.company-search {
    width: 100%;
    max-width: 460px;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 10px 12px;
    color: var(--text);
    font-size: 0.875rem;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    outline: none;
    margin: 0 0 10px;
}

.company-search:focus {
    border-color: rgba(255,255,255,0.3);
}

.company-grid {
    margin: 8px 0 20px;
}

/* Companies page: use available width and scroll in main pane */
.companies-page .res-main {
    overflow-x: auto;
}

.companies-page .res-section {
    max-width: none;
    width: 100%;
}

.company-table-wrap {
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: auto;
    background: var(--bg-alt);
}

.companies-page .company-table-wrap {
    overflow: visible;
}

.company-table {
    width: 100%;
    min-width: 1080px;
    border-collapse: collapse;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 0.8125rem;
}

.companies-page .company-table {
    width: max(100%, 1320px);
}

.company-table th {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
    position: sticky;
    top: 0;
    background: #171412;
    z-index: 2;
}

.company-table td {
    padding: 9px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    color: var(--text);
    line-height: 1.45;
    vertical-align: top;
}

.company-table tr:last-child td {
    border-bottom: none;
}

.company-table tr:hover td {
    background: rgba(255,255,255,0.03);
}

.company-table a {
    color: var(--text);
    text-decoration: none;
    border-bottom: 1px dotted rgba(255,255,255,0.35);
}

.company-table a:hover {
    color: var(--earth-light);
    border-bottom-color: rgba(160, 144, 128, 0.9);
}

/* Filter buttons */
.company-filter-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}

.co-filter {
    padding: 6px 12px;
    font-size: 0.8125rem;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
}

.co-filter:hover { color: var(--text); border-color: rgba(255,255,255,0.3); }
.co-filter.active { background: rgba(255,255,255,0.1); color: var(--text); border-color: rgba(255,255,255,0.25); }

/* Ownership cards */
.ownership-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
    margin: 16px 0;
}

.ownership-card {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.ownership-card-title {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    font-weight: 700;
    font-size: 0.9375rem;
    color: var(--text);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

.ownership-card-body {
    padding: 14px 16px;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    line-height: 1.6;
}

.ownership-card-body p { margin: 0 0 8px; }
.ownership-card-body p:last-child { margin: 0; }
.ownership-card-body strong { color: var(--text); }

/* Glossary */
.glossary-search-wrap { margin-bottom: 20px; }

.glossary-search {
    width: 100%;
    max-width: 400px;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 10px 14px;
    color: var(--text);
    font-size: 0.9375rem;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    outline: none;
}

.glossary-search:focus { border-color: rgba(255,255,255,0.3); }

.glossary-grid {
    columns: 2;
    column-gap: 32px;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

.glossary-entry {
    break-inside: avoid;
    margin-bottom: 14px;
}

.glossary-term {
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--text);
    margin-bottom: 2px;
}

.glossary-def {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Mobile resources navigator */
.res-mobile-nav {
    display: none;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-alt);
    position: sticky;
    top: 0;
    z-index: 10;
}

.res-mobile-select {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    color: var(--text);
    font-size: 0.9rem;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a8278' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

/* ─── Themed scrollbars ─────────────────────────────── */
.res-main,
.res-sidebar,
.res-table-wrap,
.ai-prompt-code {
    scrollbar-width: thin;
    scrollbar-color: #3a3028 transparent;
}

.res-main::-webkit-scrollbar,
.res-sidebar::-webkit-scrollbar,
.res-table-wrap::-webkit-scrollbar,
.ai-prompt-code::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.res-main::-webkit-scrollbar-track,
.res-sidebar::-webkit-scrollbar-track,
.res-table-wrap::-webkit-scrollbar-track,
.ai-prompt-code::-webkit-scrollbar-track { background: transparent; }

.res-main::-webkit-scrollbar-thumb,
.res-sidebar::-webkit-scrollbar-thumb,
.res-table-wrap::-webkit-scrollbar-thumb,
.ai-prompt-code::-webkit-scrollbar-thumb {
    background: #3a3028;
    border-radius: 3px;
}

.res-main::-webkit-scrollbar-thumb:hover,
.res-sidebar::-webkit-scrollbar-thumb:hover,
.res-table-wrap::-webkit-scrollbar-thumb:hover,
.ai-prompt-code::-webkit-scrollbar-thumb:hover { background: #5a4a3b; }

/* ─── Flow diagram system ────────────────────────────── */
.flow-diag {
    margin: 10px 0 22px;
    background: rgba(0, 0, 0, 0.12);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: #3a3028 transparent;
}

.flow-diag::-webkit-scrollbar { height: 5px; }
.flow-diag::-webkit-scrollbar-track { background: transparent; }
.flow-diag::-webkit-scrollbar-thumb { background: #3a3028; border-radius: 3px; }
.flow-diag::-webkit-scrollbar-thumb:hover { background: #5a4a3b; }

.res-arch-diagram pre {
    scrollbar-width: thin;
    scrollbar-color: #3a3028 transparent;
}
.res-arch-diagram pre::-webkit-scrollbar { height: 5px; }
.res-arch-diagram pre::-webkit-scrollbar-track { background: transparent; }
.res-arch-diagram pre::-webkit-scrollbar-thumb { background: #3a3028; border-radius: 3px; }
.res-arch-diagram pre::-webkit-scrollbar-thumb:hover { background: #5a4a3b; }

.flow-row {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.flow-node {
    flex: 1;
    min-width: 150px;
    background: rgba(138, 122, 106, 0.07);
    border: 1px solid rgba(138, 122, 106, 0.2);
    border-radius: 6px;
    padding: 12px 14px;
}

.flow-node-primary {
    border-color: rgba(187, 152, 113, 0.4);
    background: rgba(187, 152, 113, 0.08);
}

.flow-node-accent {
    border-color: rgba(138, 122, 106, 0.32);
    background: rgba(138, 122, 106, 0.1);
}

.flow-node-title {
    font-size: 0.72rem;
    font-weight: 700;
    color: #c4a87a;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-family: 'Inter', system-ui, sans-serif;
    margin-bottom: 8px;
    line-height: 1.3;
}

.flow-node-items {
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 0.775rem;
    color: var(--text-secondary);
    font-family: 'Inter', system-ui, sans-serif;
    line-height: 1.55;
}

.flow-node-items li {
    display: flex;
    align-items: baseline;
    gap: 7px;
    margin-bottom: 3px;
}

.flow-node-items li::before {
    content: '';
    display: inline-block;
    flex-shrink: 0;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: rgba(138, 122, 106, 0.5);
    margin-top: 0.4em;
}

.flow-down {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 5px 0;
}

.flow-down-line {
    width: 1px;
    height: 16px;
    background: rgba(138, 122, 106, 0.4);
}

.flow-down-arrow {
    color: var(--earth, #8a7a6a);
    font-size: 0.8rem;
    line-height: 1;
}

.flow-down-label {
    font-size: 0.67rem;
    color: rgba(138, 122, 106, 0.65);
    font-family: 'Inter', system-ui, sans-serif;
    text-align: center;
    margin-top: 3px;
    letter-spacing: 0.02em;
}

/* Timeline-style flow (numbered steps) */
.flow-timeline {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.flow-tl-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    position: relative;
    padding: 8px 0;
}

.flow-tl-item:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 11px;
    top: 32px;
    bottom: 0;
    width: 1px;
    background: rgba(138, 122, 106, 0.3);
}

.flow-tl-num {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(138, 122, 106, 0.15);
    border: 1px solid rgba(138, 122, 106, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.68rem;
    font-weight: 700;
    color: #c4a87a;
    font-family: 'Inter', system-ui, sans-serif;
    margin-top: 1px;
}

.flow-tl-content { flex: 1; padding-bottom: 2px; }

.flow-tl-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text);
    font-family: 'Inter', system-ui, sans-serif;
    margin-bottom: 2px;
}

.flow-tl-desc {
    font-size: 0.775rem;
    color: var(--text-secondary);
    font-family: 'Inter', system-ui, sans-serif;
    line-height: 1.5;
}

.flow-note {
    margin-top: 14px;
    padding: 8px 12px;
    background: rgba(196, 168, 122, 0.04);
    border: 1px solid rgba(196, 168, 122, 0.12);
    border-left: 2px solid rgba(196, 168, 122, 0.4);
    border-radius: 4px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-family: 'Inter', system-ui, sans-serif;
    line-height: 1.5;
}

/* Responsive */
@media (max-width: 768px) {
    .res-sidebar { display: none; }
    .res-mobile-nav { display: block; }
    .res-section,
    .res-section-directory {
        padding: 20px 16px;
        margin-left: auto;
        margin-right: auto;
    }
    .res-title { font-size: 1.25rem; }
    .res-h2 { font-size: 0.9375rem; }
    .res-section-directory .res-h2 { font-size: 0.6875rem; }
    .res-card-grid, .ownership-cards { grid-template-columns: 1fr; }
    .glossary-grid { columns: 1; }
    .res-table-wrap { margin-left: -16px; margin-right: -16px; }
    .res-table th, .res-table td { padding: 7px 10px; font-size: 0.8rem; }
    .company-search { max-width: 100%; }
    .company-table { min-width: 920px; }
    .ai-prompt-code { font-size: 0.72rem; }
    .res-highlight-grid { grid-template-columns: 1fr; }
    .res-tool-tag { white-space: normal; }
}

@media (max-width: 480px) {
    .res-section { padding: 16px 12px; }
    .res-desc { font-size: 0.875rem; margin-bottom: 18px; }
    .res-callout { padding: 10px 12px; }
    .ai-prompt-block { margin: 8px 0 18px; }
    .res-tool-row { padding: 9px 12px; }
}
