/* 
 * Alexander Feick Personal Website
 * Design: Clean, architectural, deliberate
 * Color Palette: Slate gray, off-white, copper accent
 * Typography: Modern sans-serif (Inter, Source Sans Pro)
 */

/* CSS Variables */
:root {
    --color-primary: #94694d; /* Copper */
    --color-primary-dark: #7a5640;
    --color-secondary: #475569; /* Slate gray */
    --color-dark: #1e293b;
    --color-light: #f8fafc; /* Off-white */
    --color-text: #334155;
    --color-text-light: #64748b;
    --color-border: #e2e8f0;
    --color-bg-alt: #f1f5f9;
    
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-size-base: 16px;
    --line-height-base: 1.6;
    
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 4rem;
    --spacing-xl: 6rem;
    
    --transition-base: all 0.3s ease;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: var(--font-size-base);
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    line-height: var(--line-height-base);
    color: var(--color-text);
    background-color: var(--color-light);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    color: var(--color-dark);
    margin-bottom: var(--spacing-sm);
}

h1 {
    font-size: 3rem;
    letter-spacing: -0.02em;
}

h2 {
    font-size: 2.25rem;
    letter-spacing: -0.01em;
}

h3 {
    font-size: 1.5rem;
}

p {
    margin-bottom: var(--spacing-sm);
    font-size: 1rem;
    line-height: 1.7;
    color: var(--color-text);
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: var(--transition-base);
}

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

/* Layout Utilities */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* Navigation */
.navbar {
    background-color: white;
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
    justify-content: center;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-dark);
    letter-spacing: -0.01em;
    text-decoration: none;
}

.nav-logo {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: 2px solid var(--color-primary);
    object-fit: cover;
    transition: var(--transition-base);
}

.nav-brand:hover .nav-logo {
    border-color: var(--color-primary-dark);
    transform: scale(1.05);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    gap: 0.25rem;
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background-color: var(--color-dark);
    border-radius: 3px;
    transition: var(--transition-base);
}

.nav-toggle:hover span {
    background-color: var(--color-primary);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: var(--spacing-md);
}

.nav-link {
    color: var(--color-text-light);
    font-size: 0.95rem;
    font-weight: 500;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: 4px;
    transition: var(--transition-base);
}

.nav-link:hover,
.nav-link.active {
    color: var(--color-primary);
    background-color: rgba(148, 105, 77, 0.1);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--color-dark) 0%, var(--color-secondary) 100%);
    color: white;
    padding: var(--spacing-xl) 0;
    text-align: center;
}

.hero-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.hero-title {
    color: white;
    font-size: 3.5rem;
    margin-bottom: var(--spacing-md);
    letter-spacing: -0.02em;
}

.hero-portrait {
    margin: 0 auto var(--spacing-md);
    max-width: 150px;
}

.hero-image {
    width: 100%;
    height: auto;
    aspect-ratio: 1/1;
    object-fit: cover;
    border-radius: 12px;
    border: 3px solid var(--color-primary);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.hero-quote {
    font-size: 2rem;
    font-style: italic;
    color: var(--color-primary);
    margin-bottom: var(--spacing-md);
    font-weight: 400;
    line-height: 1.4;
}

.hero-description {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: var(--spacing-md);
    line-height: 1.8;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.hero-cta {
    display: flex;
    gap: var(--spacing-sm);
    justify-content: center;
    margin-top: var(--spacing-md);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.875rem 2rem;
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
    border-radius: 6px;
    transition: var(--transition-base);
    cursor: pointer;
    border: 2px solid transparent;
    text-decoration: none;
}

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

.btn-primary:hover {
    background-color: var(--color-primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(148, 105, 77, 0.3);
}

.btn-secondary {
    background-color: transparent;
    color: white;
    border-color: white;
}

.btn-secondary:hover {
    background-color: white;
    color: var(--color-primary);
}

/* Feature Section */
.featured-section {
    padding: var(--spacing-xl) 0;
    background-color: white;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
}

.feature-card {
    text-align: center;
    padding: var(--spacing-md);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    transition: var(--transition-base);
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    border-color: var(--color-primary);
}

.feature-icon {
    color: var(--color-primary);
    margin-bottom: var(--spacing-sm);
}

.feature-card h3 {
    font-size: 1.25rem;
    margin-bottom: var(--spacing-sm);
}

.feature-card p {
    color: var(--color-text-light);
    margin-bottom: 0;
}

/* Mission Section */
.mission-section {
    padding: var(--spacing-xl) 0;
    background-color: var(--color-bg-alt);
}

.mission-content {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: var(--spacing-lg);
    align-items: center;
}

.mission-portrait {
    position: relative;
}

.mission-image {
    width: 100%;
    height: auto;
    aspect-ratio: 1/1;
    object-fit: cover;
    border-radius: 12px;
    border: 3px solid var(--color-primary);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.mission-text-wrapper {
    text-align: left;
}

.mission-quote {
    font-size: 2rem;
    font-style: italic;
    color: var(--color-secondary);
    margin-bottom: var(--spacing-md);
    font-weight: 400;
    position: relative;
}

.mission-quote::before {
    content: '"';
    font-size: 4rem;
    color: var(--color-primary);
    position: absolute;
    left: -2rem;
    top: -1rem;
    opacity: 0.3;
}

.mission-text {
    font-size: 1.125rem;
    color: var(--color-text);
    line-height: 1.8;
}

/* Page Header */
.page-header {
    background: linear-gradient(135deg, var(--color-dark) 0%, var(--color-secondary) 100%);
    color: white;
    padding: var(--spacing-lg) 0;
    text-align: center;
}

.page-header h1 {
    color: white;
    margin-bottom: var(--spacing-xs);
}

.subtitle {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 400;
}

/* Simple Page Title (library-style) */
.page-title-simple {
    margin-bottom: var(--spacing-lg);
}

.page-title-simple h1 {
    font-size: 2rem;
    color: var(--color-dark);
    margin-bottom: var(--spacing-xs);
}

.page-title-simple .subtitle {
    font-size: 1.1rem;
    color: var(--color-text-light);
    font-style: italic;
}

/* Content Section */
.content-section {
    padding: var(--spacing-md) 0;
    background-color: white;
}

/* Page Intro (replaces page-header for interior pages) */
.page-intro {
    margin-bottom: var(--spacing-lg);
}

.page-intro h1 {
    font-size: 2.25rem;
    margin-bottom: var(--spacing-xs);
}

.page-intro .lead {
    font-size: 1.1rem;
    color: var(--color-text-light);
    max-width: 700px;
}

.subtitle {
    font-size: 1.1rem;
    color: var(--color-text-light);
    margin-bottom: var(--spacing-xs);
}

.lead {
    font-size: 1.25rem;
    line-height: 1.6;
    color: var(--color-text);
    font-style: italic;
}

.intro-text {
    margin-bottom: var(--spacing-lg);
}

/* Speaker intro section */
.speaker-intro {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: var(--spacing-lg);
    align-items: start;
    margin-bottom: var(--spacing-lg);
}

.speaker-portrait {
    position: relative;
}

.speaker-image {
    width: 100%;
    height: auto;
    aspect-ratio: 1/1;
    object-fit: cover;
    border-radius: 12px;
    border: 3px solid var(--color-primary);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.speaker-intro .intro-text {
    margin-bottom: 0;
}

/* About Page / Home Hero */
.about-section {
    padding-top: var(--spacing-sm);
}

.about-name {
    font-size: 2.5rem;
    margin-bottom: var(--spacing-md);
    color: var(--color-dark);
}

.about-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: var(--spacing-lg);
    align-items: start;
}

.about-sidebar {
    display: flex;
    flex-direction: column;
    max-width: 280px;
}

.sidebar-name {
    font-size: 2.25rem;
    margin-bottom: 0.5rem;
    color: var(--color-dark);
    text-align: right;
    max-width: 280px;
}

.about-portrait {
    width: 100%;
    max-width: 280px;
    height: auto;
    aspect-ratio: 1/1;
    object-fit: cover;
    border-radius: 12px;
    border: 3px solid var(--color-primary);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.sidebar-title {
    font-size: 0.9rem;
    color: var(--color-text-light);
    text-align: center;
    margin-top: 0.5rem;
    margin-bottom: var(--spacing-md);
    line-height: 1.4;
}

.about-image-column {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.about-image-column .profile-image {
    width: 100%;
    height: auto;
    border-radius: var(--radius-lg);
    border: 3px solid var(--color-primary);
}

/* Sidebar Cards under image */
.sidebar-cards {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.sidebar-card {
    padding: var(--spacing-sm);
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    border-left: 4px solid var(--color-primary);
}

.sidebar-card:hover {
    border-color: var(--color-primary);
    background: white;
}

.sidebar-card h3 {
    font-size: 0.95rem;
    margin: 0 0 0.25rem 0;
    color: var(--color-dark);
}

.sidebar-card p {
    font-size: 0.85rem;
    margin: 0;
    color: var(--color-text-light);
    line-height: 1.4;
}

/* Inline expertise section */
.expertise-section-inline {
    margin-top: var(--spacing-lg);
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--color-border);
}

.expertise-section-inline h2 {
    font-size: 1.25rem;
    margin-bottom: var(--spacing-md);
}

.expertise-grid-compact {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-sm);
}

.expertise-grid-compact .expertise-item {
    padding: var(--spacing-sm);
    background: var(--color-bg-alt);
    border-left: 3px solid var(--color-primary);
    border-radius: 0 4px 4px 0;
}

.expertise-grid-compact .expertise-item h4 {
    font-size: 0.9rem;
    margin: 0 0 0.25rem 0;
    color: var(--color-dark);
}

.expertise-grid-compact .expertise-item p {
    font-size: 0.8rem;
    margin: 0;
    color: var(--color-text-light);
    line-height: 1.4;
}

.about-image .profile-image {
    width: 100%;
    height: auto;
    aspect-ratio: 1/1;
    object-fit: cover;
    border-radius: 12px;
    border: 3px solid var(--color-primary);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    transition: var(--transition-base);
}

.about-image .profile-image:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
}

/* Fallback placeholder styling if image doesn't load */
.about-image .placeholder-image {
    aspect-ratio: 3/4;
    background: linear-gradient(135deg, var(--color-secondary) 0%, var(--color-dark) 100%);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    padding: var(--spacing-md);
    text-align: center;
}

.about-content p {
    margin-bottom: var(--spacing-md);
}

.expertise-section {
    margin-top: var(--spacing-xl);
    padding-top: var(--spacing-xl);
    border-top: 2px solid var(--color-border);
}

.expertise-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
}

.expertise-item {
    padding: var(--spacing-md);
    background-color: var(--color-bg-alt);
    border-radius: 8px;
    border-left: 4px solid var(--color-primary);
}

.expertise-item h3 {
    font-size: 1.125rem;
    margin-bottom: var(--spacing-xs);
}

.expertise-item p {
    font-size: 0.95rem;
    color: var(--color-text-light);
    margin-bottom: 0;
}

/* Book Page */
.book-showcase {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

.book-cover-image {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    transition: var(--transition-base);
}

.book-cover-image:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
}

/* Book Purchase Section */
.book-purchase-section {
    margin-top: var(--spacing-md);
    text-align: center;
}

.book-purchase-section h3 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--spacing-sm);
}

.purchase-platforms {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.platform-link {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: transparent;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    color: var(--color-text-light);
    cursor: pointer;
    transition: var(--transition-base);
    font-family: var(--font-sans);
    font-size: 0.75rem;
    font-weight: 500;
    text-decoration: none;
}

.platform-link:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background-color: rgba(148, 105, 77, 0.05);
}

.platform-link svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.platform-link span {
    white-space: nowrap;
}

.platform-link-wide {
    grid-column: span 2;
}

.platform-link-active {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background-color: transparent;
}

.platform-link-active:hover {
    background-color: rgba(42, 92, 130, 0.08);
}

/* Full color icons for active platform links */
.platform-link-active svg {
    fill: currentColor;
}

.platform-link-active.platform-kindle svg {
    fill: #FF9900;
}

.platform-link-active.platform-online svg {
    fill: #2a5c82;
}

.platform-link-active.platform-chat svg {
    fill: #10A37F;
}

.platform-link-active.platform-kobo svg {
    fill: #BF4045;
}
.platform-link-active.platform-google svg {
    fill: #34A853;
}

/* Compact Access Links */
.book-access-compact {
    display: flex;
    gap: 0.5rem;
    margin-top: var(--spacing-sm);
    justify-content: center;
}

.access-link {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--color-primary);
    background-color: rgba(148, 105, 77, 0.08);
    border: 1px solid var(--color-primary);
    border-radius: 6px;
    text-decoration: none;
    transition: var(--transition-base);
}

.access-link:hover {
    background-color: var(--color-primary);
    color: white;
}

.access-link svg {
    flex-shrink: 0;
}

.availability-note {
    margin-top: var(--spacing-sm);
    font-size: 0.75rem;
    color: var(--color-text-light);
    text-align: center;
}

/* Inline Publication Details (under formats) */
.publication-details-inline {
    margin-top: var(--spacing-md);
    padding-top: var(--spacing-sm);
    border-top: 1px solid var(--color-border);
    text-align: center;
}

.publication-details-inline h4 {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--color-text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}


/* Companion Resources Section */
.companion-resources {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.companion-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    text-decoration: none;
    color: var(--color-text);
    transition: all 0.2s ease;
}

.companion-link:hover {
    background: var(--color-dark);
    border-color: var(--color-primary);
    color: white;
}

.companion-link:hover .companion-desc {
    color: rgba(255,255,255,0.7);
}

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

.companion-link > svg:first-child {
    flex-shrink: 0;
    color: var(--color-primary);
}

.companion-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.companion-title {
    font-size: 0.9rem;
    font-weight: 500;
}

.companion-desc {
    font-size: 0.75rem;
    color: var(--color-text-light);
}

.companion-arrow {
    flex-shrink: 0;
    color: var(--color-text-light);
    transition: color 0.2s ease;
}
/* Key Themes Cards (in right column) */
.key-themes-cards {
    margin-bottom: var(--spacing-lg);
}

.key-themes-cards h3 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--spacing-sm);
}

.themes-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-sm);
}

.theme-card {
    background-color: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: var(--spacing-sm);
}

.theme-card h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-dark);
    margin-bottom: 0.25rem;
}

.theme-card p {
    font-size: 0.8rem;
    color: var(--color-text-light);
    line-height: 1.4;
    margin: 0;
}

/* Book Description Section */
.book-description h3 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--spacing-sm);
}

.book-description p {
    margin-bottom: var(--spacing-md);
}

.book-description p:last-child {
    margin-bottom: 0;
}

/* ISBN List Styling */
.isbn-list {
    text-align: center;
}

.isbn-list p {
    font-size: 0.75rem;
    margin: 0.25rem 0;
    color: var(--color-text);
}

.isbn-label {
    color: var(--color-text-light);
    margin-right: 0.5rem;
}

.isbn-list p:last-child {
    font-family: ui-monospace, monospace;
}

/* ===== Book Storefront ===== */

/* Pre-order banner */
.preorder-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.6rem;
    padding: 0.35rem 0.75rem;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border: 1px solid #f59e0b;
    border-radius: 6px;
    font-family: var(--font-sans);
}

.preorder-badge {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #92400e;
    background: rgba(255, 255, 255, 0.6);
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
}

.preorder-date {
    font-size: 0.68rem;
    color: #78350f;
    font-weight: 500;
}

.cart-preorder-note {
    margin: 0.5rem 0 0;
    font-size: 0.7rem;
    color: var(--color-text-light);
    text-align: center;
    line-height: 1.4;
    font-style: italic;
}

/* ===== Add-to-Cart Buttons + Cart Icon ===== */
.book-buy-direct {
    margin-top: var(--spacing-sm);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.shipping-note {
    width: 100%;
    text-align: center;
    font-size: 0.6rem;
    color: var(--color-text-light);
    margin: 0;
    line-height: 1;
}

.buy-direct-options {
    display: flex;
    gap: 0.4rem;
    justify-content: center;
}

.add-to-cart-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    font-family: var(--font-sans);
    color: var(--color-primary);
    background: transparent;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 0.45rem 0.85rem;
    cursor: pointer;
    transition: var(--transition-base);
    min-width: 72px;
    position: relative;
}

.add-to-cart-btn svg {
    flex-shrink: 0;
    opacity: 0.7;
}

.add-to-cart-btn .btn-label {
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1;
}

.add-to-cart-btn .btn-price {
    font-size: 0.58rem;
    color: var(--color-text-light);
    font-weight: 400;
    line-height: 1;
}

.add-to-cart-btn:hover {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

.add-to-cart-btn:hover svg {
    opacity: 1;
}

.add-to-cart-btn:hover .btn-price {
    color: rgba(255, 255, 255, 0.8);
}

.add-to-cart-btn.added {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

.add-to-cart-btn.added .btn-price {
    color: rgba(255, 255, 255, 0.8);
}

/* Cart icon button */
.cart-icon-btn {
    position: relative;
    background: transparent;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 0.5rem;
    cursor: pointer;
    color: var(--color-primary);
    transition: var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-icon-btn:hover {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

.cart-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #dc2626;
    color: white;
    font-size: 0.6rem;
    font-weight: 700;
    font-family: var(--font-sans);
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* ===== Cart Modal ===== */
.cart-modal-container {
    max-width: 440px;
    width: 90%;
    padding: 0;
}

.cart-modal-content {
    padding: 1.5rem;
}

.cart-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-dark);
    margin: 0 0 1rem;
    font-family: var(--font-sans);
}

/* Cart item rows */
.cart-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--color-border);
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item-icon {
    flex-shrink: 0;
    color: var(--color-primary);
    opacity: 0.7;
}

.cart-item-info {
    flex: 1;
    min-width: 0;
}

.cart-item-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--color-dark);
    font-family: var(--font-sans);
}

