:root {
    --primary-color: #2563eb;
    --primary-dark: #1e40af;
    --primary-light: #3b82f6;
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --border-color: #e2e8f0;
    --border-radius: 8px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-secondary);
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

.container {
    width: 100%;
    min-height: 100vh;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 0;
    margin: 0;
    padding: 0;
}

/* Sidebar Navigation */
.sidebar {
    background: var(--bg-primary);
    border-right: 1px solid var(--border-color);
    padding: 0;
    position: sticky;
    top: 0;
    align-self: start;
    max-height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    z-index: 10;
}

.sidebar-header {
    padding: 32px 24px 24px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.sidebar-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
    letter-spacing: -0.01em;
}

.sidebar-header a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.sidebar-header a:hover {
    color: var(--primary-color);
}

.sidebar-header p {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 0;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.sidebar nav {
    flex: 1;
    padding: 16px 0;
}

.nav-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-menu li {
    margin: 0;
    list-style: none;
}

.nav-menu li::before {
    display: none;
}

.nav-menu a {
    display: block;
    padding: 14px 24px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9375rem;
    font-weight: 500;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    position: relative;
    line-height: 1.5;
}

.nav-menu a:hover {
    background: var(--bg-secondary);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
}

.nav-menu a.active {
    background: var(--bg-tertiary);
    color: var(--primary-color);
    font-weight: 600;
    border-left-color: var(--primary-color);
}

.nav-section {
    margin-top: 16px;
    margin-bottom: 8px;
}

.nav-section-title,
.nav-group-title {
    display: block;
    padding: 12px 24px 8px;
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-top: 20px;
    margin-bottom: 6px;
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
}

.nav-section:first-child .nav-section-title,
.nav-group:first-child .nav-group-title {
    margin-top: 0;
    border-top: none;
    padding-top: 8px;
}

.nav-group {
    margin: 0;
}

.nav-group-items {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-group-items li {
    margin: 0;
}
/* Ensure parent links are always clickable */
.nav-group-items > li {
    position: relative;
}

.nav-group-items > li > a {
    position: relative;
    z-index: 100;
    pointer-events: auto !important;
    display: block;
    /* Ensure parent link stays clickable above subfolder list */
    background: transparent;
    cursor: pointer;
}

.nav-subgroup-items {
    position: relative;
    z-index: 1;
    margin-top: 0;
    margin-bottom: 0;
    pointer-events: auto;
    /* Ensure subfolder list doesn't overlap parent link */
    padding-top: 0;
    margin-left: 0;
}

.nav-subgroup-items a {
    pointer-events: auto;
    position: relative;
    z-index: 1;
}



.nav-subgroup {
    margin: 0;
    margin-top: 8px;
}

.nav-subgroup-title {
    display: block;
    padding: 8px 24px 6px 32px;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-top: 8px;
    margin-bottom: 4px;
}

.nav-subgroup-items {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-subgroup-items li {
    margin: 0;
}

.nav-subgroup-items a {
    padding-left: 40px;
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 400;
    opacity: 0.8;
}

.nav-subgroup-items a:hover {
    color: var(--primary-color);
    opacity: 1;
}

/* Archived reference styling */
.nav-subgroup-title {
    font-style: italic;
}

/* Main Content - Consistent spacing across all pages */
.main-content {
    background: var(--bg-primary);
    padding: 48px 64px;
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

.content-wrapper {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0;
}

/* Ensure consistent spacing for all content sections */
.content-wrapper > *:first-child {
    margin-top: 0;
}

.content-wrapper > *:last-child {
    margin-bottom: 0;
}

h1 {
    color: var(--text-primary);
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 0 24px 0;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

/* Back link - consistent styling across all pages */
.back-link {
    display: inline-block;
    position: relative;
    padding-left: 24px;
    margin: 0 0 48px 0;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9375rem;
    font-weight: 500;
    transition: color 0.2s ease;
    line-height: 1.5;
}

.back-link:hover {
    color: var(--primary-color);
}

.back-link::before {
    content: '←';
    position: absolute;
    left: 0;
    top: 0.1em;
    width: 6px;
    height: 6px;
    color: var(--primary-color);
    font-weight: 600;
}

/* Ensure sufficient spacing when h1 follows back-link */
.back-link + h1 {
    margin-top: 0;
}

h2 {
    color: var(--text-primary);
    font-size: 1.875rem;
    font-weight: 600;
    margin: 48px 0 16px 0;
    line-height: 1.3;
    letter-spacing: -0.01em;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border-color);
}

h3 {
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 600;
    margin: 32px 0 12px 0;
    line-height: 1.4;
}

h4 {
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 600;
    margin: 24px 0 12px 0;
}

/* Superscript styling - consistent across all pages */
sup {
    font-size: 0.75em;
    vertical-align: super;
    line-height: 0;
    color: var(--primary-color);
    font-weight: 600;
    margin-left: 2px;
}

sup:hover {
    text-decoration: underline;
    cursor: help;
}

h5, h6 {
    color: var(--text-primary);
    font-weight: 600;
    margin-top: 20px;
    margin-bottom: 8px;
}

/* Paragraph spacing - consistent across all pages */
p {
    margin: 16px 0;
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.7;
}

p:first-child {
    margin-top: 0;
}

p:last-child {
    margin-bottom: 0;
}

ul, ol {
    margin-left: 0;
    margin-bottom: 24px;
    padding-left: 24px;
}

ul {
    list-style-type: none;
    padding-left: 0;
}

/* Only apply custom bullets to content lists, not navigation */
.content-wrapper ul > li {
    position: relative;
    padding-left: 24px;
    margin-bottom: 8px;
    color: var(--text-secondary);
    line-height: 1.7;
}

.content-wrapper ul > li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.75em;
    width: 6px;
    height: 6px;
    background: var(--primary-color);
    border-radius: 50%;
}

/* Exclude task-list items from getting bullet points */
.content-wrapper ul.task-list > li::before {
    display: none;
}

ol {
    list-style-type: decimal;
    padding-left: 24px;
}

ol > li {
    margin-bottom: 8px;
    color: var(--text-secondary);
    line-height: 1.7;
    padding-left: 8px;
}

code {
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', 'Courier New', monospace;
    font-size: 0.875em;
    color: #dc2626;
    font-weight: 500;
    border: 1px solid var(--border-color);
}

pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 20px;
    border-radius: var(--border-radius);
    overflow-x: auto;
    margin: 24px 0;
    box-shadow: var(--shadow-md);
    border: 1px solid #334155;
    font-size: 0.875rem;
    line-height: 1.6;
}

pre code {
    background: transparent;
    color: inherit;
    padding: 0;
    border: none;
    font-weight: 400;
    font-size: inherit;
}

/* Mermaid diagram styling */
.mermaid-container {
    margin: 32px 0;
    padding: 24px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    overflow-x: auto;
}

.mermaid {
    background: transparent;
    text-align: center;
}

/* Remove black borders from ALL Mermaid shapes */
.mermaid svg rect[class*="node"],
.mermaid svg rect[class*="label"],
.mermaid svg rect[class*="flowchart"],
.mermaid svg rect[class*="cluster"],
.mermaid svg rect[class*="decision"],
.mermaid svg rect[class*="actor"],
.mermaid svg rect[class*="note"],
.mermaid svg polygon[class*="node"],
.mermaid svg polygon[class*="decision"],
.mermaid svg polygon[class*="flowchart"],
.mermaid svg .node rect,
.mermaid svg .node polygon,
.mermaid svg .node circle,
.mermaid svg .node ellipse,
.mermaid svg .flowchart-label rect,
.mermaid svg .decision polygon,
.mermaid svg .decision rect,
.mermaid svg .cluster rect,
.mermaid svg .cluster polygon,
.mermaid svg .flowchart-node rect,
.mermaid svg .flowchart-node polygon,
.mermaid svg g[class*="node"] rect,
.mermaid svg g[class*="node"] polygon,
.mermaid svg g[class*="flowchart"] rect,
.mermaid svg g[class*="flowchart"] polygon {
    stroke: transparent !important;
    stroke-width: 0 !important;
    border: none !important;
}

/* Target all rect and polygon elements in Mermaid diagrams */
.mermaid svg rect:not(.edgePath rect):not(.flowchart-link rect),
.mermaid svg polygon:not(.edgePath polygon):not(.flowchart-link polygon) {
    stroke: transparent !important;
    stroke-width: 0 !important;
}

/* Override any inline styles for shapes */
.mermaid svg rect[stroke],
.mermaid svg polygon[stroke],
.mermaid svg circle[stroke],
.mermaid svg ellipse[stroke] {
    stroke: transparent !important;
    stroke-width: 0 !important;
}

/* Target shapes by their fill attribute */
.mermaid svg rect[fill]:not([fill="none"]):not([fill="transparent"]),
.mermaid svg polygon[fill]:not([fill="none"]):not([fill="transparent"]),
.mermaid svg circle[fill]:not([fill="none"]):not([fill="transparent"]),
.mermaid svg ellipse[fill]:not([fill="none"]):not([fill="transparent"]) {
    stroke: transparent !important;
    stroke-width: 0 !important;
}

/* Universal rule: remove stroke from all rect and polygon elements */
.mermaid svg > g > g rect,
.mermaid svg > g > g polygon,
.mermaid svg > g > g > g rect,
.mermaid svg > g > g > g polygon,
.mermaid svg g:not(.edgePath):not(.flowchart-link) rect,
.mermaid svg g:not(.edgePath):not(.flowchart-link) polygon {
    stroke: transparent !important;
    stroke-width: 0 !important;
}

/* Final catch-all: remove borders from all shapes - ULTRA aggressive */
.mermaid svg rect:not(.edgePath rect):not(.flowchart-link rect),
.mermaid svg polygon:not(.edgePath polygon):not(.flowchart-link polygon),
.mermaid svg circle:not(.edgePath circle),
.mermaid svg ellipse:not(.edgePath ellipse) {
    stroke: none !important;
    stroke-width: 0 !important;
    stroke-opacity: 0 !important;
}

/* Target ALL shapes regardless of class or parent */
.mermaid svg rect[fill]:not([fill="none"]):not([fill="transparent"]),
.mermaid svg polygon[fill]:not([fill="none"]):not([fill="transparent"]),
.mermaid svg circle[fill]:not([fill="none"]):not([fill="transparent"]),
.mermaid svg ellipse[fill]:not([fill="none"]):not([fill="transparent"]) {
    stroke: none !important;
    stroke-width: 0 !important;
    stroke-opacity: 0 !important;
}

/* Keep lines and arrows visible */
.mermaid svg .edgePath path,
.mermaid svg .flowchart-link,
.mermaid svg line,
.mermaid svg path[marker-end],
.mermaid svg .arrowheadPath {
    stroke: #475569 !important;
    stroke-width: 2px !important;
}

blockquote {
    border-left: 4px solid var(--primary-color);
    padding: 16px 20px;
    margin: 24px 0;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
}

blockquote p {
    margin-bottom: 0;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

th, td {
    border-bottom: 1px solid var(--border-color);
    padding: 12px 16px;
    text-align: left;
}

th {
    background: var(--primary-color);
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

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

tr:nth-child(even) {
    background-color: var(--bg-secondary);
}

tr:hover {
    background-color: var(--bg-tertiary);
    transition: background-color 0.2s ease;
}

img {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    margin: 24px 0;
    box-shadow: var(--shadow-md);
}

hr {
    border: none;
    border-top: 2px solid var(--border-color);
    margin: 40px 0;
}

strong {
    color: var(--text-primary);
    font-weight: 600;
}

em {
    color: var(--text-secondary);
    font-style: italic;
}

/* Index page styles */
.index-content {
    max-width: 1000px;
}

.lead {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 48px;
}

.documentation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-top: 32px;
}

.doc-card {
    background: var(--bg-secondary);
    padding: 24px;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
    position: relative;
}

.doc-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.doc-card-badge {
    display: inline-block;
    margin-top: 8px;
    margin-bottom: 12px;
    padding: 4px 12px;
    background: var(--primary-color);
    color: white;
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 4px;
}

.doc-card h2 {
    font-size: 1.5rem;
    margin: 0 0 0 0;
    border: none;
    padding: 0;
}

.doc-card h2 a {
    color: var(--text-primary);
}

.doc-card p {
    margin-bottom: 16px;
    font-size: 0.9375rem;
}

.doc-link {
    display: inline-block;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.9375rem;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Responsive design */
@media (max-width: 968px) {
.container {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 100vh;
}

.sidebar {
    position: relative;
    height: auto;
    max-height: none;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
}

.main-content {
    padding: 32px 24px;
    height: auto;
}

.content-wrapper {
    max-width: 100%;
    padding: 0;
}

h1 {
    font-size: 2rem;
}

h2 {
    font-size: 1.5rem;
}

.documentation-grid {
    grid-template-columns: 1fr;
}
}

@media (max-width: 640px) {
.main-content {
    padding: 24px 16px;
}

h1 {
    font-size: 1.75rem;
}

h2 {
    font-size: 1.25rem;
}

pre {
    padding: 16px;
    font-size: 0.8125rem;
}

.mermaid-container {
    padding: 16px;
}
}

/* Print styles */
@media print {
.sidebar {
    display: none;
}

.container {
    grid-template-columns: 1fr;
}

.main-content {
    padding: 0;
}
}

.nav-group-items > li {
    position: relative;
}

.nav-group-items > li > a {
    position: relative;
    z-index: 100;
    pointer-events: auto !important;
    display: block;
    /* Ensure parent link stays clickable above subfolder list */
    background: transparent;
    cursor: pointer;
}

.nav-subgroup-items {
    position: relative;
    z-index: 1;
    margin-top: 0;
    margin-bottom: 0;
    pointer-events: auto;
    /* Ensure subfolder list doesn't overlap parent link */
    padding-top: 0;
    margin-left: 0;
}

.nav-subgroup-items a {
    pointer-events: auto;
    position: relative;
    z-index: 1;
}
/* Review Status Badges */
.review-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 0.875rem;
}

.review-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8125rem;
    font-weight: 500;
}

.review-status-badge.read-indias {
    background: #dbeafe;
    color: #1e40af;
}

.review-status-badge.read-john {
    background: #d1fae5;
    color: #065f46;
}

.review-status-badge.verified {
    background: #dcfce7;
    color: #166534;
    font-weight: 600;
}

.review-status-badge.comments {
    background: #fef3c7;
    color: #92400e;
}

.review-status-date {
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-left: auto;
}

/* Section Review Status (for all h2 sections) */
.section-review-status {
    margin: 0.75rem 0 1.5rem 0;
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 0.875rem;
}

.section-review-status .review-checkboxes {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.section-review-status .review-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    cursor: pointer;
}

.section-review-status .review-checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.section-review-status .review-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* Section Comments */
.section-review-status .section-comments {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.section-review-status .comment-toggle {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-review-status .comment-toggle:hover {
    text-decoration: underline;
}

.section-review-status .comment-form {
    margin-top: 1rem;
    display: none;
}

.section-review-status .comment-form.active {
    display: block;
}

.section-review-status .comment-name-input {
    width: 100%;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.875rem;
    font-family: inherit;
}

.section-review-status .comment-name-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.section-review-status .comment-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.875rem;
    font-family: inherit;
    resize: vertical;
    min-height: 80px;
    margin-bottom: 0.5rem;
}

.section-review-status .comment-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.section-review-status .comment-submit {
    padding: 0.5rem 1rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
}

.section-review-status .comment-submit:hover {
    background: var(--primary-dark);
}

.section-review-status .comments-list {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.section-review-status .comment-item {
    padding: 0.75rem;
    margin: 0.5rem 0;
    background: var(--bg-primary);
    border-left: 3px solid var(--primary-color);
    border-radius: 4px;
    font-size: 0.875rem;
}

.section-review-status .comment-author {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}

.section-review-status .comment-text {
    color: var(--text-secondary);
    margin: 0.5rem 0;
}

.section-review-status .comment-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.section-review-status .comment-delete {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.section-review-status .comment-delete:hover {
    opacity: 1;
    text-decoration: underline;
}
