/* ========================================
   Technical Grid Design System
   ======================================== */

/* CSS Variables */
:root {
    /* Gray Scale */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;

    /* Accent Colors */
    --blue-50: #eff6ff;
    --blue-100: #dbeafe;
    --blue-500: #3b82f6;
    --blue-600: #2563eb;
    --green-500: #22c55e;
    --green-600: #16a34a;
    --amber-500: #f59e0b;
    --red-500: #ef4444;

    /* Emerald "trust / contribution" accent — used by the calculator's
       Vendor Trust Index contribution card (vendor-block). Differentiates
       contribution UI (emerald) from calculation inputs (blue) and the
       optional-dose card (amber). */
    --emerald-50: #ecfdf5;
    --emerald-100: #d1fae5;
    --emerald-200: #a7f3d0;
    --emerald-300: #6ee7b7;
    --emerald-500: #10b981;
    --emerald-600: #059669;
    --emerald-700: #047857;

    /* Base */
    --white: #ffffff;
    --grid-color: rgba(59, 130, 246, 0.07);
}

/* ========================================
   Base Page Styles
   ======================================== */

.ds-page {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--gray-50);
    color: var(--gray-700);
    line-height: 1.6;
    min-height: 100vh;
    position: relative;
}

/* Technical grid background */
.ds-page::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        linear-gradient(var(--grid-color) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
    z-index: 0;
}

.ds-page > * {
    position: relative;
    z-index: 1;
}

/* ========================================
   Container
   ======================================== */

.ds-container {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 24px;
    padding-right: 24px;
}

.ds-container-sm {
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 16px;
    padding-right: 16px;
}

.ds-container-md {
    max-width: 768px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 24px;
    padding-right: 24px;
}

.ds-container-footer {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 16px;
    padding-right: 16px;
}

/* ========================================
   Typography
   ======================================== */

.ds-font-body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.ds-font-mono,
.mono {
    font-family: 'JetBrains Mono', monospace;
}

/* Missing Tailwind height class - h-14 = 3.5rem = 56px */
.h-14 {
    height: 3.5rem;
}

.ds-text-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1.2;
}

.ds-text-heading {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-900);
    line-height: 1.3;
}

.ds-text-body {
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--gray-700);
}

.ds-text-small {
    font-size: 0.85rem;
    color: var(--gray-600);
}

.ds-text-muted {
    color: var(--gray-500);
}

/* ========================================
   Cards
   ======================================== */

.ds-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    overflow: hidden;
}

.ds-card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-200);
    background: linear-gradient(180deg, var(--gray-50) 0%, var(--white) 100%);
    font-weight: 600;
    color: var(--gray-900);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ds-card-body {
    padding: 24px;
}

.ds-card-body-lg {
    padding: 32px;
}

/* ========================================
   Buttons
   ======================================== */

.ds-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    cursor: pointer;
    transition: all 0.15s ease;
    border: none;
    text-decoration: none;
}

.ds-btn-primary {
    background: var(--blue-500);
    color: var(--white);
}

.ds-btn-primary:hover {
    background: var(--blue-600);
    transform: translateY(-1px);
}

.ds-btn-primary:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
}

.ds-btn-primary:active {
    transform: translateY(0);
}

.ds-btn-primary:disabled {
    background: var(--gray-300);
    cursor: not-allowed;
    transform: none;
}

.ds-btn-amber {
    background: #f59e0b;  /* amber-500 */
    color: var(--white);
}

.ds-btn-amber:hover {
    background: #d97706;  /* amber-600 */
    transform: translateY(-1px);
}

.ds-btn-amber:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.3);
}

.ds-btn-amber:active {
    transform: translateY(0);
}

.ds-btn-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
    border: 1px solid var(--gray-200);
}

.ds-btn-secondary:hover {
    background: var(--gray-200);
    color: var(--gray-900);
}

.ds-btn-secondary:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(107, 114, 128, 0.3);
}

.ds-btn-ghost {
    background: transparent;
    color: var(--gray-600);
}

.ds-btn-ghost:hover {
    background: var(--gray-100);
    color: var(--gray-900);
}

.ds-btn-ghost:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(107, 114, 128, 0.2);
}

.ds-btn-ghost-amber {
    background: transparent;
    color: #d97706;  /* amber-600 */
}

.ds-btn-ghost-amber:hover {
    background: #fffbeb;  /* amber-50 */
    color: #b45309;  /* amber-700 */
}

.ds-btn-ghost-amber:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.2);
}

.ds-btn-ghost-danger {
    background: transparent;
    color: var(--gray-500);
}

.ds-btn-ghost-danger:hover {
    background: #fef2f2;  /* red-50 */
    color: #dc2626;  /* red-600 */
}

.ds-btn-ghost-danger:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

.ds-btn-ghost-green {
    background: transparent;
    color: #16a34a;  /* green-600 */
}

.ds-btn-ghost-green:hover {
    background: #f0fdf4;  /* green-50 */
    color: #15803d;  /* green-700 */
}

.ds-btn-ghost-green:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.2);
}

.ds-btn-success {
    background: var(--green-500);
    color: var(--white);
}