.cart-item-unit-price {
    font-size: 0.7rem;
    color: var(--color-text-light);
    font-family: var(--font-sans);
}

/* Quantity controls inside cart */
.cart-qty {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    flex-shrink: 0;
}

.cart-qty-btn {
    width: 22px;
    height: 22px;
    border: 1px solid var(--color-border);
    background: transparent;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75rem;
    line-height: 1;
    color: var(--color-text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: var(--transition-base);
    font-family: var(--font-sans);
}

.cart-qty-btn:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.cart-qty-value {
    font-size: 0.78rem;
    font-family: var(--font-sans);
    min-width: 1.4rem;
    text-align: center;
    color: var(--color-text);
    font-weight: 600;
}

.cart-item-total {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--color-dark);
    font-family: var(--font-sans);
    min-width: 60px;
    text-align: right;
    flex-shrink: 0;
}

.cart-item-remove {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-text-light);
    padding: 2px;
    flex-shrink: 0;
    transition: var(--transition-base);
    display: flex;
    align-items: center;
}

.cart-item-remove:hover {
    color: #dc2626;
}

/* Smart bundle suggestion banner */
.cart-suggestion {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 6px;
    padding: 0.6rem 0.75rem;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    font-family: var(--font-sans);
    color: #92400e;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.cart-suggestion-text {
    flex: 1;
    line-height: 1.4;
}

.cart-suggestion-btn {
    background: #92400e;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 0.3rem 0.6rem;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font-sans);
    white-space: nowrap;
    transition: var(--transition-base);
}

.cart-suggestion-btn:hover {
    background: #78350f;
}

/* Cart footer */
.cart-footer {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--color-border);
}

.cart-totals {
    margin-bottom: 0.75rem;
}

.cart-subtotal {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-dark);
    font-family: var(--font-sans);
}

.cart-shipping-note {
    font-size: 0.7rem;
    color: var(--color-text-light);
    font-family: var(--font-sans);
    text-align: right;
    margin-top: 0.2rem;
}

.cart-checkout-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    background: var(--color-primary);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 0.7rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: var(--transition-base);
}

.cart-checkout-btn:hover {
    opacity: 0.9;
}

.cart-checkout-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Empty cart state */
.cart-empty {
    text-align: center;
    padding: 1.5rem 0;
    color: var(--color-text-light);
}

.cart-empty svg {
    opacity: 0.3;
    margin-bottom: 0.5rem;
}

.cart-empty p {
    font-size: 0.82rem;
    font-family: var(--font-sans);
    margin: 0;
}

/* Toast notification */
.cart-toast {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--color-dark);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.78rem;
    font-family: var(--font-sans);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, transform 0.3s, visibility 0.3s;
    z-index: 10000;
    pointer-events: none;
    white-space: nowrap;
}

.cart-toast.visible {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}


/* ===== Also Available On (icon row) ===== */
.book-also-available {
    margin-top: var(--spacing-md);
    padding-top: var(--spacing-sm);
    border-top: 1px solid var(--color-border);
}

.book-also-available h3 {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.6rem;
    text-align: center;
}

.platform-icons-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.platform-icon-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: transparent;
    border: 1px solid transparent;
    transition: var(--transition-base);
    cursor: pointer;
    text-decoration: none;
    padding: 0;
    font-family: inherit;
}

.platform-icon-link:hover {
    background: rgba(148, 105, 77, 0.06);
    border-color: var(--color-border);
    transform: translateY(-2px);
}

.platform-icon-link svg {
    flex-shrink: 0;
}

/* Brand colors for each platform */
.platform-icon-link.platform-amazon { color: #FF9900; }
.platform-icon-link.platform-amazon:hover { color: #e68a00; }

.platform-icon-link.platform-apple { color: #555; }
.platform-icon-link.platform-apple:hover { color: #000; }

.platform-icon-link.platform-google { color: #34A853; }
.platform-icon-link.platform-google:hover { color: #2d9249; }

.platform-icon-link.platform-kobo { color: #BF4045; }
.platform-icon-link.platform-kobo:hover { color: #a3363a; }

.platform-icon-link.platform-read { color: var(--color-primary); }
.platform-icon-link.platform-read:hover { color: var(--color-primary-dark, #7a5a3e); }

.platform-icon-link.platform-icon-soon {
    opacity: 0.35;
    cursor: default;
}

.platform-icon-link.platform-icon-soon:hover {
    opacity: 0.5;
    background: transparent;
    border-color: transparent;
    transform: none;
}

/* ===== Order Success Page ===== */
.success-page {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
    padding: var(--spacing-lg) 0;
}

.success-icon {
    margin-bottom: var(--spacing-sm);
}

.success-page h1 {
    font-size: 1.6rem;
    color: var(--color-dark);
    margin-bottom: 0.5rem;
}

.success-subtitle {
    font-size: 1rem;
    color: var(--color-text-light);
    margin-bottom: var(--spacing-md);
}

.success-download-card,
.success-shipping-card {
    text-align: left;
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: 1.25rem;
    margin-bottom: var(--spacing-sm);
}

.success-download-card h3,
.success-shipping-card h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    color: var(--color-dark);
    margin-bottom: 0.75rem;
}

.success-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--color-primary);
    color: white;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 8px;
    transition: var(--transition-base);
}

.success-download-btn:hover {
    background: var(--color-primary-dark);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(148, 105, 77, 0.25);
}

.success-download-note {
    font-size: 0.8rem;
    color: var(--color-text-light);
    margin-top: 0.75rem;
}

.success-resources {
    margin-top: var(--spacing-md);
    text-align: left;
}

.success-resources h3 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
}

.success-resource-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.success-resource-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--color-light);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    text-decoration: none;
    color: var(--color-text);
    font-size: 0.9rem;
    transition: var(--transition-base);
}

.success-resource-link:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.success-resource-link svg {
    flex-shrink: 0;
    color: var(--color-primary);
}

.success-back-link {
    display: inline-block;
    margin-top: var(--spacing-md);
    color: var(--color-primary);
    text-decoration: none;
    font-size: 0.9rem;
}

.success-back-link:hover {
    text-decoration: underline;
}

/* Fallback for placeholder if needed */
.book-cover .placeholder-image {
    aspect-ratio: 2/3;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    padding: var(--spacing-md);
    text-align: center;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.book-details h2 {
    margin-top: var(--spacing-md);
    margin-bottom: var(--spacing-sm);
}

.book-meta {
    background-color: var(--color-bg-alt);
    padding: var(--spacing-md);
    border-radius: 8px;
    margin-bottom: var(--spacing-md);
}

.book-meta p {
    margin-bottom: var(--spacing-xs);
    font-size: 0.95rem;
}

.book-meta .book-tagline {
    font-weight: 500;
    color: var(--color-dark);
    margin-bottom: var(--spacing-sm);
}

.book-cta {
    display: flex;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-md);
}

.book-release {
    background-color: var(--color-bg-alt);
    padding: var(--spacing-md);
    border-radius: 8px;
    border-left: 4px solid var(--color-primary);
    margin-top: var(--spacing-md);
}

.book-release h3 {
    color: var(--color-primary);
    margin-bottom: var(--spacing-sm);
}

.book-release .release-date {
    font-size: 1.125rem;
    color: var(--color-secondary);
    margin-bottom: var(--spacing-sm);
}

.book-release p:last-child {
    margin-bottom: 0;
    color: var(--color-text-light);
}

.book-highlights {
    margin-top: var(--spacing-xl);
    padding-top: var(--spacing-xl);
    border-top: 2px solid var(--color-border);
}

.highlights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
}

.highlight-item {
    padding: var(--spacing-md);
    background-color: var(--color-bg-alt);
    border-radius: 8px;
}

.highlight-item h3 {
    font-size: 1.125rem;
    color: var(--color-primary);
    margin-bottom: var(--spacing-xs);
}

.highlight-item p {
    font-size: 0.95rem;
    color: var(--color-text-light);
    margin-bottom: 0;
}

/* Publication Details */
.publication-details {
    margin-top: var(--spacing-xl);
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--color-border);
}

.publication-details h3 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--spacing-sm);
}

.publication-details dl {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.25rem 1rem;
    font-size: 0.9rem;
    max-width: 320px;
}

.publication-details dt {
    color: var(--color-text-light);
}

.publication-details dd {
    margin: 0;
    color: var(--color-text);
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Monaco, Consolas, monospace;
    font-size: 0.85rem;
}

/* Book Access Section */
.book-access-section {
    margin-top: var(--spacing-lg);
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--color-border);
}

.book-access-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
}

.book-access-cards.full-width {
    margin-top: 0;
}

.book-access-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md) var(--spacing-lg);
    background-color: var(--color-bg-alt);
    border: 2px solid var(--color-border);
    border-radius: 12px;
    text-decoration: none;
    transition: var(--transition-base);
    cursor: pointer;
}

.book-access-card:hover {
    border-color: var(--color-primary);
    background-color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(148, 105, 77, 0.15);
}

.book-access-icon {
    width: 56px;
    height: 56px;
    min-width: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(148, 105, 77, 0.1);
    border-radius: 12px;
    color: var(--color-primary);
    transition: var(--transition-base);
}

.book-access-card:hover .book-access-icon {
    background-color: var(--color-primary);
    color: white;
}

.book-access-text {
    flex: 1;
}

.book-access-card h3 {
    font-size: 1.125rem;
    color: var(--color-dark);
    margin-bottom: 0.25rem;
}

.book-access-card:hover h3 {
    color: var(--color-primary);
}

.book-access-card p {
    font-size: 0.9rem;
    color: var(--color-text-light);
    margin-bottom: 0;
    line-height: 1.4;
}

.book-access-note {
    margin-top: var(--spacing-md);
    font-size: 0.9rem;
    color: var(--color-text-light);
    text-align: center;
}

/* Speaking Page */
.topics-section {
    margin: var(--spacing-xl) 0;
}

.topics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
}

.topic-card {
    padding: var(--spacing-md);
    background-color: white;
    border: 2px solid var(--color-border);
    border-radius: 8px;
    transition: var(--transition-base);
}

.topic-card:hover {
    border-color: var(--color-primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.topic-card h3 {
    color: var(--color-primary);
    margin-bottom: var(--spacing-sm);
}

.topic-card p {
    color: var(--color-text-light);
    margin-bottom: 0;
    font-size: 0.95rem;
}

.services-section {
    margin: var(--spacing-xl) 0;
    padding: var(--spacing-lg);
    background-color: var(--color-bg-alt);
    border-radius: 8px;
}

.services-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
}

.service-item {
    background-color: white;
    padding: var(--spacing-md);
    border-radius: 8px;
    border-left: 4px solid var(--color-primary);
}

.service-item h3 {
    font-size: 1.125rem;
    margin-bottom: var(--spacing-xs);
}

.service-item p {
    font-size: 0.95rem;
    color: var(--color-text-light);
    margin-bottom: 0;
}

.cta-section {
    text-align: center;
    margin-top: var(--spacing-xl);
    padding: var(--spacing-lg);
    background: linear-gradient(135deg, var(--color-secondary) 0%, var(--color-dark) 100%);
    border-radius: 8px;
    color: white;
}

.cta-section h2 {
    color: white;
    margin-bottom: var(--spacing-sm);
}

.cta-section p {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: var(--spacing-md);
    font-size: 1.125rem;
}

/* Articles Page */
.articles-section {
    margin-bottom: var(--spacing-xl);
}

.article-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
}

.article-card {
    padding: var(--spacing-md);
    background-color: white;
    border: 1px solid var(--color-border);
    border-left: 4px solid var(--color-primary);
    border-radius: 8px;
    transition: var(--transition-base);
}

.article-card.featured {
    background-color: var(--color-bg-alt);
    border-left-width: 6px;
}

.article-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateX(4px);
}

.article-meta {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
    margin-bottom: var(--spacing-xs);
    align-items: center;
}

.article-type {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-primary);
    background-color: rgba(148, 105, 77, 0.1);
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.article-date {
    font-size: 0.875rem;
    color: var(--color-text-light);
}

.article-publisher {
    font-size: 0.875rem;
    color: var(--color-primary);
    font-weight: 500;
}

.article-card h3 {
    font-size: 1.5rem;
    margin-bottom: var(--spacing-sm);
}

.article-card p {
    color: var(--color-text-light);
    margin-bottom: var(--spacing-sm);
}

.article-link {
    color: var(--color-primary);
    font-weight: 500;
    display: inline-flex;
    align-items: center;
}

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

.media-section {
    margin: var(--spacing-xl) 0;
}

.media-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
}

.media-card {
    padding: var(--spacing-md);
    background-color: var(--color-bg-alt);
    border-radius: 8px;
    border-left: 4px solid var(--color-primary);
}

.media-card.featured {
    background-color: white;
    border-left: 4px solid var(--color-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.media-type {
    display: inline-block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-primary);
    background-color: rgba(148, 105, 77, 0.1);
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    margin-bottom: var(--spacing-sm);
}

.media-meta {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
    margin-top: var(--spacing-xs);
    margin-bottom: var(--spacing-sm);
}

.media-date {
    font-size: 0.875rem;
    color: var(--color-text-light);
}

.media-publisher {
    font-size: 0.875rem;
    color: var(--color-primary);
    font-weight: 500;
}

.media-card h3 {
    font-size: 1.25rem;
    margin-bottom: var(--spacing-sm);
}

.media-card p {
    color: var(--color-text-light);
    margin-bottom: var(--spacing-sm);
    font-size: 0.95rem;
}

.media-links {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
    margin-top: var(--spacing-md);
}

.media-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    background-color: var(--color-bg-alt);
    color: var(--color-primary);
    font-weight: 500;
    font-size: 0.95rem;
    border-radius: 6px;
    transition: var(--transition-base);
    border: 1px solid var(--color-border);
}

.media-link:hover {
    background-color: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(148, 105, 77, 0.2);
}

.media-link svg {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.media-link span {
    white-space: nowrap;
}

.newsletter-section {
    text-align: center;
    margin-top: var(--spacing-xl);
    padding: var(--spacing-lg);
    background-color: var(--color-bg-alt);
    border-radius: 8px;
}

.newsletter-section h2 {
    margin-bottom: var(--spacing-sm);
}

.newsletter-section p {
    margin-bottom: var(--spacing-md);
    font-size: 1.125rem;
}

/* Contact Page */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: var(--spacing-lg);
}

.contact-info h2 {
    margin-bottom: var(--spacing-md);
}

.contact-methods {
    margin-top: var(--spacing-lg);
}

.contact-method {
    margin-bottom: var(--spacing-lg);
}

.contact-method h3 {
    font-size: 1.125rem;
    margin-bottom: var(--spacing-xs);
}

.contact-method p {
    color: var(--color-text-light);
    margin-bottom: var(--spacing-xs);
}

.contact-link {
    color: var(--color-primary);
    font-weight: 500;
}

.contact-link:hover {
    color: var(--color-primary-dark);
    text-decoration: underline;
}

/* Contact Form */
.contact-form-container {
    background-color: var(--color-bg-alt);
    padding: var(--spacing-md);
    border-radius: 8px;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 500;
    margin-bottom: var(--spacing-xs);
    color: var(--color-dark);
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 0.75rem;
    font-size: 1rem;
    font-family: var(--font-sans);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    transition: var(--transition-base);
    background-color: white;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(148, 105, 77, 0.1);
}

.form-group textarea {
    resize: vertical;
}

.form-status {
    margin-top: var(--spacing-sm);
    padding: var(--spacing-sm);
    border-radius: 6px;
    display: none;
}

.form-status.success {
    display: block;
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #10b981;
}

.form-status.error {
    display: block;
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #ef4444;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(30, 41, 59, 0.7);
    backdrop-filter: blur(4px);
}

.modal-container {
    position: relative;
    background-color: white;
    border-radius: 16px;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.2);
    max-width: 420px;
    width: calc(100% - 2rem);
    padding: var(--spacing-lg);
    transform: scale(0.95) translateY(10px);
    transition: transform 0.3s ease;
}

.modal.active .modal-container {
    transform: scale(1) translateY(0);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: var(--color-text-light);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: var(--transition-base);
}

.modal-close:hover {
    background-color: var(--color-bg-alt);
    color: var(--color-dark);
}

.modal-content {
    text-align: center;
}

.modal-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    background-color: rgba(148, 105, 77, 0.1);
    border-radius: 50%;
    color: var(--color-primary);
    margin-bottom: var(--spacing-md);
}

.modal-content h2 {
    font-size: 1.75rem;
    color: var(--color-dark);
    margin-bottom: var(--spacing-xs);
}

.modal-platform {
    font-size: 1rem;
    color: var(--color-primary);
    font-weight: 500;
    margin-bottom: var(--spacing-md);
}

.modal-description {
    font-size: 1rem;
    color: var(--color-text);
    line-height: 1.6;
    margin-bottom: var(--spacing-md);
}

.modal-description strong {
    color: var(--color-dark);
}

.modal-note {
    font-size: 0.9rem;
    color: var(--color-text-light);
    line-height: 1.6;
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--color-border);
}

.modal-note a {
    color: var(--color-primary);
    font-weight: 500;
}

.modal-note a:hover {
    text-decoration: underline;
}

/* Footer - minimal, infrastructure feel */
.footer {
    background-color: transparent;
    color: var(--color-text-light);
    padding: var(--spacing-sm) 0;
    margin-top: auto;
    border-top: 1px solid var(--color-border);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
}

.footer p {
    margin: 0;
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--color-text-light);
}

.footer-social {
    display: flex;
    gap: var(--spacing-xs);
}

.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    background-color: transparent;
    color: var(--color-text-light);
    transition: color 0.2s ease;
}

.social-link svg {
    width: 18px;
    height: 18px;
}

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

