/* Shared stylesheet for docs.bluesprig.app — index.html and troubleshooting.html. */
:root {
    --blue-dark: #1a365d;
    --blue-primary: #2563eb;
    --blue-light: #3b82f6;
    --blue-pale: #eff6ff;
    --green-primary: #16a34a;
    --green-light: #22c55e;
    --green-pale: #f0fdf4;
    --amber: #b45309;
    --amber-pale: #fffbeb;
    --purple-primary: #7c3aed;
    --purple-pale: #f5f3ff;
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --white: #ffffff;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px 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;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--gray-50);
    -webkit-font-smoothing: antialiased;
}

/* Header */
header {
    background: linear-gradient(135deg, var(--blue-dark) 0%, var(--blue-primary) 100%);
    color: var(--white);
    padding: 4rem 1.5rem;
    text-align: center;
}

.logo {
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    opacity: 0.9;
    margin-bottom: 1rem;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    letter-spacing: -0.025em;
}

header .tagline {
    font-size: 1.125rem;
    color: var(--white);
    margin-bottom: 0.5rem;
    font-weight: 400;
}

header a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}

header .subtag {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.95);
    margin-bottom: 1.5rem;
}

.version-badge {
    display: inline-block;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(4px);
    padding: 0.5rem 1.25rem;
    border-radius: 9999px;
    font-weight: 500;
    font-size: 0.875rem;
    border: 1px solid rgba(255,255,255,0.2);
}

/* Navigation */
nav {
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    max-width: 900px;
    margin: 0 auto;
    padding: 0;
}

nav a {
    display: block;
    padding: 1rem 1.25rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.15s;
}

nav a:hover {
    color: var(--blue-primary);
}

/* Main Content */
/* Deep links land below the sticky nav (~54px) instead of under it. */
[id] {
    scroll-margin-top: 4.5rem;
}

main {
    max-width: 800px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem;
}

section {
    background: var(--white);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
}

h2 {
    color: var(--blue-dark);
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    letter-spacing: -0.025em;
}

h3 {
    color: var(--text-primary);
    font-size: 1.125rem;
    font-weight: 600;
    margin: 1.5rem 0 0.75rem;
}

p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

section ul, section ol {
    margin: 0 0 1rem 1.4rem;
    color: var(--text-secondary);
}

section li {
    margin-bottom: 0.45rem;
}

section li strong, section p strong {
    color: var(--text-primary);
}

.kicker {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--blue-primary);
    margin-bottom: 0.4rem;
}

.kicker.beta {
    color: var(--purple-primary);
}

.pill-label {
    display: inline-block;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 0.2rem 0.65rem;
    border-radius: 9999px;
    vertical-align: middle;
    margin-left: 0.5rem;
}

.pill-stable { background: var(--green-pale); color: var(--green-primary); }
.pill-beta { background: var(--purple-pale); color: var(--purple-primary); }

/* What's New */
.whats-new {
    background: var(--green-pale);
    border-color: var(--green-primary);
    border-left: 4px solid var(--green-primary);
}

.whats-new h2 {
    color: var(--green-primary);
}

.update-item {
    background: var(--white);
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
    border: 1px solid rgba(22, 163, 74, 0.15);
}

.update-item:last-child {
    margin-bottom: 0;
}

.update-item h4 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.update-item p {
    font-size: 0.875rem;
    margin: 0;
    color: var(--text-secondary);
}

.tag {
    display: inline-block;
    font-size: 0.625rem;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-right: 0.35rem;
    vertical-align: middle;
}

.tag-fixed { background: var(--gray-200); color: var(--text-primary); }
.tag-improved { background: var(--blue-pale); color: var(--blue-primary); }
.tag-new { background: var(--green-pale); color: var(--green-primary); }

/* Steps */
.steps {
    counter-reset: step;
}

.step {
    position: relative;
    padding-left: 3.5rem;
    margin-bottom: 1.5rem;
    min-height: 2.5rem;
}

.step:last-child {
    margin-bottom: 0;
}

.step::before {
    counter-increment: step;
    content: counter(step);
    position: absolute;
    left: 0;
    top: 0;
    width: 2.5rem;
    height: 2.5rem;
    background: var(--blue-primary);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
}

.step h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.step p {
    margin: 0;
    font-size: 0.9375rem;
}

.step ul {
    margin: 0.5rem 0 0;
    padding-left: 1.25rem;
    font-size: 0.9375rem;
}

.step ul li + li {
    margin-top: 0.5rem;
}