.ds-btn-success:hover {
    background: var(--green-600);
    transform: translateY(-1px);
}

.ds-btn-success:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.3);
}

.ds-btn-success:active {
    transform: translateY(0);
}

.ds-btn-success:disabled {
    background: var(--gray-300);
    cursor: not-allowed;
    transform: none;
}

/* Purple CTA button variant */
.ds-btn-cta {
    background: #a855f7;  /* purple-500 */
    color: var(--white);
}

.ds-btn-cta:hover {
    background: #9333ea;  /* purple-600 */
    transform: translateY(-1px);
}

.ds-btn-cta:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.3);
}

.ds-btn-cta:active {
    transform: translateY(0);
}

/* Danger button variant */
.ds-btn-danger {
    background: var(--red-500);
    color: var(--white);
}

.ds-btn-danger:hover {
    background: #dc2626;  /* red-600 */
    transform: translateY(-1px);
}

.ds-btn-danger:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.3);
}

.ds-btn-danger:active {
    transform: translateY(0);
}

.ds-btn-sm {
    padding: 6px 14px;
    font-size: 0.85rem;
}

.ds-btn-lg {
    padding: 12px 24px;
    font-size: 1rem;
}

.ds-btn-full {
    width: 100%;
}

/* ========================================
   Form Elements
   ======================================== */

.ds-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 6px;
}

.ds-label-sm {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-500);
}

.ds-input {
    display: block;
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--gray-900);
    background: var(--white);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ds-input:focus {
    outline: none;
    border-color: var(--blue-500);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.ds-input::placeholder {
    color: var(--gray-400);
}

.ds-input-error {
    border-color: var(--red-500);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.3);
}

.ds-input-error:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.4);
}

.ds-textarea {
    min-height: 120px;
    resize: vertical;
}

.ds-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 40px;
}

.ds-checkbox {
    width: 16px;
    height: 16px;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    cursor: pointer;
}

.ds-checkbox:checked {
    background: var(--blue-500);
    border-color: var(--blue-500);
}

/* ========================================
   Header (for auth/static pages)
   ======================================== */

.ds-header {
    padding: 16px 0;
    border-bottom: 1px solid var(--gray-200);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.ds-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ========================================
   Links
   ======================================== */

.ds-link {
    color: var(--blue-500);
    text-decoration: none;
    transition: color 0.15s ease;
}

.ds-link:hover {
    color: var(--blue-600);
    text-decoration: underline;
}

.ds-link-muted {
    color: var(--gray-500);
    text-decoration: none;
}

.ds-link-muted:hover {
    color: var(--gray-700);
}

/* ========================================
   Alerts / Messages
   ======================================== */

.ds-alert {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.875rem;
    animation: alertFadeIn 0.3s ease-out;
}

@keyframes alertFadeIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ds-alert-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.ds-alert-success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.ds-alert-warning {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
}

.ds-alert-info {
    background: var(--blue-50);
    border: 1px solid var(--blue-100);
    color: #1e40af;
}

/* ========================================
   Dividers
   ======================================== */

.ds-divider {
    height: 1px;
    background: var(--gray-200);
    border: none;
    margin: 24px 0;
}

.ds-divider-text {
    display: flex;
    align-items: center;
    gap: 16px;
    color: var(--gray-400);
    font-size: 0.85rem;
}

.ds-divider-text::before,
.ds-divider-text::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--gray-200);
}

/* ========================================
   Page Sections (for static pages)
   ======================================== */

.ds-page-header {
    padding: 32px 0;
    border-bottom: 1px solid var(--gray-200);
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.ds-page-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 8px;
}

.ds-page-description {
    font-size: 1rem;
    color: var(--gray-600);
}

.ds-page-subtitle {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--blue-500);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ds-page-subtitle::before {
    content: '';
    width: 24px;
    height: 2px;
    background: var(--blue-500);
}

.ds-section {
    padding: 48px 0;
}

.ds-section-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 16px;
}

/* ========================================
   Prose Content (for terms, privacy)
   ======================================== */

.ds-prose {
    color: var(--gray-700);
    line-height: 1.7;
}

.ds-prose h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-top: 32px;
    margin-bottom: 16px;
}

.ds-prose h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-top: 24px;
    margin-bottom: 12px;
}

.ds-prose p {
    margin-bottom: 16px;
}

.ds-prose ul,
.ds-prose ol {
    margin-bottom: 16px;
    padding-left: 24px;
}

.ds-prose li {
    margin-bottom: 8px;
}

.ds-prose a {
    color: var(--blue-500);
    text-decoration: none;
}

.ds-prose a:hover {
    text-decoration: underline;
}

.ds-prose strong {
    color: var(--gray-900);
    font-weight: 600;
}

/* Warning/Important boxes in prose */
.ds-prose-warning {
    background: #fffbeb;
    border-left: 4px solid var(--amber-500);
    padding: 16px;
    margin: 24px 0;
    border-radius: 0 8px 8px 0;
}

.ds-prose-warning p {
    margin: 0;
    color: #92400e;
}