/* Navigation collapse at wider breakpoint to fit all items */
@media (max-width: 960px) {
    .nav-toggle {
        display: flex;
    }

    .nav-menu {
        position: absolute;
        top: 70px;
        left: 0;
        right: 0;
        background-color: white;
        flex-direction: column;
        gap: 0;
        padding: 0;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }

    .nav-menu.active {
        max-height: 400px;
        border-bottom: 1px solid var(--color-border);
    }

    .nav-menu li {
        border-bottom: 1px solid var(--color-border);
    }

    .nav-menu li:last-child {
        border-bottom: none;
    }

    .nav-link {
        display: block;
        padding: var(--spacing-sm) var(--spacing-md);
        font-size: 1rem;
        width: 100%;
    }

    .nav-link:hover,
    .nav-link.active {
        background-color: var(--color-bg-alt);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-portrait {
        max-width: 120px;
    }
    
    .hero-quote {
        font-size: 1.5rem;
    }
    
    .hero-description {
        font-size: 1.125rem;
    }
    
    .hero-cta {
        flex-direction: column;
    }
    
    .feature-grid,
    .expertise-grid,
    .highlights-grid,
    .topics-grid,
    .services-list,
    .media-grid {
        grid-template-columns: 1fr;
    }
    
    .about-grid,
    .book-showcase,
    .contact-grid {
        grid-template-columns: 1fr;
    }
    
    .about-sidebar {
        max-width: 250px;
        margin: 0 auto;
    }
    
    .about-portrait {
        max-width: 250px;
    }
    
    .expertise-grid-compact {
        grid-template-columns: 1fr;
    }
    
    .sidebar-cards {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .sidebar-card {
        flex: 1;
        min-width: 140px;
    }
    
    .speaker-intro {
        grid-template-columns: 1fr;
        text-align: center;
        gap: var(--spacing-md);
    }
    
    .speaker-portrait {
        max-width: 200px;
        margin: 0 auto;
    }
    
    .mission-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: var(--spacing-md);
    }
    
    .mission-portrait {
        max-width: 200px;
        margin: 0 auto;
    }
    
    .mission-text-wrapper {
        text-align: center;
    }
    
    .mission-quote::before {
        display: none;
    }
    
    .book-cta {
        flex-direction: column;
    }
    
    .book-access-cards {
        grid-template-columns: 1fr;
    }
    
    .book-access-card {
        padding: var(--spacing-md);
    }
    
    .themes-grid {
        grid-template-columns: 1fr;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.75rem;
    }
}

@media (max-width: 480px) {
    :root {
        --spacing-lg: 3rem;
        --spacing-xl: 4rem;
    }
    
    .nav-brand span {
        display: none;
    }
    
    .nav-logo {
        width: 36px;
        height: 36px;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
}


/* ============================================
   ARTICLES TIMELINE VIEW - v2
   ============================================ */

/* Page layout for articles timeline */
.articles-timeline-page {
    padding-top: var(--spacing-lg);
}


/* Media Page Introduction */
.media-intro {
    text-align: center;
    margin-bottom: var(--spacing-lg);
}

.media-intro h1 {
    font-size: 2.5rem;
    margin-bottom: var(--spacing-sm);
}

.media-intro p {
    color: var(--color-text-light);
    font-size: 1.1rem;
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.7;
}
.articles-timeline-page .container {
    max-width: 1000px;
}

/* Coverage Map Section - Expanded */
.coverage-map-section {
    margin-bottom: var(--spacing-sm);
}

.coverage-map {
    width: 100%;
    height: 380px;
    border-radius: 12px;
    overflow: hidden;
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border);
}

.map-hint {
    text-align: center;
    font-size: 0.75rem;
    color: var(--color-text-light);
    margin-top: 0.5rem;
    font-style: italic;
}

/* Leaflet tooltip styling */
.region-tooltip {
    background: white !important;
    border: 1px solid var(--color-border) !important;
    border-radius: 6px !important;
    color: var(--color-dark) !important;
    font-family: var(--font-sans);
    font-size: 0.8rem;
    padding: 0.375rem 0.625rem !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
}

.region-tooltip::before {
    display: none !important;
}

/* ============================================
   TIMELINE VIEW - Clean Consolidated Styles
   ============================================ */

/* Compact Timeline Section */
.timeline-section.compact {
    margin-bottom: var(--spacing-sm);
    background: var(--color-bg-alt);
    border-radius: 8px;
    padding: 0.5rem 0;
}

.timeline-viewport {
    position: relative;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    scrollbar-color: var(--color-border) transparent;
}

.timeline-viewport::-webkit-scrollbar {
    height: 4px;
}

.timeline-viewport::-webkit-scrollbar-track {
    background: transparent;
}

.timeline-viewport::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 2px;
}

/* Timeline Track */
.timeline-track {
    position: relative;
    padding: 0.5rem 30px 2.5rem 30px;
    min-height: 80px;
    width: 100%;
    box-sizing: border-box;
}

/* Timeline Line */
.timeline-line {
    position: absolute;
    bottom: 1rem;
    left: 30px;
    right: 30px;
    height: 2px;
    background: var(--color-primary);
    opacity: 0.3;
    border-radius: 1px;
    z-index: 0;
}

/* 1/3 marker on timeline */
.timeline-line::before {
    content: '';
    position: absolute;
    left: 33.333%;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 10px;
    background: var(--color-primary);
    border-radius: 2px;
    opacity: 0.6;
}

/* Timeline Nodes */
.timeline-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    position: absolute;
    z-index: 1;
    transition: all 0.2s ease;
    font-family: var(--font-sans);
    top: 0;
}

.timeline-node:focus {
    outline: none;
}

.timeline-node:focus-visible .node-publisher-icon {
    box-shadow: 0 0 0 2px rgba(148, 105, 77, 0.3);
}

/* Publisher Icon - Profile Image Style */
.node-publisher-icon {
    width: 40px;
    height: 40px;
    background: white;
    border: 2px solid var(--color-border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    position: relative;
    overflow: visible;
    padding: 0;
}

/* Publisher favicon - fills circle */
.publisher-favicon {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

/* Publisher initials fallback */
.publisher-initials {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-text-light);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Type Badge - LinkedIn style */
.node-type-badge {
    position: absolute;
    bottom: -4px;
    right: -4px;
    width: 18px;
    height: 18px;
    background: white;
    border: 2px solid white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-light);
    transition: all 0.2s ease;
    z-index: 2;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.node-type-badge svg {
    width: 10px;
    height: 10px;
}

/* Node Date */
.node-date {
    font-size: 0.6rem;
    font-weight: 500;
    color: var(--color-text-light);
    white-space: nowrap;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 0.5rem;
}

/* Hover State */
.timeline-node:hover .node-publisher-icon {
    border-color: var(--color-primary);
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(148, 105, 77, 0.2);
}

.timeline-node:hover .node-type-badge {
    border-color: var(--color-primary);
    color: var(--color-primary);
    box-shadow: 0 2px 6px rgba(148, 105, 77, 0.3);
}

/* Active State */
.timeline-node.active .node-publisher-icon {
    border-color: var(--color-primary);
    transform: scale(1.15);
    box-shadow: 0 3px 12px rgba(148, 105, 77, 0.4);
}

.timeline-node.active .publisher-initials {
    color: var(--color-primary);
}

.timeline-node.active .node-type-badge {
    background: white;
    border-color: var(--color-primary);
    color: var(--color-primary);
    box-shadow: 0 2px 8px rgba(148, 105, 77, 0.4);
}

.timeline-node.active .node-date {
    color: var(--color-primary);
    font-weight: 600;
}

/* Older items (outside 3-month window) */
.timeline-node.older .node-publisher-icon {
    opacity: 0.5;
}

.timeline-node.older:hover .node-publisher-icon {
    opacity: 1;
}

/* Article Display Section */
.article-display-section {
    margin-top: var(--spacing-md);
    position: relative;
}

.article-nav-wrapper {
    position: relative;
    width: 100%;
}

.article-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border: 2px solid var(--color-border);
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--color-text-light);
    z-index: 10;
}

.article-nav-prev {
    left: calc(-1 * var(--spacing-md) - 60px);
}

.article-nav-next {
    right: calc(-1 * var(--spacing-md) - 60px);
}

.article-nav:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    transform: translateY(-50%) scale(1.1);
}

.article-nav:active {
    transform: translateY(-50%) scale(0.95);
}

.article-nav svg {
    width: 24px;
    height: 24px;
}

.article-card-display {
    width: 100%;
    min-height: 200px;
}

.article-card-display .article-card {
    animation: fadeInUp 0.4s ease;
}

.article-card-display.animate .article-card {
    animation: fadeInUp 0.4s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Article Card Header */
.article-card-header {
    display: flex;
    gap: var(--spacing-sm);
    align-items: center;
    margin-bottom: var(--spacing-sm);
    flex-wrap: wrap;
}

.article-type-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-primary);
    background-color: rgba(148, 105, 77, 0.1);
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.article-title {
    font-size: 1.25rem;
    margin-bottom: var(--spacing-xs);
}

.article-description {
    color: var(--color-text-light);
    margin-bottom: var(--spacing-sm);
    line-height: 1.6;
}

.article-link-primary {
    display: inline-block;
    color: var(--color-primary);
    font-weight: 500;
    margin-top: var(--spacing-xs);
}

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

/* Article Links */
.article-links {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
    margin-top: var(--spacing-sm);
}

/* Timeline Legend */
.timeline-legend {
    display: flex;
    justify-content: center;
    gap: var(--spacing-md);
    flex-wrap: wrap;
    margin-top: var(--spacing-md);
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--color-border);
}

.timeline-legend .legend-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    color: var(--color-text-light);
}

.timeline-legend .legend-icon {
    width: 20px;
    height: 20px;
    background: var(--color-bg-alt);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-primary);
}

.timeline-legend .legend-icon svg {
    width: 12px;
    height: 12px;
}

/* Leaflet Map Styles */
.coverage-map {
    height: 300px;
    width: 100%;
    border-radius: 8px;
    background: #f8f9fa;
}

.region-tooltip {
    background: white;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    font-family: var(--font-sans);
    font-size: 0.85rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Timeline Responsive */
@media (max-width: 768px) {
    .article-nav-wrapper {
        padding: 0 60px;
    }
    
    .article-nav {
        width: 40px;
        height: 40px;
    }
    
    .article-nav-prev {
        left: 0;
    }
    
    .article-nav-next {
        right: 0;
    }
    
    .article-nav svg {
        width: 20px;
        height: 20px;
    }
    
    .article-card-display {
        max-width: 100%;
    }
    
    .coverage-map {
        height: 250px;
    }
    
    .timeline-track {
        padding: 0.5rem 20px 2.5rem 20px;
    }
    
    .timeline-line {
        left: 20px;
        right: 20px;
    }
    
    .node-publisher-icon {
        width: 36px;
        height: 36px;
    }
    
    .node-type-badge {
        width: 16px;
        height: 16px;
    }
    
    .node-type-badge svg {
        width: 8px;
        height: 8px;
    }
}

@media (max-width: 480px) {
    .article-nav-wrapper {
        padding: 0 50px;
    }
    
    .article-nav {
        width: 36px;
        height: 36px;
    }
    
    .article-nav-prev {
        left: 0;
    }
    
    .article-nav-next {
        right: 0;
    }
    
    .article-nav svg {
        transform: none;
    }
    
    .timeline-legend {
        gap: 0.5rem;
    }
    
    .timeline-legend .legend-item {
        font-size: 0.65rem;
        gap: 0.25rem;
    }
    
    .coverage-map {
        height: 200px;
    }
}

/* ============================================
   PROJECTS PAGE
   ============================================ */

/* Projects Hero */
.projects-hero {
    background: linear-gradient(135deg, var(--color-bg) 0%, var(--color-bg-alt) 100%);
    padding: var(--spacing-lg) 0;
    text-align: center;
}

.projects-hero h1 {
    font-size: 2.5rem;
    margin-bottom: var(--spacing-xs);
}

.projects-hero .hero-description {
    color: var(--color-text-light);
    font-size: 1.05rem;
    max-width: 500px;
    margin: 0 auto;
}

/* Projects List - Compact Cards */
.projects-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    max-width: 800px;
    margin: 0 auto;
}

.project-card-compact {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md) var(--spacing-lg);
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid var(--color-border);
    transition: var(--transition-base);
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    text-align: left;
    width: 100%;
}

.project-card-compact:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border-color: var(--color-primary);
    transform: translateY(-2px);
}

.project-icons {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.project-icons .icon-chatgpt {
    width: 32px;
    height: 32px;
    color: #10a37f;
}

.project-icons .icon-matrix {
    width: 32px;
    height: 32px;
    color: var(--color-primary);
}

.project-icons .icon-book {
    width: 28px;
    height: 28px;
    color: var(--color-primary);
}

.project-icons .icon-plus {
    font-size: 1rem;
    color: var(--color-text-light);
    font-weight: 300;
}

.project-info {
    flex: 1;
    min-width: 0;
}

.project-info h2 {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
    line-height: 1.3;
}

.project-info h2 em {
    font-style: italic;
    color: var(--color-primary);
}

.project-info p {
    color: var(--color-text-light);
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0;
}

.project-action {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-bg-alt);
    border-radius: 8px;
    transition: var(--transition-base);
}

.project-action svg {
    width: 20px;
    height: 20px;
    color: var(--color-text-light);
    transition: var(--transition-base);
}

.project-card-compact:hover .project-action {
    background: var(--color-primary);
}

.project-card-compact:hover .project-action svg {
    color: white;
}

@media (max-width: 600px) {
    .project-card-compact {
        flex-direction: column;
        padding: var(--spacing-md);
        gap: var(--spacing-sm);
    }
    
    .project-info {
        order: 1;
        width: 100%;
    }
    
    .project-info h2 {
        font-size: 1.1rem;
    }
    
    .project-info p {
        font-size: 0.85rem;
    }
    
    .project-icons {
        order: 2;
        gap: 0.4rem;
    }
    
    .project-icons .icon-chatgpt,
    .project-icons .icon-matrix {
        width: 20px;
        height: 20px;
    }
    
    .project-icons .icon-book {
        width: 18px;
        height: 18px;
    }
    
    .project-icons .icon-plus {
        font-size: 0.75rem;
    }
    
    .project-action {
        order: 3;
        align-self: flex-end;
        width: 32px;
        height: 32px;
        margin-top: -2rem;
    }
}

/* Crosswalk Modal */
.crosswalk-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.crosswalk-modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.modal-container {
    position: relative;
    background: white;
    border-radius: 12px;
    width: 98vw;
    max-width: none;
    height: 96vh;
    max-height: none;
    margin: 2vh 1vw;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.2);
    transform: scale(0.98) translateY(10px);
    transition: transform 0.3s ease;
}

.crosswalk-modal.active .modal-container {
    transform: scale(1) translateY(0);
}

.modal-header {
    padding: var(--spacing-md) var(--spacing-lg);
    border-bottom: 1px solid var(--color-border);
    position: relative;
}

.modal-header h2 {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.modal-subtitle {
    color: var(--color-text-light);
    font-size: 0.95rem;
    margin: 0;
}

.modal-close {
    position: absolute;
    top: var(--spacing-md);
    right: var(--spacing-md);
    width: 40px;
    height: 40px;
    border: none;
    background: var(--color-bg-alt);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-base);
}

.modal-close:hover {
    background: var(--color-primary);
    color: white;
}

.modal-close svg {
    width: 20px;
    height: 20px;
}

.modal-close-floating {
    position: fixed;
    top: 0.75rem;
    right: 0.75rem;
    z-index: 1010;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.modal-body {
    flex: 1;
    overflow: auto;
    padding: var(--spacing-sm) var(--spacing-md) var(--spacing-md);
}

.modal-body .table-controls {
    position: sticky;
    top: 0;
    background: white;
    padding-bottom: var(--spacing-sm);
    z-index: 10;
    margin-bottom: var(--spacing-sm);
}

.modal-body .crosswalk-table-container {
    max-height: none;
}

.modal-footer-links {
    margin-top: var(--spacing-md);
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--color-border);
    text-align: center;
}

.explore-full-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-primary);
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition-base);
}

.explore-full-link:hover {
    color: var(--color-primary-dark);
    text-decoration: underline;
}

/* Loading spinner */
.loading-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: inline-block;
    margin-right: 8px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Projects page responsive */
@media (max-width: 768px) {
    .projects-hero h1 {
        font-size: 2.25rem;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-container {
        width: 100vw;
        height: 100vh;
        max-height: none;
        border-radius: 0;
    }
    
    .modal-header {
        padding: var(--spacing-sm) var(--spacing-md);
    }
    
    .modal-body {
        padding: var(--spacing-sm) var(--spacing-md) var(--spacing-md);
    }
    
    .modal-body .table-controls {
        flex-direction: column;
        gap: var(--spacing-xs);
    }
}


/* Crosswalk Table (for modal) */
.crosswalk-table-container {
    overflow-x: auto;
    background: white;
    border: 1px solid var(--color-border);
    border-radius: 12px;
}

.crosswalk-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.crosswalk-table th {
    background: var(--color-bg-alt);
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--color-dark);
    white-space: nowrap;
}

.crosswalk-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--color-border);
    vertical-align: top;
}

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

.crosswalk-table tr:hover td {
    background: var(--color-bg-alt);
}

.crosswalk-table td a {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 500;
}

.crosswalk-table td a:hover {
    text-decoration: underline;
}

.crosswalk-table td a svg {
    width: 12px;
    height: 12px;
    opacity: 0.6;
}

.table-count {
    text-align: center;
    color: var(--color-text-light);
    font-size: 0.9rem;
    margin-top: var(--spacing-sm);
}

/* Table Controls */
.table-controls {
    display: flex;
    gap: var(--spacing-md);
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: var(--spacing-md);
}

.search-box {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--color-bg-alt);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    flex: 1;
    min-width: 200px;
}

.search-box svg {
    width: 18px;
    height: 18px;
    color: var(--color-text-light);
}