code {
    background: var(--gray-100);
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    font-family: 'SF Mono', Monaco, 'Courier New', monospace;
    font-size: 0.8125rem;
    color: var(--blue-primary);
}

/* Features */
.features-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

.feature-card {
    background: var(--gray-50);
    border-radius: 8px;
    padding: 1.25rem;
    border: 1px solid var(--gray-200);
}

.feature-card h4 {
    font-size: 0.9375rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.feature-card p {
    font-size: 0.8125rem;
    margin: 0;
    color: var(--text-muted);
}

/* Shortcuts */
.shortcuts {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.shortcut {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--gray-50);
    border-radius: 8px;
    border: 1px solid var(--gray-200);
    flex: 1;
}

.shortcut kbd {
    background: var(--white);
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.8125rem;
    box-shadow: 0 1px 0 var(--gray-300);
}

.shortcut span {
    color: var(--text-secondary);
    font-size: 0.8125rem;
}

/* Callout */
.callout {
    padding: 1rem 1.25rem;
    border-radius: 8px;
    margin: 1.25rem 0;
    font-size: 0.875rem;
    background: var(--blue-pale);
    border-left: 3px solid var(--blue-primary);
    color: var(--text-secondary);
}

.callout-warning {
    background: #fef3c7;
    border-left: 3px solid #f59e0b;
}

.callout-good {
    background: var(--green-pale);
    border-left: 3px solid var(--green-primary);
}

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

.callout p {
    margin: 0;
    color: var(--text-secondary);
}

/* Figures (beta guide) */
figure {
    margin: 1.25rem 0 1.5rem;
}

figure img {
    width: 100%;
    height: auto;
    border: 1px solid var(--gray-300);
    border-radius: 0.5rem;
    box-shadow: var(--shadow-lg);
    display: block;
}

figure.narrow img {
    max-width: 26rem;
    margin: 0 auto;
}

figcaption {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: center;
    margin-top: 0.5rem;
}

/* FAQ */
.faq-item {
    padding: 1rem 0;
    border-bottom: 1px solid var(--gray-200);
}

.faq-item:first-child {
    padding-top: 0;
}

.faq-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.faq-item h4 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.375rem;
}

.faq-item p {
    font-size: 0.875rem;
    margin: 0;
}

/* Changelog */
.changelog-entry {
    padding: 1.1rem 0;
    border-top: 1px solid var(--gray-200);
}

.changelog-entry:first-of-type {
    border-top: none;
    padding-top: 0.25rem;
}

.changelog-head {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.changelog-version {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
}

.changelog-date {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.changelog-entry ul {
    margin: 0 0 0 1.4rem;
    color: var(--text-secondary);
}

.changelog-entry li {
    margin-bottom: 0.45rem;
}

/* Payor Table */
.payor-section {
    overflow-x: auto;
}

.payor-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
}

.payor-table th {
    text-align: left;
    padding: 0.75rem 1rem;
    background: var(--gray-100);
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 2px solid var(--gray-200);
    white-space: nowrap;
}

.payor-table td {
    padding: 0.625rem 1rem;
    border-bottom: 1px solid var(--gray-200);
    color: var(--text-secondary);
}

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

.payor-table tr:hover td {
    background: var(--gray-50);
}

.family-badge {
    display: inline-block;
    padding: 0.125rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.6875rem;
    font-weight: 600;
    color: white;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    letter-spacing: 0.02em;
}

.table-scroll {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
}

.table-scroll thead th {
    position: sticky;
    top: 0;
    z-index: 10;
}

/* Filter Controls */
.filter-controls {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.filter-controls select {
    padding: 0.625rem 1rem;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    font-size: 0.875rem;
    background: var(--white);
    cursor: pointer;
    min-width: 200px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.filter-controls select:focus {
    outline: none;
    border-color: var(--blue-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.filter-controls input {
    flex: 1;
    padding: 0.625rem 1rem;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    font-size: 0.875rem;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.filter-controls input:focus {
    outline: none;
    border-color: var(--blue-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.filter-controls input::placeholder {
    color: var(--text-muted);
}

.no-results {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.8125rem;
}

/* Responsive */
@media (max-width: 640px) {
    header h1 { font-size: 1.75rem; }
    header .tagline { font-size: 1rem; }
    section { padding: 1.5rem; }
    .step { padding-left: 3rem; }
    .step::before { width: 2rem; height: 2rem; font-size: 0.75rem; }
    .features-grid { grid-template-columns: 1fr; }
    .shortcuts { flex-direction: column; }
    nav a { padding: 0.75rem 1rem; font-size: 0.8125rem; }
}