.ds-prose-danger {
    background: #fef2f2;
    border-left: 4px solid var(--red-500);
    padding: 16px;
    margin: 24px 0;
    border-radius: 0 8px 8px 0;
}

.ds-prose-danger p {
    margin: 0;
    color: #991b1b;
}

/* ========================================
   Trust Badge (for auth pages)
   ======================================== */

.ds-trust-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    background: var(--gray-50);
    border-radius: 8px;
    font-size: 0.8rem;
    color: var(--gray-600);
}

.ds-trust-badge svg {
    width: 16px;
    height: 16px;
    color: var(--green-500);
}

/* ========================================
   Back Link
   ======================================== */

.ds-back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--gray-600);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.15s ease;
}

.ds-back-link:hover {
    color: var(--gray-900);
}

.ds-back-link svg {
    width: 16px;
    height: 16px;
}

/* ========================================
   Combined Page Header (with logo)
   ======================================== */

.ds-page-header .ds-header-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.ds-page-header .ds-header-logo {
    width: 32px;
    height: 32px;
}

.ds-page-header .ds-header-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-900);
}

.ds-page-header-divider {
    width: 1px;
    height: 24px;
    background: var(--gray-300);
}

.ds-page-header .ds-page-title {
    font-size: 1.25rem;
    margin-bottom: 0;
}

/* ========================================
   Responsive
   ======================================== */

@media (max-width: 640px) {
    .ds-card-body {
        padding: 20px;
    }

    .ds-card-body-lg {
        padding: 24px;
    }

    .ds-page-title {
        font-size: 1.5rem;
    }

    .ds-container {
        padding: 0 16px;
    }

    /* Combined header mobile adjustments */
    .ds-page-header .ds-header-title {
        display: none;
    }

    .ds-page-header .ds-page-title {
        font-size: 1.1rem;
    }

    .ds-page-header-divider {
        display: none;
    }
}

/* ========================================
   Reconstitution Calculator Components
   ======================================== */

/* Input Section - Elevated cards with blue glow */
.ds-input-elevated {
    background: var(--white);
    padding: 16px;
    border-radius: 12px;
    border: 1px solid #bfdbfe; /* blue-200 */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
                0 2px 4px -2px rgba(0, 0, 0, 0.1),
                0 0 0 3px rgba(59, 130, 246, 0.1);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.ds-input-elevated:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 12px -2px rgba(0, 0, 0, 0.15),
                0 4px 6px -2px rgba(0, 0, 0, 0.1),
                0 0 0 3px rgba(59, 130, 246, 0.15);
}

.ds-input-elevated:focus-within {
    border-color: #60a5fa; /* blue-400 */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
                0 2px 4px -2px rgba(0, 0, 0, 0.1),
                0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* Yellow glow variant for Desired Dose */
.ds-input-elevated-yellow {
    position: relative;
    background: var(--white);
    padding: 16px;
    border-radius: 12px;
    border: 1px solid #fcd34d; /* amber-300 */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
                0 2px 4px -2px rgba(0, 0, 0, 0.1),
                0 0 0 3px rgba(234, 179, 8, 0.2);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.ds-input-elevated-yellow:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 12px -2px rgba(0, 0, 0, 0.15),
                0 4px 6px -2px rgba(0, 0, 0, 0.1),
                0 0 0 3px rgba(234, 179, 8, 0.25);
}

.ds-input-elevated-yellow:focus-within {
    border-color: #fbbf24; /* amber-400 */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
                0 2px 4px -2px rgba(0, 0, 0, 0.1),
                0 0 0 3px rgba(234, 179, 8, 0.25);
}

/* Icon Badge for input labels */
.ds-icon-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: var(--gray-100);
    border-radius: 6px;
    font-size: 1rem;
}

/* Preset Buttons */
.ds-preset-btn {
    padding: 8px 16px;
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    background: white;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--gray-600);
    cursor: pointer;
    transition: all 0.15s;
}

.ds-preset-btn:hover {
    border-color: var(--gray-300);
    color: var(--gray-900);
}

.ds-preset-btn.active {
    background: var(--blue-500);
    border-color: var(--blue-500);
    color: white;
}

/* Blue preset button variant (blue bg, green hover) */
.ds-preset-btn-blue {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    background: var(--blue-100);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--gray-700);
    cursor: pointer;
    transition: all 0.15s;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.ds-preset-btn-blue:hover {
    background: #dcfce7; /* green-100 */
    box-shadow: 0 2px 4px rgba(34, 197, 94, 0.15);
}

.ds-preset-btn-blue:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
}

.ds-preset-btn-blue.active {
    background: #bbf7d0; /* green-200 */
    color: var(--gray-800);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.ds-preset-btn-blue:focus-visible {
    outline: 2px solid var(--blue-500);
    outline-offset: 2px;
}

/* Preset button group wrapper */
.ds-preset-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.ds-preset-group + .ds-preset-group {
    margin-top: 8px;
}

/* Terminal-style Results Card */
.ds-results-card {
    background: var(--gray-900);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.2),
                0 10px 40px -10px rgba(0, 0, 0, 0.3);
}