.search-box input {
    border: none;
    background: none;
    outline: none;
    width: 100%;
    font-size: 0.95rem;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-group label {
    font-size: 0.9rem;
    color: var(--color-text-light);
}

.filter-group select {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background: white;
    font-size: 0.9rem;
}


/* View Toggle */
.view-toggle {
    display: flex;
    gap: 0.5rem;
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    border-bottom: 1px solid var(--color-border);
}

.view-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-size: 0.875rem;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.view-btn:hover {
    background: var(--color-background);
    border-color: var(--color-primary);
    color: var(--color-text);
}

.view-btn.active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: white;
}

.view-btn svg {
    flex-shrink: 0;
}

.filter-set {
    display: flex;
    gap: var(--spacing-sm);
}

/* Book View Table Styles */
.chapter-cell {
    min-width: 180px;
    font-weight: 500;
}

.control-cell {
    min-width: 200px;
}

.argument-cell {
    max-width: 400px;
}

.guidance-cell {
    max-width: 300px;
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

/* Relevance Badges */
.relevance-badge {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-right: 0.5rem;
    vertical-align: middle;
}

.relevance-high {
    background: #dcfce7;
    color: #166534;
}

.relevance-medium {
    background: #fef9c3;
    color: #854d0e;
}

.relevance-low {
    background: #f3f4f6;
    color: #6b7280;
}

/* Mapping Quotes */
.mapping-quote {
    margin: 0.5rem 0 0 0;
    padding: 0.5rem 0.75rem;
    border-left: 3px solid var(--color-primary);
    background: var(--color-surface);
    font-size: 0.8rem;
    font-style: italic;
    color: var(--color-text-muted);
    line-height: 1.4;
}

/* ============================================
   NIST AI RMF Crosswalk - Visual Map Styles
   ============================================ */

.crosswalk-map-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--spacing-md);
}

.modal-header-content {
    flex: 1;
}

.modal-header-content h2 {
    font-size: 1.35rem;
    margin: 0 0 0.25rem 0;
}

.modal-header-content .modal-subtitle {
    font-size: 0.9rem;
    color: var(--color-text-light);
    margin: 0;
}

.modal-search-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem var(--spacing-lg);
    background: var(--color-bg-alt);
    border-bottom: 1px solid var(--color-border);
}

.modal-search-bar svg {
    width: 18px;
    height: 18px;
    color: var(--color-text-light);
    flex-shrink: 0;
}

.modal-search-bar input {
    flex: 1;
    border: none;
    background: none;
    outline: none;
    font-size: 1rem;
    color: var(--color-text);
}

.modal-search-bar input::placeholder {
    color: var(--color-text-light);
}

.search-count {
    font-size: 0.85rem;
    color: var(--color-text-light);
    white-space: nowrap;
}

.crosswalk-map-body {
    display: flex;
    overflow: hidden;
    padding: 0 !important;
}

.crosswalk-map {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-md) var(--spacing-lg);
}

/* Chapter Cards */
.map-chapter {
    background: white;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    margin-bottom: var(--spacing-sm);
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}

.map-chapter:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.chapter-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md);
    cursor: pointer;
    background: var(--color-bg-alt);
    border-bottom: 1px solid transparent;
    transition: background 0.2s ease;
}

.chapter-header:hover {
    background: #e2e8f0;
}

.map-chapter.expanded .chapter-header {
    border-bottom-color: var(--color-border);
}

.chapter-toggle {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.chapter-toggle svg {
    width: 16px;
    height: 16px;
    color: var(--color-text-light);
}

.map-chapter.expanded .chapter-toggle {
    transform: rotate(90deg);
}

.chapter-info {
    flex: 1;
}

.chapter-number {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.chapter-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0.125rem 0 0 0;
    color: var(--color-dark);
}

.chapter-badge {
    font-size: 0.75rem;
    color: var(--color-text-light);
    background: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    white-space: nowrap;
}

.chapter-content {
    display: none;
    padding: var(--spacing-sm) var(--spacing-md) var(--spacing-md);
}

.map-chapter.expanded .chapter-content {
    display: block;
}

/* Section Cards */
.map-section {
    background: white;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: var(--spacing-sm) var(--spacing-md);
    margin-bottom: var(--spacing-xs);
}

.map-section:last-child {
    margin-bottom: 0;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-xs);
}

.section-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--color-dark);
}

.section-book-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    color: var(--color-text-light);
    border-radius: 4px;
    transition: all 0.2s ease;
}

.section-book-link:hover {
    background: var(--color-bg-alt);
    color: var(--color-primary);
}

/* Control Groups */
.control-groups {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
}

.control-group {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.control-group-label {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--func-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.control-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.control-chip {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
    color: var(--color-text);
}

.control-chip:hover {
    background: var(--func-color);
    border-color: var(--func-color);
    color: white;
    transform: translateY(-1px);
}

.control-chip.relevance-high {
    background: #dcfce7;
    border-color: #86efac;
}

.control-chip.relevance-high:hover {
    background: #166534;
    border-color: #166534;
}

.control-chip.relevance-medium {
    background: #fef9c3;
    border-color: #fde047;
}

.control-chip.relevance-medium:hover {
    background: #854d0e;
    border-color: #854d0e;
}

/* Detail Panel */
.control-detail-panel {
    width: 0;
    min-width: 0;
    overflow: hidden;
    background: white;
    border-left: 1px solid var(--color-border);
    transition: width 0.3s ease, min-width 0.3s ease;
    display: flex;
    flex-direction: column;
}

.control-detail-panel.active {
    width: 480px;
    min-width: 480px;
}

.detail-panel-close {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: var(--spacing-xs) var(--spacing-sm);
    background: var(--color-bg-alt);
    border: none;
    border-bottom: 1px solid var(--color-border);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text);
    transition: background 0.2s ease;
    width: 100%;
    text-align: left;
}

.detail-panel-close:hover {
    background: #e2e8f0;
}

.detail-panel-close svg {
    width: 16px;
    height: 16px;
}

.detail-panel-content {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-sm);
}

/* Detail Header */
.detail-header {
    padding-bottom: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--color-border);
}

.detail-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8rem;
    color: var(--color-text-light);
    margin-bottom: 0.5rem;
}

.detail-breadcrumb svg {
    color: var(--color-border);
}

.detail-control-id {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--func-color);
    margin: 0 0 0.25rem 0;
}

.detail-control-name {
    font-size: 0.95rem;
    color: var(--color-text);
    margin: 0 0 0.75rem 0;
    line-height: 1.4;
}

.detail-relevance {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
}

.detail-relevance.relevance-high {
    background: #dcfce7;
    color: #166534;
}

.detail-relevance.relevance-medium {
    background: #fef9c3;
    color: #854d0e;
}

.detail-relevance.relevance-low {
    background: #f3f4f6;
    color: #6b7280;
}

/* Detail Sections */
.detail-section {
    margin-bottom: var(--spacing-md);
}

.detail-section h4 {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--color-dark);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 0.5rem 0;
}

.detail-section p {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--color-text);
    margin: 0;
}

.detail-guidance {
    background: #f0fdf4;
    padding: var(--spacing-sm);
    border-radius: 8px;
    border-left: 3px solid #22c55e;
}

.detail-guidance h4 {
    color: #166534;
}

/* Detail Quotes */
.detail-quotes {
    margin-bottom: var(--spacing-md);
}

.detail-quotes h4 {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--color-dark);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 0.5rem 0;
}

.detail-quotes blockquote {
    background: var(--color-bg-alt);
    border-left: 3px solid var(--color-primary);
    padding: 0.75rem 1rem;
    margin: 0 0 0.5rem 0;
    border-radius: 0 6px 6px 0;
}

.detail-quotes blockquote p {
    font-style: italic;
    font-size: 0.875rem;
    line-height: 1.5;
    margin: 0;
    color: var(--color-text);
}

.detail-quotes blockquote cite {
    display: block;
    font-size: 0.75rem;
    color: var(--color-text-light);
    font-style: normal;
    margin-top: 0.375rem;
}

/* Detail Links */
.detail-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--color-border);
}

.detail-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 0.875rem;
    background: var(--color-bg-alt);
    border-radius: 8px;
    text-decoration: none;
    color: var(--color-text);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.detail-link:hover {
    background: var(--color-primary);
    color: white;
}

.detail-link svg {
    flex-shrink: 0;
}

.detail-link.nist-link:hover {
    background: #6366f1;
}

.detail-link.book-link:hover {
    background: var(--color-primary);
}

/* Responsive */
@media (max-width: 1024px) {
    .control-detail-panel.active {
        position: absolute;
        right: 0;
        top: 0;
        bottom: 0;
        width: 100%;
        min-width: 100%;
        z-index: 10;
    }
    
    .crosswalk-map-modal .modal-container {
        width: 100vw;
        height: 100vh;
        border-radius: 0;
        margin: 0;
    }
}

@media (max-width: 640px) {
    .modal-search-bar {
        padding: 0.625rem var(--spacing-md);
    }
    
    .crosswalk-map {
        padding: var(--spacing-sm);
    }
    
    .chapter-header {
        padding: var(--spacing-sm);
    }
    
    .chapter-title {
        font-size: 0.9rem;
    }
    
    .control-group-label {
        font-size: 0.6rem;
    }
    
    .control-chip {
        font-size: 0.7rem;
        padding: 0.2rem 0.4rem;
    }
}

/* ============================================
   Mermaid Diagram Styles
   ============================================ */

.diagram-legend {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: var(--spacing-sm) var(--spacing-md);
    background: white;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    margin-bottom: var(--spacing-md);
    flex-wrap: wrap;
}

.legend-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-text-light);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-text);
}

.legend-item::before {
    content: '';
    width: 12px;
    height: 12px;
    border-radius: 3px;
    background: var(--color);
}

/* Chapter Diagram Cards */
.chapter-diagram-card {
    background: white;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    margin-bottom: var(--spacing-md);
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}

.chapter-diagram-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.diagram-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    color: white;
}

.diagram-title {
    flex: 1;
}

.diagram-chapter-num {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.8;
}

.diagram-title h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0.25rem 0 0 0;
    line-height: 1.3;
}

.diagram-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
}

.mapping-count {
    font-size: 0.75rem;
    background: rgba(255, 255, 255, 0.15);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    white-space: nowrap;
}

.read-chapter-link {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    color: white;
    text-decoration: none;
    opacity: 0.9;
    transition: opacity 0.2s;
}

.read-chapter-link:hover {
    opacity: 1;
    text-decoration: underline;
}

/* Diagram Container */
.diagram-container {
    padding: var(--spacing-md);
    overflow-x: auto;
    background: #fafafa;
}

.diagram-container .mermaid {
    display: flex;
    justify-content: center;
}

.diagram-container svg {
    max-width: 100%;
    height: auto;
}

/* Mermaid node click styling */
.diagram-container .node {
    cursor: pointer;
}

.diagram-container .node:hover rect,
.diagram-container .node:hover polygon {
    filter: brightness(1.1);
}

.diagram-summary {
    padding: var(--spacing-sm) var(--spacing-md);
    margin: 0;
    font-size: 0.85rem;
    color: var(--color-text-light);
    background: var(--color-bg-alt);
    border-top: 1px solid var(--color-border);
    line-height: 1.5;
}

/* Responsive Diagrams */
@media (max-width: 768px) {
    .diagram-header {
        flex-direction: column;
        gap: var(--spacing-xs);
    }
    
    .diagram-meta {
        flex-direction: row;
        align-items: center;
        width: 100%;
    }
    
    .diagram-container {
        padding: var(--spacing-sm);
    }
    
    .diagram-legend {
        justify-content: center;
    }
}

.legend-hint {
    font-size: 0.75rem;
    color: var(--color-text-light);
    margin-left: auto;
    font-style: italic;
}

/* Unified Diagram Styles */
.unified-diagram-container {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.diagram-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    background: white;
    border: 1px solid var(--color-border);
    border-radius: 8px;
}

.diagram-stats {
    display: flex;
    gap: var(--spacing-md);
    flex-wrap: wrap;
}

.diagram-stats .stat {
    font-size: 0.85rem;
    color: var(--color-text-light);
}

.diagram-stats .stat strong {
    color: var(--color-dark);
}

.diagram-hint {
    font-size: 0.8rem;
    color: var(--color-text-light);
    margin: 0;
    font-style: italic;
}

.diagram-legend-inline {
    display: flex;
    justify-content: center;
    gap: var(--spacing-lg);
    flex-wrap: wrap;
}

.mermaid-wrapper {
    background: #fafafa;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: var(--spacing-md);
    overflow: auto;
    max-height: calc(100vh - 300px);
}

.mermaid-wrapper .mermaid {
    display: flex;
    justify-content: center;
}

.mermaid-wrapper svg {
    max-width: 100%;
    height: auto;
}

.mermaid-wrapper .node {
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.mermaid-wrapper .node:hover rect,
.mermaid-wrapper .node:hover polygon {
    filter: brightness(1.1);
}

/* Detail panel reference list */
.ref-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.ref-list li a {
    display: inline-flex;
    align-items: center;
    color: var(--color-primary);
    text-decoration: none;
    font-size: 0.9rem;
}

.ref-list li a:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    .diagram-info {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .mermaid-wrapper {
        max-height: calc(100vh - 350px);
    }
}

/* ============================================
   Sankey Diagram Styles
   ============================================ */

.sankey-container {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    height: 100%;
}

#sankey-chart {
    background: linear-gradient(135deg, #fafafa 0%, #f1f5f9 100%);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: var(--spacing-md);
    min-height: 500px;
}

#sankey-chart svg {
    display: block;
    margin: 0 auto;
}

.sankey-legend {
    display: flex;
    justify-content: center;
    gap: var(--spacing-lg);
    padding: var(--spacing-sm) 0;
}

.sankey-tooltip {
    position: absolute;
    background: #1e293b;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    pointer-events: none;
    z-index: 1000;
    max-width: 250px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.sankey-tooltip em {
    font-size: 0.75rem;
    opacity: 0.8;
}

/* Detail Section */
.sankey-details {
    background: white;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: var(--spacing-md);
    min-height: 200px;
    overflow-y: auto;
    max-height: 400px;
}

.detail-summary {
    text-align: center;
}

.detail-summary h3 {
    margin: 0 0 var(--spacing-sm) 0;
    font-size: 1.25rem;
    color: var(--color-dark);
}

.detail-summary > p {
    color: var(--color-text-light);
    margin-bottom: var(--spacing-md);
}

.summary-stats {
    display: flex;
    justify-content: center;
    gap: var(--spacing-md);
    flex-wrap: wrap;
    margin: var(--spacing-md) 0;
}

.stat-card {
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: var(--spacing-sm) var(--spacing-md);
    text-align: center;
    min-width: 80px;
    border-top: 3px solid var(--accent, #64748b);
}

.stat-card .stat-number {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-dark);
}

.stat-card .stat-label {
    font-size: 0.75rem;
    color: var(--color-text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-hint {
    font-size: 0.85rem;
    color: var(--color-text-light);
    font-style: italic;
}

/* Detail Header Bar */
.detail-header-bar {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding-bottom: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    border-bottom: 2px solid var(--func-color, var(--color-border));
    flex-wrap: wrap;
}

.detail-header-bar h3 {
    margin: 0;
    flex: 1;
    font-size: 1.1rem;
    color: var(--color-dark);
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.75rem;
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--color-text);
    cursor: pointer;
    transition: all 0.2s ease;
}

.back-btn:hover {
    background: var(--func-color, var(--color-primary));
    color: white;
    border-color: var(--func-color, var(--color-primary));
}

.mapping-badge {
    background: var(--func-color, var(--color-bg-alt));
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Mappings Grid */
.mappings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--spacing-md);
}

.mapping-card {
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: var(--spacing-md);
    transition: all 0.2s ease;
}

.mapping-card:hover {
    border-color: var(--color-primary);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.mapping-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.mapping-card .control-id {
    font-weight: 600;
    color: var(--color-dark);
}

.mapping-card .control-name {
    font-size: 0.9rem;
    color: var(--color-text);
    margin: 0 0 0.5rem 0;
    line-height: 1.4;
}

.mapping-card .section-ref {
    font-size: 0.8rem;
    color: var(--color-text-light);
    margin: 0 0 0.75rem 0;
}

.expand-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    background: white;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-size: 0.8rem;
    color: var(--color-primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.expand-btn:hover {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

/* Expanded Mapping View */
.expanded-mapping {
    max-width: 800px;
}

.expanded-mapping .mapping-meta {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    flex-wrap: wrap;
}

.expanded-mapping .control-name {
    font-size: 1rem;
    color: var(--color-text);
    font-weight: 500;
}

.mapping-section {
    margin-bottom: var(--spacing-md);
}

.mapping-section h4 {
    font-size: 0.9rem;
    color: var(--color-dark);
    margin: 0 0 0.5rem 0;
    font-weight: 600;
}

.mapping-section p {
    margin: 0;
    color: var(--color-text);
    line-height: 1.6;
}

.mapping-section.guidance {
    background: #fefce8;
    border-left: 3px solid #f59e0b;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: 0 6px 6px 0;
}

.detail-quotes {
    margin-bottom: var(--spacing-md);
}

.detail-quotes h4 {
    font-size: 0.9rem;
    color: var(--color-dark);
    margin: 0 0 0.75rem 0;
}

.detail-quotes blockquote {
    margin: 0 0 var(--spacing-sm) 0;
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--color-bg-alt);
    border-left: 3px solid var(--color-secondary);
    border-radius: 0 6px 6px 0;
}

.detail-quotes blockquote p {
    margin: 0;
    font-style: italic;
    color: var(--color-text);
    line-height: 1.6;
}

.detail-quotes blockquote cite {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: var(--color-text-light);
    font-style: normal;
}

.mapping-links {
    display: flex;
    gap: var(--spacing-md);
    margin-top: var(--spacing-lg);
    flex-wrap: wrap;
}

.link-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.link-btn.nist {
    background: #1e293b;
    color: white;
}

.link-btn.nist:hover {
    background: #334155;
}

.link-btn.book {
    background: var(--color-primary);
    color: white;
}

.link-btn.book:hover {
    background: var(--color-primary-dark);
}

/* Controls List (Function view) */
.controls-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.control-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--color-bg-alt);
    border-radius: 6px;
    gap: var(--spacing-md);
    flex-wrap: wrap;
}

.control-row .control-info {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    flex: 1;
    min-width: 200px;
}

.control-row .control-id {
    font-weight: 600;
    color: var(--color-dark);
    white-space: nowrap;
}

.control-row .control-name {
    font-size: 0.85rem;
    color: var(--color-text-light);
}

.control-refs {
    display: flex;
    gap: 0.375rem;
    flex-wrap: wrap;
}

.ref-chip {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background: white;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    font-size: 0.75rem;
    color: var(--color-primary);
    text-decoration: none;
    transition: all 0.2s ease;
}

.ref-chip:hover {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

/* Relevance Badges */
.relevance-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.relevance-high {
    background: #dcfce7;
    color: #166534;
}

.relevance-medium {
    background: #fef3c7;
    color: #92400e;
}

.relevance-low {
    background: #f1f5f9;
    color: #64748b;
}

@media (max-width: 768px) {
    #sankey-chart {
        min-height: 400px;
        padding: var(--spacing-sm);
    }
    
    .sankey-details {
        max-height: 300px;
    }
    
    .summary-stats {
        gap: var(--spacing-sm);
    }
    
    .stat-card {
        min-width: 60px;
        padding: var(--spacing-xs) var(--spacing-sm);
    }
    
    .mappings-grid {
        grid-template-columns: 1fr;
    }
    
    .mapping-links {
        flex-direction: column;
    }
    
    .link-btn {
        justify-content: center;
    }
}

/* Ensure Sankey chart is visible */
.crosswalk-map-body .crosswalk-map {
    min-height: 700px;
}

.sankey-container {
    min-height: 700px;
}

#sankey-chart {
    min-height: 500px;
}