.ds-results-header {
    padding: 16px 24px;
    background: var(--gray-800);
    display: flex;
    align-items: center;
    gap: 8px;
}

.ds-results-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.ds-results-dot.green { background: var(--green-500); }
.ds-results-dot.amber { background: var(--amber-500); }
.ds-results-dot.blue { background: var(--blue-500); }

.ds-results-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: var(--gray-400);
    margin-left: auto;
}

.ds-results-body {
    padding: 24px;
}

.ds-result-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 12px 0;
    border-bottom: 1px solid var(--gray-800);
}

.ds-result-row:last-child {
    border-bottom: none;
}

.ds-result-label {
    font-size: 0.9rem;
    color: var(--gray-400);
}

.ds-result-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.25rem;
    font-weight: 600;
    color: white;
}

.ds-result-value .unit,
.ds-result-unit {
    font-size: 0.85rem;
    color: var(--gray-400);
    margin-left: 4px;
}

.ds-result-value.highlight {
    color: var(--green-500);
    font-size: 1.5rem;
}

/* Syringe Visual Container */
.ds-syringe-visual {
    margin-top: 24px;
    padding: 24px;
    background: var(--gray-800);
    border-radius: 8px;
}

.ds-syringe-label {
    font-size: 0.8rem;
    color: var(--gray-400);
    margin-bottom: 12px;
    font-family: 'JetBrains Mono', monospace;
}

/* Info Cards for Sidebar */
.ds-info-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.ds-info-card h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ds-info-card h3 .number {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: var(--blue-500);
}

.ds-info-card p {
    font-size: 0.9rem;
    color: var(--gray-600);
    line-height: 1.7;
}

.ds-info-card ul {
    margin-top: 12px;
    padding-left: 20px;
}

.ds-info-card li {
    font-size: 0.9rem;
    color: var(--gray-600);
    margin-bottom: 8px;
}

/* Warning Box */
.ds-warning-box {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    background: #fffbeb; /* amber-50 */
    border: 1px solid var(--amber-500);
    border-radius: 8px;
    padding: 16px;
}

.ds-warning-box::before {
    content: '⚠️';
    flex-shrink: 0;
}

.ds-warning-box p {
    font-size: 0.85rem;
    color: var(--gray-700);
    margin: 0;
}

.ds-warning-box strong {
    color: var(--gray-900);
}

/* Calculator Layout - Two columns */
.ds-calc-layout {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 40px;
}

@media (max-width: 1024px) {
    .ds-calc-layout {
        grid-template-columns: 1fr;
    }
}

/* Three-column input grid */
.ds-input-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 32px;
}

@media (max-width: 768px) {
    .ds-input-grid {
        grid-template-columns: 1fr;
    }
}

/* Input with Unit Suffix */
.ds-input-with-unit {
    display: flex;
    align-items: stretch;
}

.ds-input-with-unit input {
    border-radius: 8px 0 0 8px;
    border-right: none;
}

.ds-input-unit {
    padding: 12px 16px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 0 8px 8px 0;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--gray-600);
    display: flex;
    align-items: center;
    font-family: 'JetBrains Mono', monospace;
}

/* Number labels for sections */
.ds-number {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--blue-500);
    background: var(--blue-50);
    padding: 4px 8px;
    border-radius: 4px;
}

/* Vial Card Styles for Saved List */
.ds-vial-card {
    padding: 16px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    cursor: pointer;
    transition: box-shadow 0.15s;
}

.ds-vial-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Status badges */
.ds-status-active {
    padding: 4px 10px;
    background: #f0fdf4; /* green-50 */
    color: var(--green-600);
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.ds-status-low {
    padding: 4px 10px;
    background: #fef3c7; /* amber-100 */
    color: #d97706; /* amber-600 */
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.ds-status-finished {
    padding: 4px 10px;
    background: var(--gray-100);
    color: var(--gray-600);
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Icon buttons for edit/delete */
.ds-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    color: var(--gray-500);
    transition: all 0.15s;
}

.ds-icon-btn:hover {
    background: var(--gray-100);
    color: var(--blue-500);
}

.ds-icon-btn-danger:hover {
    background: #fef2f2;
    color: var(--red-500);
}

/* ========================================
   Toast Notification System
   ======================================== */

/* Container positioning - clears header */
#messageContainer {
    padding-top: 88px; /* Clear header height */
}

#messageContainer > div {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

/* Base notification styles */
.ds-notification {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.4;
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 2px 4px -2px rgba(0, 0, 0, 0.1),
        0 0 0 1px rgba(0, 0, 0, 0.05);
    pointer-events: auto;
    max-width: 420px;
    width: auto;
    animation: notificationSlideIn 0.3s cubic-bezier(0.21, 1.02, 0.73, 1) forwards;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* Success - Green */
.ds-notification-success {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border: 1px solid #6ee7b7;
    color: #065f46;
}

/* Error - Red */
.ds-notification-error {
    background: linear-gradient(135deg, #fef2f2 0%, #fecaca 100%);
    border: 1px solid #f87171;
    color: #991b1b;
}

/* Warning - Amber */
.ds-notification-warning {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border: 1px solid #fbbf24;
    color: #92400e;
}

/* Info - Blue */
.ds-notification-info {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border: 1px solid #60a5fa;
    color: #1e40af;
}

/* Icon styling */
.ds-notification-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
}

.ds-notification-icon svg {
    display: block;
    width: 18px;
    height: 18px;
}

/* Text styling */
.ds-notification-text {
    flex: 1;
    min-width: 0;
}

/* Dismiss button */
.ds-notification-dismiss {
    flex-shrink: 0;
    padding: 4px;
    margin: -4px -4px -4px 4px;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    opacity: 0.5;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: currentColor;
}

.ds-notification-dismiss:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.08);
}

/* Animations */
@keyframes notificationSlideIn {
    from {
        transform: translateY(-12px) scale(0.96);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.ds-notification.removing {
    animation: notificationSlideOut 0.25s cubic-bezier(0.21, 1.02, 0.73, 1) forwards;
}

@keyframes notificationSlideOut {
    from {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
    to {
        transform: translateY(-8px) scale(0.96);
        opacity: 0;
    }
}

/* Mobile responsive */
@media (max-width: 640px) {
    #messageContainer {
        padding-top: 76px; /* Slightly smaller header on mobile */
    }

    .ds-notification {
        margin: 0 12px;
        max-width: calc(100% - 24px);
        padding: 12px 14px;
        font-size: 0.8125rem;
    }
}

/* ========================================
   Callout/Alert Components
   ======================================== */

.ds-callout {
    padding: 1rem;
    border-radius: 0.5rem;
    border-left: 4px solid;
    margin-bottom: 1rem;
}

.ds-callout-info {
    background-color: var(--blue-50);
    border-left-color: var(--blue-500);
    color: #1e40af;
}

.ds-callout-warning {
    background-color: #fffbeb;
    border-left-color: var(--amber-500);
    color: #92400e;
}

/* ========================================
   Optional Badge
   ======================================== */

.ds-badge-optional {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(234, 179, 8, 0.15);
    color: #b45309;  /* amber-700 */
    border: 1px solid rgba(234, 179, 8, 0.3);
}

/* ========================================
   Results Card Animation
   ======================================== */

@keyframes slideInFromTop {
    from {
        transform: translateY(-20px);
    }
    to {
        transform: translateY(0);
    }
}

@keyframes slideOutToTop {
    from {
        transform: translateY(0);
    }
    to {
        transform: translateY(-20px);
    }
}

.ds-results-card.animate-in {
    animation: slideInFromTop 0.3s ease-out forwards;
}

.ds-results-card.animate-out {
    animation: slideOutToTop 0.25s ease-in forwards;
}

@media (prefers-reduced-motion: reduce) {
    .ds-results-card.animate-in,
    .ds-results-card.animate-out {
        animation: none;
    }

    .ds-notification,
    .ds-alert {
        animation: none;
    }
}

/* ========================================
   Page Transitions
   ======================================== */

/* Enable cross-document view transitions (Chrome 126+, Safari 18+) */
@view-transition {
    navigation: auto;
}

/* Subtle page transition */
::view-transition-old(root),
::view-transition-new(root) {
    animation-duration: 250ms;
    animation-timing-function: ease-out;
}

::view-transition-old(root) {
    animation-name: ds-page-fade-out;
}

::view-transition-new(root) {
    animation-name: ds-page-fade-in;
}

@keyframes ds-page-fade-out {
    from { opacity: 1; }
    to { opacity: 0.3; }
}

@keyframes ds-page-fade-in {
    from { opacity: 0.3; }
    to { opacity: 1; }
}

/* Fallback for browsers without View Transitions API */
@supports not (view-transition-name: root) {
    .ds-page {
        animation: ds-page-load 250ms ease-out;
    }

    @keyframes ds-page-load {
        from { opacity: 0.3; }
        to { opacity: 1; }
    }
}

/* Respect reduced motion preference for page transitions */
@media (prefers-reduced-motion: reduce) {
    @view-transition {
        navigation: none;
    }

    ::view-transition-old(root),
    ::view-transition-new(root) {
        animation: none;
    }

    @supports not (view-transition-name: root) {
        .ds-page {
            animation: none;
        }
    }
}

/* ========================================
   Modal Components
   ======================================== */

/* Modal overlay - flexbox centered container */
.ds-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

/* Stacked modal - appears above other modals */
.ds-modal-overlay.ds-modal-stacked {
    z-index: 60;
}

/* Ensure hidden class overrides display: flex */
.ds-modal-overlay.hidden {
    display: none;
}

/* Modal backdrop - absolute within overlay to maintain stacking context */
.ds-modal-backdrop {
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 0;
}

/* Modal content card - when inside flexbox container */
.ds-modal-overlay .ds-modal {
    position: relative;
    top: auto;
    left: auto;
    transform: none;
    max-height: calc(100vh - 2rem);
    overflow: hidden;
    z-index: 1;
    /* Flex column so the header stays pinned and the body scrolls instead of
       being clipped. Previously overflow:hidden here trapped tall content
       (e.g. the 24-row Hourly Drug Levels table) with no way to reach it.
       Safe for non-standard modals too: the header-less export spinner still
       centers via its own mx-auto / text-center utilities under flex. */
    display: flex;
    flex-direction: column;
}

/* Keep the modal title/close row fixed; let the body take remaining height
   and scroll. Direct-child (>) on purpose: header/body are always direct
   children of .ds-modal, and this stops the rule from leaking into any card
   nested *inside* a modal body. Scoped to modals so the 80 non-modal
   .ds-card-body usages are unaffected. */
.ds-modal-overlay .ds-modal > .ds-card-header {
    flex-shrink: 0;
}

.ds-modal-overlay .ds-modal > .ds-card-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}

/* Legacy: Standalone modal (backwards compatibility) */
.ds-modal {
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 51;
}

/* Mobile responsiveness for modals */
@media (max-width: 640px) {
    .ds-modal-overlay {
        padding: 0.75rem;
    }

    .ds-modal-overlay .ds-modal,
    .ds-modal {
        width: calc(100% - 1.5rem) !important;
        max-width: calc(100% - 1.5rem) !important;
        margin: 0 auto;
    }
}

/* Very small screens - reduce padding further */
@media (max-width: 375px) {
    .ds-modal-overlay {
        padding: 0.5rem;
    }

    .ds-modal-overlay .ds-modal,
    .ds-modal {
        width: calc(100% - 1rem) !important;
        max-width: calc(100% - 1rem) !important;
    }
}

/* ========================================
   Section Dividers
   ======================================== */

.ds-section-divider {
    height: 1px;
    background: linear-gradient(90deg,
        transparent 0%,
        var(--gray-200) 20%,
        var(--gray-200) 80%,
        transparent 100%);
    margin: 32px 0;
}

/* ========================================
   Info Card Enhancements
   ======================================== */

.ds-info-card-accent {
    border-left: 3px solid var(--blue-500);
}

.ds-info-card h4 {
    color: var(--gray-900);
    font-weight: 600;
}

/* ========================================
   Calculator SEO Content Components
   ======================================== */

.calc-section-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--blue-500);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.calc-feature-grid {
    display: grid;
    gap: 16px;
    margin-top: 20px;
}