/* ============================================
   3D Pipe Visualization Styles
   ============================================ */

.pipe-3d-container {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    height: 100%;
}

#pipe-canvas {
    width: 100%;
    height: 500px;
    background: linear-gradient(180deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 12px;
    overflow: hidden;
    cursor: grab;
}

#pipe-canvas:active {
    cursor: grabbing;
}

#pipe-canvas canvas {
    display: block;
}

.pipe-legend {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-md);
    padding: var(--spacing-xs) 0;
    flex-wrap: wrap;
}

.pipe-legend .legend-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-text-light);
}

.pipe-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-md);
    flex-wrap: wrap;
}

.pipe-btn {
    padding: 0.5rem 1rem;
    background: white;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--color-text);
    cursor: pointer;
    transition: all 0.2s ease;
}

.pipe-btn:hover {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

.pipe-hint {
    font-size: 0.8rem;
    color: var(--color-text-light);
    font-style: italic;
}

.pipe-details {
    background: white;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: var(--spacing-md);
    min-height: 150px;
    max-height: 300px;
    overflow-y: auto;
}

/* Mapping Items for 3D view */
.mappings-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.mapping-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: var(--color-bg-alt);
    border-radius: 6px;
}

.mapping-item .control-id {
    font-weight: 600;
    color: var(--color-dark);
}

.mapping-item .chapter-ref {
    font-size: 0.8rem;
    color: var(--color-text-light);
}

.more-hint {
    text-align: center;
    font-size: 0.85rem;
    color: var(--color-text-light);
    margin: 0.5rem 0 0 0;
}

@media (max-width: 768px) {
    #pipe-canvas {
        height: 350px;
    }
    
    .pipe-controls {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .pipe-details {
        max-height: 250px;
    }
}

/* Additional 3D Pipe View Styles */
.chapter-detail {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.chapter-summary {
    color: var(--color-text);
    line-height: 1.6;
    margin: 0;
}

.func-breakdown {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.func-chip {
    padding: 0.25rem 0.75rem;
    border-radius: 16px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Clickable mapping items */
.mapping-item.clickable {
    cursor: pointer;
    transition: all 0.2s ease;
}

.mapping-item.clickable:hover {
    background: var(--color-primary-light, #e0e7ff);
    transform: translateX(4px);
}

.section-ref {
    font-size: 0.75rem;
    color: var(--color-text-light);
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Expanded function info */
.expanded-info {
    padding: var(--spacing-sm);
}

.expanded-info p {
    margin: 0 0 0.5rem 0;
    color: var(--color-text);
}

.expanded-info .hint {
    font-size: 0.85rem;
    color: var(--color-text-light);
    font-style: italic;
}

/* ============================================
   Radar Chart Visualization Styles
   ============================================ */

.radar-layout {
    display: flex;
    gap: var(--spacing-lg);
    height: 100%;
    min-height: 500px;
}

.radar-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    min-width: 400px;
}

.radar-controls {
    background: var(--color-surface);
    border-radius: 8px;
    padding: var(--spacing-sm);
    border: 1px solid var(--color-border);
}

.chapter-filter label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text-muted);
    margin-bottom: 0.5rem;
}

.chapter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.chapter-btn {
    padding: 0.35rem 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: 16px;
    background: white;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.chapter-btn:hover {
    border-color: var(--color-primary);
}

.chapter-btn.active {
    background: var(--ch-color, var(--color-primary));
    color: white;
    border-color: transparent;
}

.chapter-btn[data-chapter="all"].active {
    background: var(--color-dark);
}

.radar-container {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #fafafa 0%, #f1f5f9 100%);
    border-radius: 12px;
    border: 1px solid var(--color-border);
    min-height: 400px;
}

#radar-canvas {
    max-width: 100%;
    max-height: 100%;
}

.radar-center-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--color-dark);
    pointer-events: none;
    line-height: 1.3;
}

.radar-legend {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    justify-content: center;
    padding: var(--spacing-xs);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

.legend-line {
    width: 20px;
    height: 2px;
    background: var(--color-dark);
}

.legend-line.dashed {
    background: repeating-linear-gradient(
        90deg,
        var(--color-dark) 0px,
        var(--color-dark) 4px,
        transparent 4px,
        transparent 8px
    );
}

.radar-right {
    flex: 1;
    background: white;
    border-radius: 12px;
    border: 1px solid var(--color-border);
    overflow-y: auto;
    min-width: 350px;
}

.details-placeholder {
    padding: var(--spacing-xl);
    text-align: center;
    color: var(--color-text-muted);
}

.details-placeholder h3 {
    color: var(--color-dark);
    margin-bottom: var(--spacing-md);
}

.details-placeholder p {
    margin-bottom: var(--spacing-sm);
    line-height: 1.6;
}

/* Function Details Panel */
.function-details {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.function-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background: linear-gradient(135deg, var(--func-color) 0%, color-mix(in srgb, var(--func-color) 80%, black) 100%);
    color: white;
}

.function-header h3 {
    margin: 0;
    flex: 1;
}

.mapping-count {
    background: rgba(255,255,255,0.2);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
}

.close-details {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
}

.close-details:hover {
    background: rgba(255,255,255,0.3);
}

.chapter-mappings {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-sm);
}

.chapter-group {
    margin-bottom: var(--spacing-xs);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    overflow: hidden;
}

.chapter-group-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: var(--color-bg-alt);
    cursor: pointer;
    transition: background 0.2s;
}

.chapter-group-header:hover {
    background: var(--color-border);
}

.chapter-color {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.chapter-title {
    flex: 1;
    font-size: 0.85rem;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chapter-count {
    background: var(--color-primary);
    color: white;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
}

.toggle-icon {
    color: var(--color-text-muted);
    font-size: 0.7rem;
}

.chapter-group-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.mapping-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    border-top: 1px solid var(--color-border);
    cursor: pointer;
    transition: background 0.2s;
}

.mapping-row:hover {
    background: var(--color-bg-alt);
}

.mapping-row .control-id {
    font-weight: 600;
    color: var(--color-primary);
    font-size: 0.85rem;
}

.mapping-row .section-name {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 180px;
}

/* Mapping Detail */
.mapping-detail {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.detail-header {
    padding: var(--spacing-md);
    background: linear-gradient(135deg, var(--func-color) 0%, color-mix(in srgb, var(--func-color) 80%, black) 100%);
    color: white;
}

.detail-header .back-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
}

.detail-header .back-btn:hover {
    background: rgba(255,255,255,0.3);
}

.detail-header h3 {
    margin: 0;
}

.detail-content {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-md);
}

.detail-content .control-name {
    font-weight: 600;
    color: var(--color-dark);
    margin-bottom: 0.25rem;
}

.detail-breadcrumb {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--color-border);
}

.detail-section {
    margin-bottom: var(--spacing-md);
}

.detail-section h4 {
    font-size: 0.9rem;
    color: var(--color-dark);
    margin-bottom: 0.5rem;
}

.detail-section p {
    line-height: 1.6;
    color: var(--color-text);
}

.detail-section blockquote {
    margin: 0.5rem 0;
    padding: 0.75rem;
    background: var(--color-bg-alt);
    border-left: 3px solid var(--color-secondary);
    font-style: italic;
    color: var(--color-text-muted);
}

.detail-section.guidance {
    background: #f0fdf4;
    padding: var(--spacing-sm);
    border-radius: 8px;
    border: 1px solid #86efac;
}

.detail-section.guidance h4 {
    color: #166534;
}

.detail-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: var(--spacing-md);
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--color-border);
}

.detail-links .link-btn {
    display: block;
    padding: 0.75rem;
    text-align: center;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
}

.detail-links .link-btn.nist {
    background: var(--color-primary);
    color: white;
}

.detail-links .link-btn.nist:hover {
    background: var(--color-primary-dark, #4338ca);
}

.detail-links .link-btn.book {
    background: var(--color-bg-alt);
    color: var(--color-dark);
    border: 1px solid var(--color-border);
}

.detail-links .link-btn.book:hover {
    background: var(--color-border);
}

@media (max-width: 900px) {
    .radar-layout {
        flex-direction: column;
    }
    
    .radar-left, .radar-right {
        min-width: auto;
    }
    
    .radar-right {
        min-height: 300px;
    }
}

/* ============================================
   Chord Diagram Visualization Styles
   ============================================ */

.chord-layout {
    display: flex;
    gap: var(--spacing-lg);
    height: 100%;
    min-height: 500px;
}

.chord-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    min-width: 400px;
}

.chord-title {
    text-align: center;
}

.chord-title h3 {
    margin: 0 0 0.25rem 0;
    color: var(--color-dark);
}

.chord-title p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.chord-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #fafafa 0%, #f1f5f9 100%);
    border-radius: 12px;
    border: 1px solid var(--color-border);
    min-height: 400px;
}

.chord-container svg {
    max-width: 100%;
    max-height: 100%;
}

.chord-legend {
    display: flex;
    justify-content: center;
    padding: var(--spacing-xs);
}

.legend-section {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
    justify-content: center;
}

.legend-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-text-muted);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    color: var(--color-text);
}

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

.chord-right {
    flex: 1;
    background: white;
    border-radius: 12px;
    border: 1px solid var(--color-border);
    overflow-y: auto;
    min-width: 350px;
}

.details-placeholder {
    padding: var(--spacing-xl);
    text-align: center;
}

.details-placeholder h3 {
    color: var(--color-dark);
    margin-bottom: var(--spacing-sm);
}

.details-placeholder p {
    color: var(--color-text-muted);
    margin-bottom: var(--spacing-md);
}

.summary-stats {
    display: flex;
    justify-content: center;
    gap: var(--spacing-lg);
    margin-top: var(--spacing-md);
}

.stat {
    text-align: center;
}

.stat-num {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-primary);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

/* Arc Details */
.arc-details {
    padding: var(--spacing-md);
}

.arc-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: 0.3rem;
    padding-bottom: var(--spacing-sm);
    border-bottom: 2px solid var(--color-border);
}

.arc-header.chapter-header {
    flex-wrap: wrap;
}

.arc-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    flex-shrink: 0;
}

.arc-header h3 {
    margin: 0;
    flex: 1;
    font-size: 1.1rem;
}

.arc-header.func-header {
    background: linear-gradient(135deg, var(--func-color) 0%, color-mix(in srgb, var(--func-color) 80%, black) 100%);
    color: white;
    padding: var(--spacing-md);
    margin: calc(-1 * var(--spacing-md));
    margin-bottom: var(--spacing-md);
    border-bottom: none;
    border-radius: 12px 12px 0 0;
}

.total-badge {
    background: rgba(255,255,255,0.2);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
}

.chapter-summary {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 0.3rem;
}

.function-breakdown h4,
.chapter-breakdown h4 {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-bottom: var(--spacing-sm);
}

.func-row, .chapter-row {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.func-row:hover, .chapter-row:hover {
    background: var(--color-bg-alt);
}

.func-color, .ch-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    flex-shrink: 0;
}

.func-name, .ch-name {
    flex: 1;
    font-size: 0.9rem;
}

.func-count, .ch-count {
    background: var(--color-bg-alt);
    padding: 0.2rem 0.6rem;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-primary);
}

.detail-link {
    display: inline-block;
    margin-top: var(--spacing-md);
    color: var(--color-primary);
    font-weight: 500;
    text-decoration: none;
}

.detail-link:hover {
    text-decoration: underline;
}

/* Mapping Details */
.mapping-details, .single-mapping {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.mapping-header {
    padding: var(--spacing-md);
    background: linear-gradient(135deg, var(--func-color) 0%, color-mix(in srgb, var(--func-color) 80%, black) 100%);
    color: white;
}

.mapping-header .back-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
}

.mapping-header .back-btn:hover {
    background: rgba(255,255,255,0.3);
}

.mapping-header h3 {
    margin: 0;
    display: inline;
}

.count-badge {
    float: right;
    background: rgba(255,255,255,0.2);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
}

.mappings-list {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-sm);
}

.mapping-card {
    padding: 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
}

.mapping-card:hover {
    border-color: var(--color-primary);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.mapping-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
}

.mapping-card .control-id {
    font-weight: 600;
    color: var(--color-primary);
}

.mapping-card .relevance {
    font-size: 0.7rem;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    text-transform: uppercase;
}

.relevance.high { background: #dcfce7; color: #166534; }
.relevance.medium { background: #fef3c7; color: #92400e; }
.relevance.low { background: #fee2e2; color: #991b1b; }

.mapping-section {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin: 0;
}

.mapping-actions {
    padding: var(--spacing-sm);
    border-top: 1px solid var(--color-border);
}

.action-btn {
    display: block;
    text-align: center;
    padding: 0.75rem;
    background: var(--color-bg-alt);
    border-radius: 8px;
    color: var(--color-dark);
    text-decoration: none;
    font-weight: 500;
}

.action-btn:hover {
    background: var(--color-border);
}

/* Single mapping detail */
.mapping-content {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-md);
}

.mapping-content .control-name {
    font-weight: 600;
    color: var(--color-dark);
    margin-bottom: 0.25rem;
}

.mapping-content .breadcrumb {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--color-border);
}

.content-section {
    margin-bottom: 0.4rem;
}

.content-section h4 {
    font-size: 0.9rem;
    color: var(--color-dark);
    margin-bottom: 0.5rem;
}

.content-section p {
    line-height: 1.6;
}

.content-section blockquote {
    margin: 0.5rem 0;
    padding: 0.75rem;
    background: var(--color-bg-alt);
    border-left: 3px solid var(--color-secondary);
    font-style: italic;
    color: var(--color-text-muted);
}

.content-section.guidance {
    background: #f0fdf4;
    padding: 0.3rem;
    border-radius: 8px;
    border: 1px solid #86efac;
}

.content-section.guidance h4 {
    color: #166534;
}

.mapping-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: var(--spacing-md);
}

.link-btn {
    display: block;
    padding: 0.75rem;
    text-align: center;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
}

.link-btn.primary {
    background: var(--color-primary);
    color: white;
}

.link-btn.primary:hover {
    background: var(--color-primary-dark, #4338ca);
}

.link-btn.secondary {
    background: var(--color-bg-alt);
    color: var(--color-dark);
    border: 1px solid var(--color-border);
}

.link-btn.secondary:hover {
    background: var(--color-border);
}


/* Framework Hierarchy View */
.framework-hierarchy {
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.func-header-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-sm) var(--spacing-md);
    background: linear-gradient(135deg, var(--func-color) 0%, color-mix(in srgb, var(--func-color) 80%, black) 100%);
    color: white;
}

.func-header-panel h3 {
    margin: 0;
    font-size: 1.2rem;
}

.framework-hierarchy .func-desc {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    padding: var(--spacing-xs) var(--spacing-sm);
    margin: 0;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-bg-alt);
}

.categories-list {
    flex: 1;
    overflow-y: auto;
}

.category-section {
    border-bottom: 1px solid var(--color-border);
}

.category-section h4 {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: 0.4rem var(--spacing-sm);
    margin: 0;
    background: var(--color-bg);
    font-size: 0.85rem;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 1;
    border-bottom: 1px solid var(--color-border-light);
}

.category-section .cat-id {
    font-family: var(--font-mono, monospace);
    color: var(--color-primary);
    font-size: 0.8rem;
}

.category-section .cat-name {
    flex: 1;
    color: var(--color-dark);
}

.category-section .cat-count {
    background: var(--color-primary);
    color: white;
    font-size: 0.7rem;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
}

.controls-list {
    background: white;
}

.control-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem var(--spacing-md);
    border-bottom: 1px solid var(--color-border-light);
    gap: var(--spacing-sm);
}

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

.control-row.no-citations {
    opacity: 0.4;
}

.control-row.has-citations:hover {
    background: var(--color-bg-alt);
}