.calc-feature-item {
    display: flex;
    gap: 12px;
    padding: 16px;
    background: var(--gray-50);
    border-radius: 8px;
    border: 1px solid var(--gray-100);
}

.calc-feature-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.calc-faq-list details {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    margin-bottom: 12px;
    transition: all 0.2s;
}

.calc-faq-list details:hover {
    border-color: var(--gray-300);
}

.calc-faq-list details[open] {
    border-color: var(--blue-500);
}

.calc-faq-list summary {
    padding: 16px 20px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 500;
    color: var(--gray-900);
    font-size: 0.95rem;
    list-style: none;
}

.calc-faq-list summary::-webkit-details-marker {
    display: none;
}

.calc-faq-list .chevron {
    transition: transform 0.2s ease;
    color: var(--gray-400);
}

.calc-faq-list details[open] .chevron {
    transform: rotate(180deg);
}

.calc-faq-list .faq-answer {
    padding: 0 20px 16px;
    color: var(--gray-600);
    font-size: 0.9rem;
    line-height: 1.6;
}

.calc-related-tools {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    padding: 20px 24px;
}

.calc-related-tools h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 12px;
}

.calc-related-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.calc-related-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--gray-700);
    text-decoration: none;
    transition: all 0.15s;
}

.calc-related-link:hover {
    border-color: var(--blue-500);
    color: var(--blue-500);
}

/* ========================================
   Tooltips
   ======================================== */

[data-tooltip] {
    position: relative;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 12px;
    background: var(--gray-900);
    color: white;
    font-size: 0.75rem;
    font-weight: 400;
    line-height: 1.4;
    border-radius: 6px;
    white-space: normal;
    width: max-content;
    max-width: 220px;
    text-align: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 50;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Tooltip arrow */
[data-tooltip]::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--gray-900);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 50;
}

[data-tooltip]:hover::after,
[data-tooltip]:hover::before,
[data-tooltip]:focus::after,
[data-tooltip]:focus::before {
    opacity: 1;
    visibility: visible;
}

/* Mobile: show on tap, position below */
@media (max-width: 640px) {
    [data-tooltip]::after {
        bottom: auto;
        top: calc(100% + 8px);
        max-width: 180px;
    }

    [data-tooltip]::before {
        bottom: auto;
        top: calc(100% + 2px);
        border-top-color: transparent;
        border-bottom-color: var(--gray-900);
    }
}

/* ========================================
   Flash Highlight Animation
   ======================================== */

.flash-highlight {
    animation: flash-pulse 0.5s ease-in-out 3 !important;
}

@keyframes flash-pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(250, 204, 21, 0);
        background-color: white;
    }
    50% {
        box-shadow: 0 0 0 4px rgba(250, 204, 21, 0.8);
        background-color: rgba(250, 204, 21, 0.3);
    }
}

/* ========================================
   Breadcrumbs
   ======================================== */

.ds-breadcrumbs {
    padding: 12px 0 4px;
    font-size: 0.875rem;
    color: var(--gray-500, #6b7280);
}

.ds-breadcrumbs-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.ds-breadcrumb-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    line-height: 1.4;
}

.ds-breadcrumb-item a {
    color: var(--gray-500, #6b7280);
    text-decoration: none;
}

.ds-breadcrumb-item a:hover,
.ds-breadcrumb-item a:focus-visible {
    color: var(--blue-600, #2563eb);
    text-decoration: underline;
}

.ds-breadcrumb-item.is-current span {
    color: var(--gray-700, #374151);
    font-weight: 500;
}

.ds-breadcrumb-sep {
    color: var(--gray-400, #9ca3af);
    user-select: none;
}

/* ========================================
   Inline Help Disclosures
   ======================================== */

.ds-help {
    border-radius: 8px;
}

.ds-help-disclosure {
    border: 1px solid var(--gray-200, #e5e7eb);
    border-radius: 6px;
    padding: 0;
    background-color: #fff;
    transition: border-color 0.15s ease;
}

.ds-help-disclosure[open] {
    border-color: var(--gray-300, #d1d5db);
}

.ds-help-summary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700, #374151);
    list-style: none;
    user-select: none;
}

.ds-help-summary::-webkit-details-marker {
    display: none;
}

.ds-help-summary::before {
    content: "▸";
    display: inline-block;
    font-size: 0.75rem;
    color: var(--gray-400, #9ca3af);
    transition: transform 0.15s ease;
}

.ds-help-disclosure[open] .ds-help-summary::before {
    transform: rotate(90deg);
}

.ds-help-summary:hover,
.ds-help-summary:focus-visible {
    color: var(--blue-600, #2563eb);
}

.ds-help-summary:focus-visible {
    outline: 2px solid var(--blue-500, #3b82f6);
    outline-offset: 2px;
    border-radius: 4px;
}

.ds-help-body {
    padding: 0 12px 12px 28px;
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--gray-600, #4b5563);
}

.ds-help-body p {
    margin: 0 0 10px 0;
}

.ds-help-body p:last-child {
    margin-bottom: 0;
}

.ds-help-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--blue-600, #2563eb);
    text-decoration: none;
    transition: color 0.15s ease;
}

.ds-help-link:hover,
.ds-help-link:focus-visible {
    color: var(--blue-700, #1d4ed8);
    text-decoration: underline;
}

.ds-help-link:focus-visible {
    outline: 2px solid var(--blue-500, #3b82f6);
    outline-offset: 2px;
    border-radius: 3px;
}

.ds-help-link-icon {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
}

/* ========================================
   Vendor Trust Index contribution card
   (calculator "Where did you get this vial?" block)
   Ported from specs/drafts/20260623_vti-vendor-section-mockup.html.
   Emerald accent = "contribution / trust"; layout grids use Tailwind
   utilities in the template, so only the bespoke component classes live
   here. The consent reveal uses :has() (the mockup's ~ selector could not
   cross the .consent-row nesting boundary).
   ======================================== */
.vendor-block {
    position: relative;
    margin-top: 20px;
    border: 1px solid var(--emerald-200);
    border-radius: 14px;
    background:
        radial-gradient(420px 160px at 100% 0%, rgba(16, 185, 129, .06), transparent 70%),
        linear-gradient(180deg, #fff 0%, var(--emerald-50) 140%);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, .07), 0 0 0 3px rgba(16, 185, 129, .08);
    transition: box-shadow .18s ease, transform .18s ease;
    overflow: hidden;
}
.vendor-block[open] {
    box-shadow: 0 10px 20px -8px rgba(5, 150, 105, .22), 0 0 0 3px rgba(16, 185, 129, .14);
}
.vendor-block:not([open]):hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 18px -8px rgba(5, 150, 105, .20), 0 0 0 3px rgba(16, 185, 129, .16);
}
.vendor-block::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, var(--emerald-500), var(--emerald-600));
}

.vendor-trigger {
    list-style: none;
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px 16px 20px;
}
.vendor-trigger::-webkit-details-marker { display: none; }
.vendor-ico {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(160deg, var(--emerald-100), #fff);
    border: 1px solid var(--emerald-200);
    box-shadow: inset 0 1px 0 #fff;
}
.vendor-ico svg { width: 21px; height: 21px; color: var(--emerald-600); }
.vendor-copy { flex: 1; min-width: 0; }
.vendor-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.vendor-title b {
    font-size: .98rem;
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: -.01em;
}
.vendor-block .pill {
    font-size: .62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--emerald-100);
    color: var(--emerald-700);
    border: 1px solid var(--emerald-200);
}
.vendor-block .pill-opt {
    background: var(--gray-100);
    color: var(--gray-500);
    border-color: var(--gray-200);
}
.vendor-sub {
    margin: 3px 0 0;
    font-size: .82rem;
    color: var(--gray-600);
    line-height: 1.35;
}
.vendor-chev { flex-shrink: 0; color: var(--emerald-600); transition: transform .2s ease; }
.vendor-block[open] .vendor-chev { transform: rotate(180deg); }

.vendor-body { padding: 4px 18px 18px 20px; animation: vendorReveal .22s ease; }
@keyframes vendorReveal {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}
.vendor-divider {
    height: 1px;
    background: linear-gradient(90deg, var(--emerald-200), transparent);
    margin: 2px 0 16px;
}

/* All bespoke contribution-card classes are scoped under .vendor-block so the
   generic names (.consent, .switch, .track, .shared, .janoshik, .share-*)
   cannot leak into the shared design system. */
.vendor-block .consent {
    margin-top: 18px;
    border: 1px dashed var(--emerald-300);
    border-radius: 12px;
    background: rgba(16, 185, 129, .05);
    padding: 14px 16px;
}
.vendor-block .consent-row { display: flex; align-items: flex-start; gap: 12px; }
.vendor-block .switch {
    position: relative;
    flex-shrink: 0;
    width: 44px;
    height: 26px;
    margin-top: 2px;
    cursor: pointer;
}
.vendor-block .switch input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
    z-index: 2;
}
.vendor-block .switch .track {
    position: absolute;
    inset: 0;
    border-radius: 999px;
    background: var(--gray-300);
    transition: background .18s ease;
}
.vendor-block .switch .track::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
    transition: transform .18s ease;
}
.vendor-block .switch input:checked ~ .track { background: var(--emerald-500); }
.vendor-block .switch input:checked ~ .track::after { transform: translateX(18px); }
.vendor-block .switch input:focus-visible ~ .track { box-shadow: 0 0 0 3px rgba(16, 185, 129, .35); }
.vendor-block .switch input:disabled ~ .track { opacity: .5; cursor: not-allowed; }
.vendor-block .consent-copy label {
    font-size: .85rem;
    font-weight: 600;
    color: var(--gray-900);
    cursor: pointer;
    display: block;
}
.vendor-block .consent-copy .lock {
    font-size: .76rem;
    color: var(--emerald-700);
    margin-top: 4px;
    line-height: 1.4;
    display: flex;
    gap: 6px;
}

/* What-gets-shared reveal — pure CSS, driven by the consent checkbox.
   :has() lets the toggle (nested in .consent-row) reveal .shared (a sibling
   of .consent-row) without JS. */
.vendor-block .shared {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height .28s ease, opacity .2s ease, margin .2s ease;
    margin-top: 0;
}
.vendor-block .consent:has(#vtiConsent:checked) .shared {
    max-height: 360px;
    opacity: 1;
    margin-top: 14px;
}
.vendor-block .shared-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.vendor-block .share-col { border-radius: 10px; padding: 11px 12px; font-size: .78rem; }
.vendor-block .share-public { background: #fff; border: 1px solid var(--emerald-200); }
.vendor-block .share-private { background: #fff; border: 1px solid var(--gray-200); }
.vendor-block .share-col h5 {
    margin: 0 0 7px;
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    display: flex;
    align-items: center;
    gap: 6px;
}
.vendor-block .share-public h5 { color: var(--emerald-700); }
.vendor-block .share-private h5 { color: var(--gray-500); }
.vendor-block .share-col ul { margin: 0; padding-left: 16px; color: var(--gray-600); line-height: 1.5; }
.vendor-block .janoshik { margin-top: 12px; }
.vendor-block .janoshik .ds-label { font-size: .78rem; }
.vendor-block .janoshik .ds-label .tag {
    font-weight: 600;
    color: var(--emerald-700);
    font-size: .68rem;
    background: var(--emerald-50);
    border: 1px solid var(--emerald-200);
    border-radius: 4px;
    padding: 1px 5px;
    margin-left: 6px;
}

.vendor-foot {
    margin-top: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    align-items: center;
    font-size: .78rem;
    color: var(--gray-500);
}
.vendor-foot a { color: var(--blue-600); text-decoration: none; font-weight: 500; }
.vendor-foot a:hover { text-decoration: underline; }
.vendor-foot .vti-link { color: var(--emerald-700); }
.vendor-foot .aff { font-size: .65rem; color: var(--gray-400); }
.vendor-foot .dot { color: var(--gray-300); }

/* Already-contributed state (edit mode): toggle locked on, breakdown hidden. */
.vendor-contributed-note {
    margin-top: 10px;
    font-size: .8rem;
    font-weight: 600;
    color: var(--emerald-700);
    display: flex;
    align-items: center;
    gap: 6px;
}

@media (max-width: 560px) {
    .shared-grid { grid-template-columns: 1fr; }
}

/* ───────────────────────────────────────────────────────────────────────────
   Newsletter subscribe block (_subscribe_block.html)
   SSOT for the card chrome. Lives here (globally loaded by base.html) rather
   than in the newsletter pages' page-scoped <style> blocks, so the site-wide
   footer placement actually renders the card — editorial card with a brand-blue
   hairline accent on the left edge.
   ─────────────────────────────────────────────────────────────────────────── */
.nl-subscribe-frame {
    position: relative;
    overflow: hidden;
    background: linear-gradient(180deg, #ffffff 0%, #f7f8fa 100%);
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}
.nl-subscribe-frame::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: #2563eb;
}