.control-info {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.control-row .control-id {
    font-family: var(--font-mono, monospace);
    font-size: 0.75rem;
    color: var(--color-primary);
    white-space: nowrap;
}

.control-row .control-name {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.citations {
    display: flex;
    gap: 0.2rem;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.citation-link {
    font-size: 0.7rem;
    padding: 0.15rem 0.4rem;
    background: var(--color-bg-alt);
    border-radius: 3px;
    color: var(--color-primary);
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.15s;
}

.citation-link:hover {
    background: var(--color-primary);
    color: white;
}


/* Expanded Citation Display */
.citations-expanded {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    width: 100%;
    margin-top: 0.3rem;
}

.citation-detail-row {
    display: grid;
    grid-template-columns: minmax(150px, 1fr) minmax(120px, 1.5fr) auto;
    gap: 0.5rem;
    padding: 0.3rem 0.4rem;
    background: var(--color-bg-alt);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s;
    align-items: center;
    font-size: 0.75rem;
}

.citation-detail-row:hover {
    background: var(--color-bg);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.cite-chapter {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.cite-ch-num {
    font-weight: 600;
    color: var(--color-primary);
    font-size: 0.7rem;
}

.cite-ch-title {
    color: var(--color-text);
    font-size: 0.75rem;
    line-height: 1.2;
}

.cite-section {
    color: var(--color-text-muted);
    font-size: 0.7rem;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.cite-relationship {
    text-align: right;
}

.cite-rel-tag {
    display: inline-block;
    padding: 0.15rem 0.35rem;
    border-radius: 3px;
    font-size: 0.65rem;
    font-weight: 500;
    white-space: nowrap;
}

.cite-rel-tag.rel-overlap { background: #dcfce7; color: #166534; }
.cite-rel-tag.rel-extension { background: #dbeafe; color: #1e40af; }
.cite-rel-tag.rel-illustration { background: #fef3c7; color: #92400e; }
.cite-rel-tag.rel-emphasis { background: #fce7f3; color: #9d174d; }
.cite-rel-tag.rel-gap { background: #fee2e2; color: #991b1b; }
.cite-rel-tag.rel-constraint { background: #e0e7ff; color: #3730a3; }
.cite-rel-tag.rel-disagreement { background: #fecaca; color: #7f1d1d; }
.cite-rel-tag.rel-translation { background: #f3e8ff; color: #6b21a8; }
.cite-rel-tag.rel-default { background: #f1f5f9; color: #475569; }

/* Make control row a column layout when expanded */
.control-row.has-citations {
    flex-direction: column;
    align-items: stretch;
}

.control-row.has-citations .control-info {
    margin-bottom: 0.2rem;
}

.no-refs {
    color: var(--color-border);
    font-size: 0.8rem;
}


/* Chapter Hierarchy View */
.chapter-hierarchy .chapter-panel {
    background: linear-gradient(135deg, var(--func-color) 0%, color-mix(in srgb, var(--func-color) 80%, #1a365d) 100%);
}

.section-heading {
    font-weight: 500;
}

.key-concepts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin: 0.25rem 0 0.4rem;
}

.concept-tag {
    font-size: 0.65rem;
    padding: 0.1rem 0.35rem;
    background: var(--color-bg-alt);
    border-radius: 3px;
    color: var(--color-text-muted);
}

.mapping-row {
    cursor: pointer;
}

.mapping-row:hover {
    background: var(--color-bg-alt);
}

.func-badge {
    font-size: 0.6rem;
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
    font-weight: 600;
    white-space: nowrap;
}

.no-mappings {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    font-style: italic;
    padding: 0.3rem 0;
}


/* Expanded Mapping Display (Chapter â†’ NIST view) */
.mapping-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.4rem 0.5rem;
    background: var(--color-bg-alt);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s;
    margin-bottom: 0.25rem;
}

.mapping-detail-row:hover {
    background: var(--color-bg);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.mapping-nist-info {
    flex: 1;
    min-width: 0;
}

.mapping-func-header {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.15rem;
}

.mapping-func-badge {
    display: inline-block;
    padding: 0.1rem 0.35rem;
    border-radius: 3px;
    font-size: 0.6rem;
    font-weight: 700;
    color: white;
    white-space: nowrap;
}

.mapping-control-id {
    font-family: var(--font-mono, monospace);
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--color-text);
}

.mapping-control-name {
    font-size: 0.75rem;
    color: var(--color-text);
    line-height: 1.3;
    margin-bottom: 0.1rem;
}

.mapping-category {
    font-size: 0.65rem;
    color: var(--color-text-muted);
    font-style: italic;
}

.mapping-relationship {
    flex-shrink: 0;
    padding-top: 0.1rem;
}

.rel-rationale {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    line-height: 1.5;
    margin: 0.3rem 0;
}

.practical-impl {
    font-size: 0.85rem;
    color: var(--color-text);
    line-height: 1.5;
    margin: 0.3rem 0;
    padding: 0.3rem;
    background: #f0f9ff;
    border-radius: 4px;
    border-left: 2px solid var(--color-primary);
}

.directionality-row {
    margin: 0.3rem 0;
}

.dir-badge {
    font-size: 0.75rem;
    padding: 0.15rem 0.4rem;
    background: var(--color-bg-alt);
    border-radius: 4px;
    color: var(--color-text);
}


/* Enhanced Mapping Detail View */
.mapping-detail-view {
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.mapping-detail-view .back-btn {
    align-self: flex-start;
    background: var(--color-bg-alt);
    border: none;
    color: var(--color-primary);
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75rem;
    margin-bottom: 0.5rem;
    transition: background 0.2s;
}

.mapping-detail-view .back-btn:hover {
    background: var(--color-border);
}

/* Connection Visual - Two Sides with Bridge */
.mapping-connection {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 0.3rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 8px;
    padding: 0.5rem;
    border: 1px solid var(--color-border);
}

.connection-side {
    padding: 0.4rem;
    border-radius: 6px;
    text-align: center;
}

.book-side {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border: 1px solid #93c5fd;
}

.nist-side {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 1px solid #fcd34d;
}

.side-badge {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    font-size: 0.6rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
}

.book-badge {
    background: #1e3a5f;
    color: white;
}

.nist-badge {
    color: white;
}

.side-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--color-dark);
    margin-bottom: 0.1rem;
}

.side-subtitle {
    font-size: 0.7rem;
    color: var(--color-text);
    line-height: 1.2;
    margin-bottom: 0.1rem;
}

.side-detail {
    font-size: 0.6rem;
    color: var(--color-text-muted);
    font-style: italic;
}

/* Connection Bridge */
.connection-bridge {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 0 0.3rem;
}

.bridge-relation {
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.6rem;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
}

.bridge-relation.rel-overlap { background: #dcfce7; color: #166534; }
.bridge-relation.rel-extension { background: #dbeafe; color: #1e40af; }
.bridge-relation.rel-illustration { background: #fef3c7; color: #92400e; }
.bridge-relation.rel-emphasis { background: #fce7f3; color: #9d174d; }
.bridge-relation.rel-gap { background: #fee2e2; color: #991b1b; }
.bridge-relation.rel-constraint { background: #e0e7ff; color: #3730a3; }
.bridge-relation.rel-disagreement { background: #fecaca; color: #7f1d1d; }
.bridge-relation.rel-translation { background: #f3e8ff; color: #6b21a8; }
.bridge-relation.rel-default { background: #f1f5f9; color: #475569; }

.bridge-direction {
    font-size: 0.9rem;
    margin-top: 0.2rem;
}

/* Analysis Panel */
.mapping-analysis-panel {
    background: var(--color-bg);
    border-radius: 6px;
    padding: 0.4rem;
    margin-bottom: 0.4rem;
    border: 1px solid var(--color-border);
}

.analysis-section {
    margin-bottom: 0.4rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--color-border);
}

.analysis-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.analysis-section h4 {
    font-size: 0.7rem;
    color: var(--color-text-muted);
    margin: 0 0 0.2rem 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.analysis-header {
    display: flex;
    gap: 0.3rem;
    flex-wrap: wrap;
    margin-bottom: 0.2rem;
}

.rel-description {
    font-size: 0.75rem;
    color: var(--color-text);
    line-height: 1.4;
    margin: 0 0 0.2rem 0;
}

.rel-implication {
    font-size: 0.7rem;
    color: var(--color-text-muted);
    line-height: 1.4;
    margin: 0;
}

.dir-visual {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.dir-arrow {
    font-size: 1rem;
}

.dir-text {
    font-size: 0.75rem;
    color: var(--color-text);
}

.analysis-section.practical {
    background: #f0fdf4;
    padding: 0.3rem;
    border-radius: 4px;
    border: 1px solid #86efac;
}

.analysis-section.practical h4 {
    color: #166534;
}

.analysis-section.practical p {
    font-size: 0.75rem;
    color: #166534;
    margin: 0;
}

/* Evidence Panel */
.evidence-panel {
    background: var(--color-bg-alt);
    border-radius: 6px;
    padding: 0.4rem;
    margin-bottom: 0.4rem;
}

.evidence-panel h4 {
    font-size: 0.7rem;
    color: var(--color-text-muted);
    margin: 0 0 0.3rem 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mapping-argument {
    font-size: 0.75rem;
    color: var(--color-text);
    line-height: 1.5;
    margin: 0 0 0.3rem 0;
}

.quotes-list blockquote {
    margin: 0.2rem 0;
    padding: 0.3rem 0.5rem;
    background: var(--color-bg);
    border-left: 3px solid var(--color-secondary);
    font-size: 0.7rem;
    font-style: italic;
    color: var(--color-text);
    line-height: 1.4;
}

.quotes-list blockquote cite {
    display: block;
    font-size: 0.65rem;
    color: var(--color-text-muted);
    margin-top: 0.2rem;
    font-style: normal;
}

/* Guidance Panel */
.guidance-panel {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border: 1px solid #86efac;
    border-radius: 6px;
    padding: 0.4rem;
    margin-bottom: 0.4rem;
}

.guidance-panel h4 {
    font-size: 0.7rem;
    color: #166534;
    margin: 0 0 0.2rem 0;
}

.guidance-panel p {
    font-size: 0.75rem;
    color: #166534;
    line-height: 1.5;
    margin: 0;
}

/* Actions */
.mapping-actions {
    display: flex;
    gap: 0.3rem;
    margin-top: auto;
    padding-top: 0.3rem;
}

.action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    padding: 0.4rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
}

.action-btn.book-action {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
}

.action-btn.book-action:hover {
    background: #bfdbfe;
}

.action-btn.nist-action {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
}

.action-btn.nist-action:hover {
    background: #fde68a;
}

.action-icon {
    font-size: 0.9rem;
}

/* Mobile mapping detail adjustments */
@media (max-width: 640px) {
    .mapping-connection {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        gap: 0.2rem;
    }
    
    .connection-bridge {
        flex-direction: row;
        padding: 0.2rem 0;
        gap: 0.3rem;
    }
    
    .connection-side {
        padding: 0.3rem;
    }
    
    .side-title {
        font-size: 0.75rem;
    }
    
    .side-subtitle {
        font-size: 0.65rem;
    }
    
    .mapping-analysis-panel {
        padding: 0.3rem;
    }
    
    .evidence-panel {
        padding: 0.3rem;
    }
    
    .guidance-panel {
        padding: 0.3rem;
    }
    
    .mapping-actions {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .action-btn {
        padding: 0.5rem;
        font-size: 0.75rem;
    }
    
    .mapping-detail-view .back-btn {
        padding: 0.35rem 0.5rem;
        font-size: 0.7rem;
    }
}

/* Citation Detail View */
.citation-detail {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.citation-header {
    padding: 0.4rem 0.6rem;
    background: linear-gradient(135deg, var(--func-color) 0%, color-mix(in srgb, var(--func-color) 80%, black) 100%);
    color: white;
}

.citation-header .back-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
    transition: background 0.2s;
}

.citation-header .back-btn:hover {
    background: rgba(255,255,255,0.3);
}

.citation-header h3 {
    margin: 0;
    font-family: var(--font-mono, monospace);
}

.control-name-full {
    display: block;
    font-size: 0.9rem;
    opacity: 0.9;
    margin-top: 0.25rem;
}


.citation-content {
    flex: 1;
    overflow-y: auto;
    padding: 0.4rem;
}

.citation-source {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding-bottom: 0.3rem;
    margin-bottom: 0.3rem;
    border-bottom: 1px solid var(--color-border);
}

.source-label {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.source-section {
    font-weight: 600;
    color: var(--color-dark);
}

.citation-content blockquote {
    margin: 0.5rem 0;
    padding: 0.75rem;
    background: var(--color-bg-alt);
    border-left: 3px solid var(--color-secondary);
    font-style: italic;
}

.citation-content blockquote cite {
    display: block;
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin-top: 0.5rem;
    font-style: normal;
}

.citation-actions {
    padding: 0.3rem;
    border-top: 1px solid var(--color-border);
    display: flex;
    gap: 0.5rem;
}

.citation-actions .action-btn {
    flex: 1;
    font-size: 0.85rem;
}

.citation-actions .action-btn.secondary {
    background: transparent;
    border: 1px solid var(--color-border);
}

.citation-actions .action-btn.secondary:hover {
    background: var(--color-bg-alt);
}
@media (max-width: 900px) {
    .chord-layout {
        flex-direction: column;
    }
    
    .chord-left, .chord-right {
        min-width: auto;
    }
    
    .chord-right {
        min-height: 300px;
    }
}

.legend-divider {
    color: var(--color-border);
    margin: 0 0.25rem;
}

/* Relationship Type Badges */
.relationship-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.rel-badge {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    cursor: help;
}

.rel-badge.secondary {
    opacity: 0.7;
    font-weight: 500;
}

.rel-overlap { background: #dcfce7; color: #166534; }
.rel-extension { background: #dbeafe; color: #1e40af; }
.rel-illustration { background: #fef3c7; color: #92400e; }
.rel-emphasis { background: #fce7f3; color: #9d174d; }
.rel-gap { background: #fee2e2; color: #991b1b; }
.rel-constraint { background: #e0e7ff; color: #4338ca; }
.rel-disagreement { background: #fecaca; color: #b91c1c; }
.rel-translation { background: #f3e8ff; color: #7e22ce; }
.rel-default { background: var(--color-bg-alt); color: var(--color-text-muted); }

.dir-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    font-size: 0.7rem;
    background: var(--color-bg-alt);
    color: var(--color-text-muted);
    border: 1px solid var(--color-border);
}

.relationship-rationale {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    font-style: italic;
    margin: 0;
    line-height: 1.5;
}

.relationship-pending {
    padding: 0.5rem;
    background: var(--color-bg-alt);
    border-radius: 4px;
    color: var(--color-text-muted);
    font-size: 0.85rem;
}

.relationship-section {
    background: var(--color-bg-alt);
    padding: 0.3rem;
    border-radius: 6px;
    margin-bottom: 0.3rem;
}

.relationship-section h4 {
    margin-bottom: 0.5rem;
}

/* Relationship Filter */
.relationship-filter {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-bg);
}

.relationship-filter label {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    white-space: nowrap;
}

.relationship-filter select {
    flex: 1;
    max-width: 200px;
    padding: 0.35rem 0.5rem;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    font-size: 0.8rem;
    background: white;
}

.filter-count {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    padding: 0.2rem 0.5rem;
    background: var(--color-bg-alt);
    border-radius: 10px;
}

/* Small relationship badge on citation links */
.cite-rel-badge {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    margin-right: 3px;
    vertical-align: middle;
}

/* Relationship Bar Chart */
.relationship-bar-chart {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 0.3rem;
    margin-bottom: 0.3rem;
}

.bar-chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-xs);
    padding-bottom: var(--spacing-xs);
    border-bottom: 1px solid var(--color-border);
}

.bar-chart-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
}

.clear-filter-btn {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: all 0.15s ease;
}

.clear-filter-btn:hover {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

.bar-chart-bars {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.bar-row {
    display: grid;
    grid-template-columns: 100px 1fr 30px;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.bar-row:hover:not(.empty) {
    background: var(--color-bg-alt);
}

.bar-row.active {
    background: var(--color-bg-alt);
    box-shadow: inset 3px 0 0 var(--color-primary);
}

.bar-row.empty {
    opacity: 0.4;
    cursor: default;
}

.bar-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bar-track {
    height: 16px;
    background: var(--color-bg-alt);
    border-radius: 3px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
    min-width: 2px;
}

.bar-fill.rel-overlap { background: #22c55e; }
.bar-fill.rel-extension { background: #3b82f6; }
.bar-fill.rel-illustration { background: #f59e0b; }
.bar-fill.rel-emphasis { background: #ec4899; }
.bar-fill.rel-gap { background: #ef4444; }
.bar-fill.rel-constraint { background: #6366f1; }
.bar-fill.rel-disagreement { background: #dc2626; }
.bar-fill.rel-translation { background: #a855f7; }
.bar-fill.rel-default { background: #94a3b8; }

.bar-count {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--color-text-muted);
    text-align: right;
}

.bar-row.active .bar-count {
    color: var(--color-primary);
}

/* Mini Chord Chart in Detail Panel */
.mini-chord-container {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 0.3rem;
    margin-bottom: 0.3rem;
}

.mini-chord-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-xs);
    padding-bottom: var(--spacing-xs);
    border-bottom: 1px solid var(--color-border);
}

.mini-chord-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
}

#mini-chord-chart {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 280px;
}

#mini-chord-chart svg {
    overflow: visible;
}

.mini-chord-arc {
    transition: opacity 0.15s ease;
}

.mini-chord-arc:hover {
    opacity: 0.8;
}

.mini-chord-arc.active {
    stroke-width: 2px;
    stroke: var(--color-primary);
}

.mini-chord-ribbon {
    transition: opacity 0.15s ease;
}

.mini-chord-ribbon.active {
    opacity: 0.9 !important;
}

.mini-chord-label {
    pointer-events: none;
    font-family: var(--font-body);
}

.no-data {
    color: var(--color-text-muted);
    font-style: italic;
    text-align: center;
    padding: 0.5rem;
}

/* Relationship Treemap */
.relationship-treemap-container {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 0.3rem;
    margin-bottom: 0.3rem;
}

.treemap-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-xs);
}

.treemap-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-text);
}

#relationship-treemap {
    display: flex;
    justify-content: center;
}

.treemap-svg {
    overflow: visible;
}

.treemap-rect {
    transition: opacity 0.15s ease, transform 0.1s ease;
}

.treemap-rect:hover {
    transform: scale(1.02);
}

.treemap-rect.active {
    stroke: var(--color-text);
    stroke-width: 2px;
}

.treemap-label {
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.treemap-tooltip {
    position: absolute;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 0.8rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    pointer-events: none;
    z-index: 1000;
    max-width: 250px;
    line-height: 1.4;
    transition: opacity 0.15s ease;
}

.treemap-tooltip strong {
    color: var(--color-text);
}

.treemap-tooltip em {
    color: var(--color-text-muted);
    font-size: 0.75rem;
}

/* Crosswalk Split Layout */
.crosswalk-split-modal {
    max-width: 1400px;
    width: 95vw;
    height: 90vh;
    max-height: 90vh;
}

.crosswalk-split-body {
    display: grid;
    grid-template-columns: 420px 1fr;
    gap: 0;
    height: 100%;
    overflow: hidden;
}

/* Left Column - Visuals */
.crosswalk-visuals {
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--color-border);
    background: var(--color-bg);
    overflow-y: auto;
}

.chord-section {
    padding: var(--spacing-xs) var(--spacing-sm);
}

.chord-chart-container {
    display: flex;
    justify-content: center;
    min-height: 320px;
}

.chord-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    padding: var(--spacing-xs) 0;
    font-size: 0.75rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--color-text-muted);
}

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

.treemap-section {
    padding: var(--spacing-xs) var(--spacing-sm) var(--spacing-sm);
    border-top: 1px solid var(--color-border);
}

.treemap-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-xs);
}

.treemap-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-text);
}

/* Right Column - Analysis */
.crosswalk-analysis {
    overflow-y: auto;
    padding: 0.3rem 0.5rem;
    background: var(--color-bg-alt);
}

.analysis-placeholder {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    text-align: center;
    color: var(--color-text-muted);
    padding: 0.5rem;
}

.analysis-placeholder p {
    max-width: 400px;
    line-height: 1.6;
    font-size: 1rem;
}

/* Arc Details in Right Panel */
.arc-details {
    animation: fadeIn 0.2s ease;
}

.arc-header {
    padding: 0.4rem 0.6rem;
    background: var(--func-color, var(--color-primary));
    border-radius: 8px;
    margin-bottom: 0.3rem;
}

.arc-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    background: rgba(255,255,255,0.2);
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
    margin-bottom: 0.5rem;
}

.arc-header h3 {
    color: white;
    margin: 0;
    font-size: 1.25rem;
}

.chapter-summary {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 0.3rem;
}

.function-breakdown {
    background: var(--color-bg);
    border-radius: 8px;
    padding: 0.4rem 0.5rem;
    margin-bottom: 0.3rem;
}

.function-breakdown h4 {
    font-size: 0.85rem;
    margin: 0 0 var(--spacing-sm) 0;
    color: var(--color-text-muted);
}

.func-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.func-row:hover {
    background: var(--color-bg-alt);
}

.func-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

.func-name {
    flex: 1;
    font-size: 0.85rem;
    font-weight: 500;
}

.func-count {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    background: var(--color-bg-alt);
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive adjustments */
@media (max-width: 900px) {
    .crosswalk-split-body {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }
    
    .crosswalk-visuals {
        border-right: none;
        border-bottom: 1px solid var(--color-border);
        max-height: 50vh;
    }
}

/* ── Dedicated mobile crosswalk page (/crosswalk) ─────────────────── */
.crosswalk-mobile {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    background: var(--color-bg);
    color: var(--color-text);
}

.crosswalk-mobile-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--color-bg-alt);
    border-bottom: 1px solid var(--color-border);
    flex-shrink: 0;
}

.crosswalk-back-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-primary);
    text-decoration: none;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    transition: background 0.15s;
    flex-shrink: 0;
}

.crosswalk-back-btn:hover {
    background: var(--color-bg);
}

.crosswalk-mobile-title {
    flex: 1;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    margin-right: 32px; /* balance against the back button */
}

.crosswalk-mobile-tabs {
    display: flex;
    flex-shrink: 0;
    border-bottom: 2px solid var(--color-border);
    background: var(--color-bg);
}

.crosswalk-mob-tab {
    flex: 1;
    padding: 0.6rem 0.25rem;
    font-size: 0.8rem;
    font-weight: 500;
    text-align: center;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
    margin-bottom: -2px;
    font-family: inherit;
}

.crosswalk-mob-tab.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
    font-weight: 600;
}

.crosswalk-mobile-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0; /* allow flex children to shrink below content size */
}

.crosswalk-mobile-panel {
    display: none;
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: var(--spacing-xs);
}

.crosswalk-mobile-panel.active {
    display: block;
}

/* Component tweaks inside mobile crosswalk page */
.crosswalk-mobile .chord-section {
    padding: 0;
}

.crosswalk-mobile .chord-chart-container {
    min-height: 220px;
}

.crosswalk-mobile .chord-title {
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
    padding-top: 0.25rem;
}

.crosswalk-mobile .chord-legend {
    gap: 0.5rem;
    font-size: 0.7rem;
    padding: 0.25rem 0;
    flex-wrap: wrap;
    justify-content: center;
}

.crosswalk-mobile .treemap-section {
    padding: 0;
}

.crosswalk-mobile .treemap-info-card {
    min-height: 36px;
    padding: 0.25rem 0.4rem;
}

.crosswalk-mobile .treemap-info-card .info-hint {
    font-size: 0.75rem;
}

.crosswalk-mobile .crosswalk-analysis {
    padding: 0;
}

.crosswalk-mobile .analysis-placeholder p {
    font-size: 0.9rem;
    padding: var(--spacing-xs);
}

/* Arc details inside mobile crosswalk */
.crosswalk-mobile .arc-header {
    padding: 0.4rem 0.5rem;
}

.crosswalk-mobile .arc-header h3 {
    font-size: 1rem;
}

.crosswalk-mobile .function-breakdown {
    padding: 0.3rem;
}

.crosswalk-mobile .func-row {
    padding: 0.4rem;
}

.crosswalk-mobile .func-name {
    font-size: 0.8rem;
}

.crosswalk-mobile .chapter-hierarchy .chapter-title {
    font-size: 0.85rem;
}

.crosswalk-mobile .mapping-detail-row {
    flex-direction: column;
    gap: 0.25rem;
}

.crosswalk-mobile .mapping-relationship {
    align-self: flex-start;
}

.crosswalk-mobile .mapping-connection {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    gap: 0.2rem;
}

/* ── Modal fallback at ≤640px (shouldn't fire — JS redirects to /crosswalk) ── */
@media (max-width: 640px) {
    .crosswalk-split-modal {
        width: 100vw;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
        margin: 0;
    }
    
    .modal-container.crosswalk-split-modal {
        margin: 0;
    }
    
    .crosswalk-split-body {
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }
    
    .crosswalk-visuals,
    .crosswalk-analysis {
        display: none;
        border: none;
        max-height: none;
    }
    
    .modal-close-floating {
        top: 0.4rem;
        right: 0.4rem;
        width: 36px;
        height: 36px;
        z-index: 1020;
    }
    
    .modal-close-floating svg {
        width: 18px;
        height: 18px;
    }
}

/* Chord Title */
.chord-title {
    text-align: center;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-text);
    margin: 0 0 var(--spacing-sm) 0;
    padding-top: var(--spacing-sm);
}

/* Treemap Info Card */
.treemap-info-card {
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: 0.4rem 0.6rem;
    margin-top: var(--spacing-xs);
    min-height: 50px;
    transition: all 0.15s ease;
}

.treemap-info-card .info-hint {
    color: var(--color-text-muted);
    font-size: 0.8rem;
    font-style: italic;
}

.treemap-info-card.active {
    background: var(--color-bg);
    border-color: var(--color-primary);
}

.treemap-info-card .info-content {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.4rem;
}

.treemap-info-card .info-color {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    flex-shrink: 0;
}

.treemap-info-card .info-text {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    flex: 1;
}

.treemap-info-card .info-text strong {
    font-size: 0.9rem;
    color: var(--color-text);
}

.treemap-info-card .info-count {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.treemap-info-card .info-desc {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin: 0;
    line-height: 1.4;
}

/* ============================================
   VERIFICATION PAGE
   ============================================ */

/* Hero */
.verification-hero {
    background: linear-gradient(135deg, var(--color-dark) 0%, var(--color-secondary) 100%);
    padding: var(--spacing-xl) 0 var(--spacing-lg);
    text-align: center;
    color: white;
}

.verification-kicker {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-primary);
    margin-bottom: var(--spacing-xs);
    font-weight: 600;
}

.kicker-link {
    color: inherit;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 2px;
}

.kicker-link:hover {
    color: white;
}

.book-link {
    color: var(--color-primary);
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 2px;
}

.book-link:hover {
    text-decoration-style: solid;
}

.verification-hero h1 {
    font-size: 3rem;
    color: white;
    margin-bottom: var(--spacing-sm);
    letter-spacing: -0.02em;
}

.verification-subtitle {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.85);
    max-width: 640px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Article body */
.verification-article {
    padding: var(--spacing-md) 0 var(--spacing-lg);
    background: white;
}

/* ── Paired layout: text + visual side by side ── */

.vg-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    max-width: 1140px;
    margin: 0 auto;
    padding: var(--spacing-md) var(--spacing-md);
    border-bottom: 1px solid var(--color-border);
}

.vg-pair:last-of-type {
    border-bottom: none;
}

/* Text pane */
.vg-text {
    position: relative;
}

.vg-text h2 {
    font-size: 1.5rem;
    margin-top: 0;
    margin-bottom: var(--spacing-sm);
    color: var(--color-dark);
}

.vg-text h2:not(:first-child) {
    margin-top: var(--spacing-md);
}

.vg-text p {
    font-size: 1.05rem;
    line-height: 1.8;
    margin-bottom: var(--spacing-sm);
}

.article-lede {
    font-size: 1.2rem;
    line-height: 1.8;
    color: var(--color-dark);
    margin-bottom: var(--spacing-md);
    font-weight: 400;
}

/* Visual pane */
.vg-visual {
    position: sticky;
    top: 90px;
    align-self: start;
}

.visual-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-light);
    margin-bottom: 0.75rem;
    padding: 0.4rem 0.75rem;
    background: var(--color-bg-alt);
    border-radius: 6px;
    border-left: 3px solid var(--color-border);
}

.visual-label-icon {
    font-size: 0.85rem;
}

.visual-label-warning {
    color: #92400e;
    background: #fef3c7;
    border-left-color: #f59e0b;
}

.visual-label-good {
    color: #166534;
    background: #f0fdf4;
    border-left-color: #22c55e;
}

.inline-mock {
    /* rendered by JS */
}

/* Swipe hints — hidden on desktop */
.vg-swipe-hint,
.vg-back-hint {
    display: none;
}

/* CTA row */
.vg-cta {
    max-width: 1140px;
    margin: 0 auto;
    padding: var(--spacing-md);
    text-align: center;
}

/* Article callout boxes */
.article-callout {
    position: relative;
    padding: 1.25rem 1.5rem;
    margin: var(--spacing-md) 0;
    background: var(--color-bg-alt);
    border-radius: 8px;
    border-left: 4px solid var(--color-primary);
}

.article-callout p {
    font-size: 1.05rem;
    font-weight: 500;
    line-height: 1.7;
    color: var(--color-dark);
    margin: 0;
}

.article-callout .callout-bar {
    display: none;
}

.article-callout.callout-problem {
    background: #fef2f2;
    border-left-color: #dc2626;
}

.article-callout.callout-problem p {
    color: #991b1b;
}

.article-callout.callout-insight {
    background: #f0fdf4;
    border-left-color: #22c55e;
}

.article-callout.callout-insight p {
    color: #166534;
}

.article-callout.callout-final {
    background: linear-gradient(135deg, var(--color-dark) 0%, var(--color-secondary) 100%);
    border-left-color: var(--color-primary);
    padding: 1.5rem 2rem;
}

.article-callout.callout-final p {
    color: rgba(255, 255, 255, 0.92);
    font-size: 1.1rem;
    font-style: italic;
}

/* ── Mobile: tap-to-expand visual ── */
@media (max-width: 768px) {
    .vg-pair {
        display: block;
        padding: var(--spacing-md);
        gap: 0;
    }

    .vg-text {
        overflow-wrap: break-word;
        word-break: break-word;
    }

    .vg-text h2 {
        font-size: 1.25rem;
    }

    .vg-text p {
        font-size: 0.95rem;
    }

    .vg-visual {
        position: static;
        display: none;
        margin-top: var(--spacing-sm);
        background: var(--color-bg-alt);
        border-radius: 10px;
        padding: var(--spacing-sm);
    }

    .vg-visual.vg-expanded {
        display: block;
        animation: vgSlideIn 0.3s ease-out;
    }

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

    .inline-mock {
        max-width: 100%;
        overflow-x: auto;
    }

    /* "See example" tap target */
    .vg-swipe-hint {
        display: flex;
        align-items: center;
        gap: 0.4rem;
        justify-content: flex-end;
        padding: 0.65rem 0;
        margin-top: var(--spacing-xs);
        font-size: 0.85rem;
        font-weight: 600;
        color: var(--color-primary);
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

    .vg-swipe-hint.vg-hint-collapse span:first-child {
        /* swap label when expanded */
    }

    .vg-swipe-chevron {
        font-size: 1.3rem;
        line-height: 1;
        transition: transform 0.25s ease;
    }

    .vg-swipe-hint.vg-hint-collapse .vg-swipe-chevron {
        transform: rotate(90deg);
    }

    /* "Back to text" tap target at top of visual */
    .vg-back-hint {
        display: flex;
        align-items: center;
        gap: 0.35rem;
        padding-bottom: 0.6rem;
        margin-bottom: 0.5rem;
        font-size: 0.8rem;
        font-weight: 600;
        color: var(--color-text-light);
        border-bottom: 1px solid var(--color-border);
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

    .vg-back-chevron {
        font-size: 1.2rem;
        line-height: 1;
    }

    .vg-cta {
        padding: var(--spacing-md);
    }

    .article-lede {
        font-size: 1.05rem;
    }

    .article-callout {
        padding: 1rem 1.25rem;
    }

    .article-callout p {
        font-size: 0.95rem;
    }

    .article-callout.callout-final {
        padding: 1.25rem 1.5rem;
    }
}

/* ── Mock Meeting Notes UI ── */

.mock-notes {
    background: white;
    border-radius: 12px;
    border: 1px solid var(--color-border);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.mock-header {
    padding: 1.25rem 1.5rem 1rem;
    border-bottom: 1px solid var(--color-border);
}

.mock-header-top {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.mock-app-icon {
    color: var(--color-text-light);
}

.mock-app-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.mock-auto-badge {
    margin-left: auto;
    font-size: 0.7rem;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    background: #f1f5f9;
    color: var(--color-text-light);
    font-weight: 500;
}

.mock-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--color-dark);
    margin-bottom: 0.35rem;
}

.mock-meta {
    font-size: 0.8rem;
    color: var(--color-text-light);
    margin-bottom: 0.75rem;
}

.mock-meta-sep {
    margin: 0 0.35rem;
}

.mock-attendees {
    display: flex;
    gap: 0.35rem;
}

.mock-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 700;
    color: white;
}

.mock-avatar-sm {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.55rem;
    font-weight: 700;
    color: white;
    vertical-align: middle;
}

/* Mock sections */
.mock-section {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #f1f5f9;
}

.mock-section:last-child {
    border-bottom: none;
}

.mock-section-heading {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-secondary);
    margin-bottom: 0.5rem;
}

.mock-section-text {
    font-size: 0.9rem;
    line-height: 1.65;
    color: var(--color-text);
    margin: 0;
}

/* Citations */
.mock-citation {
    font-size: 0.65rem;
    color: var(--color-primary);
    cursor: default;
    font-weight: 600;
    margin-left: 1px;
}

/* Interactive citation links with hover/tap popups */
.mock-cite-link {
    position: relative;
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--color-primary);
    cursor: pointer;
    margin-left: 1px;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 1px;
}

.mock-cite-popup {
    display: none;
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    width: 260px;
    padding: 0.6rem 0.75rem;
    background: var(--color-dark);
    color: rgba(255, 255, 255, 0.92);
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 400;
    line-height: 1.5;
    text-decoration: none;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    z-index: 20;
    pointer-events: none;
}

.mock-cite-popup::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--color-dark);
}

.cite-popup-time {
    display: block;
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: 0.25rem;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.cite-popup-text {
    display: block;
    font-style: italic;
    color: rgba(255, 255, 255, 0.8);
}

.mock-cite-link:hover .mock-cite-popup,
.mock-cite-link:focus .mock-cite-popup,
.mock-cite-link.cite-active .mock-cite-popup {
    display: block;
}

@media (max-width: 768px) {
    .mock-cite-popup {
        width: 220px;
        left: auto;
        right: -10px;
        transform: none;
    }
    .mock-cite-popup::after {
        left: auto;
        right: 16px;
        transform: none;
    }
}

.mock-citations-footer {
    padding: 1rem 1.5rem;
    background: #fafbfc;
    border-top: 1px solid var(--color-border);
}

.mock-ref {
    font-size: 0.75rem;
    color: var(--color-text-light);
    margin-bottom: 0.3rem;
    line-height: 1.5;
}

.mock-ref-time {
    font-weight: 600;
    color: var(--color-secondary);
}

.mock-ref-text {
    font-style: italic;
}

/* Action items */
.mock-action-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mock-action-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.5rem 0;
}

.mock-action-item + .mock-action-item {
    border-top: 1px solid #f8fafc;
}

.mock-checkbox {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    border: 2px solid #cbd5e1;
    flex-shrink: 0;
    margin-top: 2px;
}

.mock-action-content {
    flex: 1;
    min-width: 0;
}

.mock-action-text {
    font-size: 0.9rem;
    color: var(--color-text);
    display: block;
}

.mock-action-meta {
    font-size: 0.75rem;
    color: var(--color-text-light);
    display: block;
    margin-top: 0.15rem;
}

/* ── Trust Gap overlay ── */

.mock-trust-gap {
    position: relative;
}

.mock-trust-overlay {
    position: relative;
    padding: 1.5rem;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-bottom: 1px solid #fbbf24;
}

.trust-question-marks {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.trust-q {
    font-size: 2.5rem;
    font-weight: 800;
    color: #92400e;
    opacity: 0.5;
    animation: trustPulse 2s ease-in-out infinite;
}

.trust-q-2 { animation-delay: 0.3s; }
.trust-q-3 { animation-delay: 0.6s; }

@keyframes trustPulse {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.1); }
}

.trust-gap-callouts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.trust-callout {
    font-size: 0.85rem;
    color: #92400e;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.callout-icon {
    font-size: 1rem;
}

.mock-section-faded {
    opacity: 0.45;
}

@media (max-width: 640px) {
    .trust-gap-callouts {
        grid-template-columns: 1fr;
    }
}

/* ── Verification-aware mock ── */

.mock-verification-bar {
    padding: 0.75rem 1.5rem;
    background: #f0fdf4;
    border-bottom: 1px solid #bbf7d0;
}

.vbar-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    margin-bottom: 0.4rem;
    flex-wrap: wrap;
}

.vbar-count {
    font-weight: 600;
    color: #166534;
}

.vbar-sep {
    color: #86efac;
}

.vbar-reviewer {
    color: #15803d;
}

.vbar-progress {
    height: 4px;
    background: #dcfce7;
    border-radius: 2px;
    overflow: hidden;
}

.vbar-fill {
    height: 100%;
    background: #22c55e;
    border-radius: 2px;
    transition: width 0.6s ease;
}

/* Verification status borders */
.mock-section-v {
    border-left: 3px solid transparent;
    padding-left: calc(1.5rem - 3px);
}

.mock-section-v.v-verified {
    border-left-color: #22c55e;
}

.mock-section-v.v-flagged {
    border-left-color: #f59e0b;
    background: #fffbeb;
}

.mock-section-v.v-unreviewed {
    border-left-color: #cbd5e1;
    background: #fafbfc;
}

.mock-section-header-v {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

/* Verification badges */
.vbadge {
    font-size: 0.7rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    white-space: nowrap;
    flex-shrink: 0;
}

.vbadge-verified {
    background: #dcfce7;
    color: #166534;
}

.vbadge-flagged {
    background: #fef3c7;
    color: #92400e;
}

.vbadge-unreviewed {
    background: #f1f5f9;
    color: #94a3b8;
}

.vbadge-icon {
    font-size: 0.8rem;
    line-height: 1;
}

.vbadge-reviewer {
    font-weight: 600;
}

.vbadge-time {
    font-weight: 400;
    opacity: 0.8;
}

.vbadge-note {
    width: 100%;
    font-size: 0.7rem;
    margin-top: 0.2rem;
    font-style: italic;
    opacity: 0.9;
    line-height: 1.4;
    white-space: normal;
}

/* Verification-aware checkboxes */
.mock-checkbox-v {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
    font-size: 0.7rem;
    font-weight: 700;
}

.mock-checkbox-v.v-verified {
    background: #22c55e;
    color: white;
}

.mock-checkbox-v.v-flagged {
    background: #f59e0b;
    color: white;
}

.mock-checkbox-v.v-unreviewed {
    background: #e2e8f0;
    color: #94a3b8;
}

.mock-action-flag-note {
    font-size: 0.75rem;
    color: #92400e;
    background: #fef3c7;
    padding: 0.3rem 0.5rem;
    border-radius: 4px;
    margin-top: 0.3rem;
    font-style: italic;
    line-height: 1.4;
}

.mock-action-v.v-flagged {
    background: #fffbeb;
    margin: 0 -1.5rem;
    padding: 0.5rem 1.5rem;
}

/* ── Team Dashboard mock ── */

.mock-dashboard-table {
    padding: 0 1.5rem 1rem;
}

.mock-table-header {
    display: grid;
    grid-template-columns: 2fr 0.6fr 1.2fr 1.2fr;
    gap: 0.75rem;
    padding: 0.6rem 0;
    border-bottom: 2px solid var(--color-border);
}

.mock-th {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-light);
}

.mock-table-row {
    display: grid;
    grid-template-columns: 2fr 0.6fr 1.2fr 1.2fr;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f1f5f9;
    align-items: center;
}

.mock-td {
    font-size: 0.82rem;
}

.mock-td-meeting {
    font-weight: 500;
    color: var(--color-dark);
}

.mock-td-date {
    color: var(--color-text-light);
}

.mock-td-reviewer {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--color-text);
}

.mock-no-reviewer {
    color: #cbd5e1;
    font-style: italic;
}

.mock-td-coverage {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.mock-bar-label {
    font-size: 0.7rem;
    color: var(--color-text-light);
}

.mock-bar {
    height: 6px;
    background: #f1f5f9;
    border-radius: 3px;
    overflow: hidden;
}

.mock-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.6s ease;
}

.bar-complete { background: #22c55e; }
.bar-partial { background: #f59e0b; }
.bar-none { background: #e2e8f0; }

@media (max-width: 640px) {
    .mock-table-header,
    .mock-table-row {
        grid-template-columns: 1fr;
        gap: 0.25rem;
    }
    .mock-th-date, .mock-th-reviewer, .mock-th-coverage {
        display: none;
    }
    .mock-td-date { display: none; }
    .mock-td-reviewer { margin-top: 0.15rem; }
    .mock-td-coverage { margin-top: 0.15rem; }
}

/* ── Takeaway ── */

.mock-takeaway {
    max-width: 720px;
    margin: 0 auto;
}

.takeaway-comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.takeaway-col {
    background: white;
    border-radius: 12px;
    border: 1px solid var(--color-border);
    overflow: hidden;
}

.takeaway-col-header {
    padding: 0.75rem 1rem;
    font-weight: 600;
    font-size: 0.9rem;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.takeaway-today .takeaway-col-header {
    background: #fef2f2;
    color: #991b1b;
    border-bottom: 2px solid #fecaca;
}

.takeaway-could .takeaway-col-header {
    background: #f0fdf4;
    color: #166534;
    border-bottom: 2px solid #bbf7d0;
}

.takeaway-list {
    list-style: none;
    padding: 1rem;
    margin: 0;
}

.takeaway-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.4rem 0;
    font-size: 0.88rem;
    line-height: 1.5;
    color: var(--color-text);
}

.takeaway-x {
    color: #dc2626;
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 1px;
}

.takeaway-check {
    color: #16a34a;
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 1px;
}

.takeaway-quote {
    background: linear-gradient(135deg, var(--color-dark) 0%, var(--color-secondary) 100%);
    color: rgba(255, 255, 255, 0.9);
    padding: 1.5rem 2rem;
    border-radius: 12px;
    font-size: 1.05rem;
    line-height: 1.7;
    font-style: italic;
    border-left: 4px solid var(--color-primary);
    margin: 0;
}

@media (max-width: 640px) {
    .takeaway-comparison {
        grid-template-columns: 1fr;
    }
}

/* Verification CTA spacing */

.verification-cta {
    display: flex;
    gap: var(--spacing-sm);
    justify-content: center;
}

.btn-outline {
    background: transparent;
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
}

.btn-outline:hover {
    background: var(--color-primary);
    color: white;
}

/* Responsive overrides for verification page */
@media (max-width: 768px) {
    .verification-hero h1 {
        font-size: 2.25rem;
    }
    .verification-subtitle {
        font-size: 1.05rem;
    }
    .mock-section {
        padding: 0.75rem 1rem;
    }
    .mock-header {
        padding: 1rem;
    }
    .verification-cta {
        flex-direction: column;
    }
    .verification-cta .btn {
        text-align: center;
    }
}

/* ============================================
   BLOG PAGE
   ============================================ */

.blog-hero {
    background: linear-gradient(135deg, var(--color-bg) 0%, var(--color-bg-alt) 100%);
    padding: var(--spacing-lg) 0;
    text-align: center;
}

.blog-hero h1 {
    font-size: 2.5rem;
    margin-bottom: var(--spacing-xs);
}

.blog-hero .hero-description {
    color: var(--color-text-light);
    font-size: 1.05rem;
    max-width: 540px;
    margin: 0 auto;
}

.blog-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    max-width: 800px;
    margin: 0 auto;
}

.blog-card {
    display: flex;
    gap: var(--spacing-md);
    padding: var(--spacing-md) var(--spacing-lg);
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid var(--color-border);
    transition: var(--transition-base);
    text-decoration: none;
    color: inherit;
}

.blog-card:hover {
    border-color: var(--color-primary);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.blog-card-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 60px;
    padding-right: var(--spacing-md);
    border-right: 1px solid var(--color-border);
    flex-shrink: 0;
}

.blog-card-month {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.blog-card-year {
    font-size: 0.8rem;
    color: var(--color-text-light);
}

.blog-card-content {
    flex: 1;
    min-width: 0;
}

.blog-card-tag {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-primary);
    background: rgba(148, 105, 77, 0.1);
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    margin-bottom: 0.4rem;
}

.blog-card-content h2 {
    font-size: 1.25rem;
    margin-bottom: 0.35rem;
    color: var(--color-dark);
}

.blog-card-content p {
    font-size: 0.9rem;
    color: var(--color-text-light);
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

.blog-card-read {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--color-primary);
}

@media (max-width: 640px) {
    .blog-card {
        flex-direction: column;
        padding: var(--spacing-md);
    }
    .blog-card-date {
        flex-direction: row;
        gap: 0.4rem;
        border-right: none;
        border-bottom: 1px solid var(--color-border);
        padding-right: 0;
        padding-bottom: var(--spacing-sm);
        justify-content: flex-start;
    }
}

/* ============================================
   ESSAY BLOG POST LAYOUT
   ============================================ */

.essay-hero {
    background: linear-gradient(135deg, var(--color-dark) 0%, var(--color-secondary) 100%);
    padding: var(--spacing-xl) 0 var(--spacing-lg);
    text-align: center;
    color: white;
}

.essay-hero .kicker {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-primary);
    margin-bottom: var(--spacing-xs);
}

.essay-hero .kicker a {
    color: inherit;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 3px;
}

.essay-hero .kicker a:hover {
    text-decoration-style: solid;
}

.essay-hero h1 {
    font-size: 2.75rem;
    color: white;
    margin-bottom: var(--spacing-sm);
    letter-spacing: -0.02em;
}

.essay-hero .subtitle {
    font-size: 1.15rem;
    color: rgba(255, 255, 255, 0.85);
    max-width: 680px;
    margin: 0 auto;
    line-height: 1.6;
}

.essay-body {
    padding: var(--spacing-lg) 0;
    background: white;
}

.essay-body .container {
    max-width: 760px;
}

.essay-body h2 {
    font-size: 1.65rem;
    color: var(--color-dark);
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    letter-spacing: -0.01em;
}

.essay-body p {
    font-size: 1.08rem;
    line-height: 1.85;
    color: var(--color-text);
    margin-bottom: 1.25rem;
}

.essay-body ul, .essay-body ol {
    margin-bottom: 1.25rem;
    padding-left: 1.5rem;
}

.essay-body li {
    font-size: 1.08rem;
    line-height: 1.75;
    color: var(--color-text);
    margin-bottom: 0.5rem;
}

.essay-body li strong {
    color: var(--color-dark);
}

/* Essay tables */
.essay-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0 1.75rem;
    font-size: 0.95rem;
    line-height: 1.6;
}

.essay-body thead th {
    text-align: left;
    font-weight: 700;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-light);
    padding: 0.6rem 1rem;
    border-bottom: 2px solid var(--color-dark);
}

.essay-body tbody td {
    padding: 0.75rem 1rem;
    vertical-align: top;
    border-bottom: 1px solid var(--color-border);
    color: var(--color-text);
}

.essay-body tbody tr:last-child td {
    border-bottom: none;
}

.essay-body tbody td:first-child {
    font-weight: 600;
    color: var(--color-dark);
    white-space: nowrap;
}

@media (max-width: 640px) {
    .essay-body table {
        font-size: 0.88rem;
    }
    .essay-body thead th,
    .essay-body tbody td {
        padding: 0.5rem 0.6rem;
    }
    .essay-body tbody td:first-child {
        white-space: normal;
    }
}

.essay-body .article-lede {
    font-size: 1.2rem;
    line-height: 1.8;
    color: var(--color-text);
    margin-bottom: 1.5rem;
}

/* ── Thumbnail strip (in-article) ── */
.gallery-strip {
    margin: 2rem -1rem;
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    padding: 0.5rem 1rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.gallery-strip-thumb {
    flex: 0 0 auto;
    width: 160px;
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 6px;
    overflow: hidden;
    background: var(--color-dark);
    transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
    padding: 0;
    position: relative;
}

.gallery-strip-thumb:hover,
.gallery-strip-thumb:focus-visible {
    border-color: var(--color-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
}

.gallery-strip-thumb img {
    width: 100%;
    display: block;
    border-radius: 4px;
}

.gallery-strip-thumb .strip-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.3rem 0.4rem;
    font-size: 0.65rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(transparent, rgba(0,0,0,0.75));
    text-align: center;
    line-height: 1.3;
}

.gallery-strip-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: var(--color-text-light);
    margin-top: 0.25rem;
    text-align: center;
}

/* ── Gallery modal ── */
.gallery-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s, visibility 0.25s;
}

.gallery-modal.open {
    opacity: 1;
    visibility: visible;
}

.gallery-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.88);
}

.gallery-modal-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    max-width: min(1400px, 96vw);
    max-height: 96vh;
    width: 96vw;
    gap: 0;
}

.gallery-close {
    position: absolute;
    top: -0.25rem;
    right: -0.25rem;
    z-index: 2;
    width: 40px;
    height: 40px;
    background: rgba(0,0,0,0.6);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 50%;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    line-height: 1;
}

.gallery-close:hover {
    background: rgba(255,255,255,0.15);
}

.gallery-stage {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 0;
    flex: 1 1 auto;
}

.gallery-nav {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.gallery-nav:hover {
    background: rgba(255,255,255,0.18);
}

.gallery-image-wrap {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.gallery-image {
    max-width: 100%;
    max-height: 72vh;
    border-radius: 6px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.4);
    object-fit: contain;
    cursor: zoom-in;
}

.gallery-image.zoomed {
    max-height: none;
    max-width: none;
    width: auto;
    height: auto;
    cursor: zoom-out;
}

.gallery-image-wrap.zoomed {
    overflow: auto;
    cursor: zoom-out;
}

.gallery-info {
    text-align: center;
    padding: 0.5rem 1rem 0.25rem;
    flex: 0 0 auto;
}

.gallery-counter {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.45);
    margin-bottom: 0.25rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.gallery-title {
    font-size: 1.1rem;
    color: white;
    margin-bottom: 0.4rem;
    font-weight: 600;
}

.gallery-observation {
    font-size: 0.92rem;
    color: rgba(255,255,255,0.72);
    line-height: 1.6;
    max-width: 720px;
    margin: 0 auto;
}

.gallery-thumbs-row {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.35rem 0 0.15rem;
    flex: 0 0 auto;
}

.gallery-thumb {
    width: 72px;
    height: 44px;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    opacity: 0.5;
    transition: opacity 0.2s, border-color 0.2s;
    padding: 0;
    background: none;
}

.gallery-thumb:hover {
    opacity: 0.85;
}

.gallery-thumb.active {
    opacity: 1;
    border-color: var(--color-primary);
}

.gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Modal responsive */
@media (max-width: 768px) {
    .gallery-strip-thumb {
        width: 130px;
    }
    .gallery-nav {
        flex: 0 0 36px;
        width: 36px;
        height: 36px;
    }
    .gallery-nav svg {
        width: 18px;
        height: 18px;
    }
    .gallery-image {
        max-height: 55vh;
    }
    .gallery-observation {
        font-size: 0.85rem;
    }
    .gallery-thumb {
        width: 52px;
        height: 32px;
    }
    .gallery-close {
        top: -12px;
        right: -4px;
    }
}

@media (max-width: 480px) {
    .gallery-strip-thumb {
        width: 110px;
    }
    .gallery-stage {
        gap: 0.25rem;
    }
    .gallery-nav {
        flex: 0 0 30px;
        width: 30px;
        height: 30px;
    }
    .gallery-image {
        max-height: 48vh;
        border-radius: 4px;
    }
    .gallery-info {
        padding: 0.5rem 0.5rem 0.25rem;
    }
    .gallery-title {
        font-size: 0.95rem;
    }
    .gallery-observation {
        font-size: 0.8rem;
    }
    .gallery-thumb {
        width: 42px;
        height: 26px;
    }
}

/* Essay CTA */
.essay-cta {
    text-align: center;
    padding: var(--spacing-lg) 0 var(--spacing-md);
    border-top: 1px solid var(--color-border);
    margin-top: var(--spacing-lg);
    display: flex;
    gap: var(--spacing-sm);
    justify-content: center;
}

/* Essay responsive */
@media (max-width: 768px) {
    .essay-hero h1 {
        font-size: 2rem;
    }
    .essay-hero .subtitle {
        font-size: 1.05rem;
    }
    .essay-body h2 {
        font-size: 1.4rem;
    }
    .essay-body p,
    .essay-body li {
        font-size: 1rem;
    }
    .gallery-strip {
        margin-left: 0;
        margin-right: 0;
        padding-left: 0;
        padding-right: 0;
    }
    .essay-cta {
        flex-direction: column;
    }
    .essay-cta .btn {
        text-align: center;
    }
}

@media (max-width: 480px) {
    .essay-hero h1 {
        font-size: 1.65rem;
    }
}
