/* ============================================
   BANGLADESH LNG SUPPLY FRAMEWORK
   Station Dhaka Market Research Team
   Version 4.1 - Mobile-Optimized Dashboard
   ============================================ */

:root {
    --primary: #003366;
    --primary-light: #004488;
    --secondary: #8B0000;
    --success: #228B22;
    --warning: #CC7000;
    --danger: #B22222;
    --info: #1E3A8A;
    --bg-primary: #FFFFFF;
    --bg-secondary: #F8F9FA;
    --bg-tertiary: #EEF2F7;
    --text-primary: #1A202C;
    --text-secondary: #4A5568;
    --text-muted: #718096;
    --border-light: #E2E8F0;
    --border-medium: #CBD5E0;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --font-sans: 'Segoe UI', -apple-system, BlinkMacSystemFont, Arial, sans-serif;
    --font-serif: Georgia, 'Times New Roman', serif;
    --font-mono: Consolas, Monaco, 'Courier New', monospace;
    --header-height: 56px;
    --nav-height: 44px;
    --touch-target: 44px;
}

*, ::after, ::before { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-height) + var(--nav-height) + 20px); -webkit-text-size-adjust: 100%; }
body { font-family: var(--font-sans); background: var(--bg-secondary); color: var(--text-primary); line-height: 1.6; min-height: 100vh; padding-top: calc(var(--header-height) + var(--nav-height)); }

/* Fluid Typography */
h1, h2, h3, h4 { font-weight: 600; line-height: 1.3; color: var(--primary); }
h1 { font-size: clamp(1.5rem, 4vw, 1.75rem); font-family: var(--font-serif); }
h2 { font-size: clamp(1.1rem, 3vw, 1.25rem); }
h3 { font-size: clamp(1rem, 2.5vw, 1.1rem); }
p { margin-bottom: 1rem; font-size: clamp(0.9rem, 2.5vw, 1rem); }
a { color: var(--primary); text-decoration: none; transition: color 0.2s; }
a:hover { text-decoration: underline; }
a:focus { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ============================================
   SKIP LINK - ACCESSIBILITY
   ============================================ */
.skip-link {
    position: absolute; top: -100px; left: 0;
    background: var(--primary); color: #fff;
    padding: 1rem 1.5rem; z-index: 9999;
    text-decoration: none; font-weight: 600;
    border-radius: 0 0 var(--radius-md) 0;
    transition: top 0.3s;
    min-height: var(--touch-target);
}
.skip-link:focus { top: 0; outline: 3px solid var(--warning); }

/* ============================================
   ABBREVIATION LINKS & TOOLTIPS
   ============================================ */
.abbr-link {
    color: var(--info); text-decoration: underline dotted;
    cursor: help; font-weight: 500; position: relative;
    /* Increased touch target */
    padding: 0.25rem 0.1rem;
    margin: -0.25rem -0.1rem;
}
.abbr-link:hover { background: #DBEAFE; text-decoration: none; }

/* Tooltip Container */
.abbr-tooltip {
    position: absolute; bottom: calc(100% + 8px); left: 50%;
    transform: translateX(-50%); z-index: 1000;
    background: var(--primary); color: #fff;
    padding: 0.875rem 1rem; border-radius: var(--radius-md);
    min-width: 260px; max-width: 320px;
    box-shadow: var(--shadow-lg); font-size: 0.85rem;
    opacity: 0; visibility: hidden; pointer-events: none;
    transition: opacity 0.2s, visibility 0.2s;
}
.abbr-tooltip::after {
    content: ''; position: absolute; top: 100%; left: 50%;
    transform: translateX(-50%);
    border: 8px solid transparent; border-top-color: var(--primary);
}
.abbr-tooltip.visible { opacity: 1; visibility: visible; pointer-events: auto; }
.abbr-tooltip-title { font-weight: 700; font-size: 1rem; margin-bottom: 0.35rem; color: #fff; }
.abbr-tooltip-full { font-size: 0.85rem; opacity: 0.95; margin-bottom: 0.35rem; }
.abbr-tooltip-desc { font-size: 0.8rem; opacity: 0.9; line-height: 1.5; }
.abbr-tooltip-link {
    display: inline-block; margin-top: 0.75rem; padding: 0.5rem 0.75rem;
    background: rgba(255,255,255,0.2); border-radius: var(--radius-sm);
    color: #fff; font-size: 0.8rem; text-decoration: none;
    min-height: var(--touch-target); line-height: 1.5;
}
.abbr-tooltip-link:hover { background: rgba(255,255,255,0.3); text-decoration: none; }
/* Touch device: tap to dismiss */
.abbr-tooltip-close {
    position: absolute; top: 0.5rem; right: 0.5rem;
    background: rgba(255,255,255,0.2); border: none;
    color: #fff; width: 28px; height: 28px;
    border-radius: 50%; cursor: pointer;
    display: none; align-items: center; justify-content: center;
    font-size: 1.2rem; line-height: 1;
}

/* ============================================
   DOCUMENT LINKS WITH PDF INDICATOR
   ============================================ */
.doc-link {
    display: inline-flex; align-items: center; gap: 0.35rem;
    color: var(--primary); font-weight: 500;
    padding: 0.5rem 0.75rem; background: #EFF6FF;
    border-radius: var(--radius-sm); font-size: 0.85rem; transition: 0.2s;
    min-height: var(--touch-target);
}
.doc-link:hover { background: #DBEAFE; text-decoration: none; transform: translateY(-1px); }
.doc-link::before { content: ''; display: inline-block; width: 18px; height: 18px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23003366' stroke-width='2'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpolyline points='14 2 14 8 20 8'/%3E%3Cline x1='16' y1='13' x2='8' y2='13'/%3E%3Cline x1='16' y1='17' x2='8' y2='17'/%3E%3Cline x1='10' y1='9' x2='8' y2='9'/%3E%3C/svg%3E") center/contain no-repeat; flex-shrink: 0; }
.doc-link[href$=".pdf"]::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23DC2626'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8l-6-6z'/%3E%3Cpath fill='%23fff' d='M14 2v6h6'/%3E%3Ctext x='6' y='18' font-size='6' fill='%23fff' font-weight='bold'%3EPDF%3C/text%3E%3C/svg%3E"); }
.doc-link .pdf-size { font-size: 0.7rem; color: var(--text-muted); margin-left: 0.25rem; }

.source-link { font-size: 0.8rem; color: var(--info); margin-left: 0.25rem; padding: 0.25rem; }
.source-link::before { content: '['; }
.source-link::after { content: ']'; }

/* ============================================
   HEADER - FIXED (Station Dhaka Style)
   ============================================ */
.site-header {
    background: rgba(12, 13, 16, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: #fff;
    padding: 0 2rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    position: fixed; top: 0; left: 0; right: 0;
    z-index: 1000;
    height: var(--header-height);
}
.header-content {
    max-width: 1400px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}
.header-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
}
.logo-icon {
    width: 34px; height: 34px;
    border: 1.5px solid #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 11px;
    letter-spacing: -0.5px;
    flex-shrink: 0;
    color: #fff;
    text-decoration: none;
    background: transparent;
}
.logo-text {
    font-weight: 600; font-size: 14px;
    color: #fff; white-space: nowrap;
    text-decoration: none;
    flex-shrink: 0;
}
.logo-icon:hover, .logo-text:hover {
    text-decoration: none;
    opacity: 0.85;
}
.site-title-group {
    margin-left: 1rem;
    padding-left: 1rem;
    border-left: 1px solid rgba(255,255,255,0.2);
    min-width: 0;
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 34px;
}
.site-title {
    font-family: var(--font-sans);
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
    margin: 0;
    padding: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.2px;
    line-height: 1.2;
}
.site-subtitle {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.65);
    white-space: nowrap;
    font-weight: 400;
    letter-spacing: 0.2px;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
    padding: 0;
    line-height: 1.2;
}
.header-meta {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-size: 0.8rem;
    flex-shrink: 0;
}
.classification-badge {
    background: var(--secondary); color: #fff;
    padding: 0.2rem 0.5rem; border-radius: var(--radius-sm);
    font-size: 0.65rem; font-weight: 700;
    letter-spacing: 0.5px; white-space: nowrap;
}

/* Header Buttons - Touch Friendly (Dark Theme) */
.print-btn, .search-trigger, .journey-btn {
    display: flex; align-items: center; justify-content: center; gap: 0.5rem;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.25);
    color: rgba(255,255,255,0.8);
    border-radius: var(--radius-sm);
    cursor: pointer; transition: all 0.2s;
    min-width: var(--touch-target); min-height: var(--touch-target);
    padding: 0.5rem 0.875rem; flex-shrink: 0;
    font-size: 0.8rem; font-weight: 500;
}
.print-btn:hover, .search-trigger:hover, .journey-btn:hover {
    border-color: var(--primary-light);
    color: #fff;
    background: rgba(0,51,102,0.3);
    box-shadow: 0 0 16px rgba(0,51,102,0.2);
}
.print-btn:focus, .search-trigger:focus, .journey-btn:focus {
    outline: 2px solid var(--primary-light);
    outline-offset: 2px;
}
.print-btn svg, .search-trigger svg { width: 16px; height: 16px; flex-shrink: 0; }

.journey-btn { font-size: 0.8rem; font-weight: 500; max-width: 240px; }
.journey-btn-icon { font-size: 1rem; flex-shrink: 0; }
.journey-btn-text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.2; min-width: 0; }
.journey-btn-label { font-size: 0.6rem; opacity: 0.7; }
.journey-btn-current {
    font-weight: 600; font-size: 0.75rem;
    max-width: 180px; overflow: hidden;
    text-overflow: ellipsis; white-space: nowrap;
}

.search-trigger-kbd {
    background: rgba(255,255,255,0.15); padding: 0.15rem 0.4rem;
    border-radius: 3px; font-size: 0.65rem; font-family: var(--font-mono);
    color: rgba(255,255,255,0.7);
}

/* ============================================
   NAVIGATION - FIXED
   ============================================ */
.site-nav {
    background: var(--bg-primary);
    border-bottom: 2px solid var(--primary);
    padding: 0 1.5rem;
    position: fixed;
    top: var(--header-height);
    left: 0; right: 0;
    z-index: 999;
    height: var(--nav-height);
    box-shadow: var(--shadow-sm);
}
/* Overflow fade indicator */
.site-nav::after {
    content: '';
    position: absolute;
    top: 0; right: 0; bottom: 2px;
    width: 50px;
    background: linear-gradient(to right, transparent, var(--bg-primary) 80%);
    pointer-events: none;
    z-index: 2;
    opacity: 1;
    transition: opacity 0.2s;
}
.site-nav.scrolled-end::after { opacity: 0; }

.nav-content {
    max-width: 1400px; margin: 0 auto;
    display: flex; overflow-x: auto; gap: 0.25rem;
    height: 100%; align-items: stretch;
    padding-right: 40px; /* Space for fade indicator */
}
.nav-link {
    display: flex; align-items: center; gap: 0.35rem;
    padding: 0 0.9rem; color: var(--text-secondary);
    font-size: 0.8rem; font-weight: 600; white-space: nowrap;
    border-bottom: 3px solid transparent; transition: 0.2s; position: relative;
    min-height: var(--nav-height);
}
.nav-link:hover { color: var(--primary); background: var(--bg-tertiary); text-decoration: none; }
.nav-link.active { color: var(--primary); border-bottom-color: var(--primary); background: var(--bg-tertiary); }
.nav-link.priority::after { content: ''; position: absolute; top: 8px; right: 6px; width: 6px; height: 6px; background: #B8860B; border-radius: 50%; }
.nav-link:focus { outline: 2px solid var(--primary); outline-offset: -2px; }
.nav-icon { width: 16px; height: 16px; opacity: 0.7; }

/* Hide scrollbar but keep functionality */
.nav-content::-webkit-scrollbar { height: 0; }
.nav-content { scrollbar-width: none; -ms-overflow-style: none; }

/* ============================================
   MOBILE NAVIGATION
   ============================================ */
.mobile-menu-btn {
    display: none; background: none; border: none;
    color: #fff; cursor: pointer;
    border-radius: var(--radius-sm);
    min-width: var(--touch-target); min-height: var(--touch-target);
    align-items: center; justify-content: center;
}
.mobile-menu-btn:hover { background: rgba(255,255,255,0.15); }
.mobile-menu-btn svg { width: 24px; height: 24px; }

.mobile-nav-overlay {
    display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5); z-index: 2001;
    -webkit-tap-highlight-color: transparent;
}
.mobile-nav-overlay.active { display: block; }

.mobile-nav-drawer {
    position: fixed; top: 0; left: -300px; width: 300px; max-width: 85vw; height: 100%;
    background: var(--bg-primary); z-index: 2002;
    box-shadow: var(--shadow-lg); transition: left 0.3s ease;
    overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.mobile-nav-drawer.active { left: 0; }

.mobile-nav-header {
    background: var(--primary); color: #fff;
    padding: 1rem 1.25rem; display: flex; justify-content: space-between; align-items: center;
    min-height: var(--header-height); position: sticky; top: 0;
}
.mobile-nav-header h3 { font-size: 1.1rem; margin: 0; color: #fff; }
.mobile-nav-close {
    background: rgba(255,255,255,0.15); border: none; color: #fff;
    font-size: 1.25rem; cursor: pointer;
    min-width: var(--touch-target); min-height: var(--touch-target);
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
}

.mobile-nav-links { padding: 0.5rem 0; }
.mobile-nav-link {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 1rem 1.25rem; color: var(--text-primary);
    font-size: 1rem; font-weight: 500; border-bottom: 1px solid var(--border-light);
    transition: 0.2s;
    min-height: 56px; /* Larger than 44px for comfortable tapping */
}
.mobile-nav-link:hover, .mobile-nav-link:active { background: var(--bg-tertiary); text-decoration: none; }
.mobile-nav-link.active { background: #EFF6FF; color: var(--primary); border-left: 4px solid var(--primary); }
.mobile-nav-link.priority::after { content: ''; width: 10px; height: 10px; background: #B8860B; border-radius: 50%; margin-left: auto; }

/* Journey button in mobile drawer */
.mobile-nav-journey {
    padding: 1rem 1.25rem; border-bottom: 1px solid var(--border-light);
    background: var(--bg-tertiary);
}
.mobile-nav-journey-btn {
    width: 100%; padding: 0.875rem 1rem;
    background: var(--primary); color: #fff;
    border: none; border-radius: var(--radius-md);
    font-size: 0.95rem; font-weight: 600; cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 0.5rem;
    min-height: var(--touch-target);
}

/* ============================================
   BREADCRUMB
   ============================================ */
.breadcrumb {
    max-width: 1400px; margin: 0 auto; padding: 0.75rem 1.5rem;
    font-size: clamp(0.75rem, 2vw, 0.85rem); color: var(--text-muted);
    display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
}
.breadcrumb-item { display: flex; align-items: center; gap: 0.5rem; }
.breadcrumb-item a { color: var(--primary); padding: 0.25rem 0; }
.breadcrumb-item a:hover { text-decoration: underline; }
.breadcrumb-separator { color: var(--border-medium); }
.breadcrumb-current { font-weight: 600; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 200px; }

/* ============================================
   SEARCH
   ============================================ */
.search-modal {
    display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6); z-index: 3000;
    justify-content: center; align-items: flex-start; padding: 5vh 1rem;
}
.search-modal.active { display: flex; }

.search-container {
    background: var(--bg-primary); border-radius: var(--radius-lg);
    width: 100%; max-width: 600px; box-shadow: 0 25px 50px rgba(0,0,0,0.25);
    animation: searchIn 0.2s ease-out;
    max-height: 90vh; display: flex; flex-direction: column;
}
@keyframes searchIn { from { opacity: 0; transform: translateY(-20px); } }

.search-input-wrapper {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 1rem 1.25rem; border-bottom: 1px solid var(--border-light);
    flex-shrink: 0;
}
.search-input-wrapper svg { width: 22px; height: 22px; color: var(--text-muted); flex-shrink: 0; }
.search-input {
    flex: 1; border: none; outline: none; font-size: 1.1rem;
    font-family: var(--font-sans); color: var(--text-primary);
    min-height: var(--touch-target);
}
.search-input::placeholder { color: var(--text-muted); }
.search-close {
    background: var(--bg-tertiary); border: none; font-size: 0.8rem; color: var(--text-secondary);
    cursor: pointer; padding: 0.5rem 0.75rem; border-radius: var(--radius-sm);
    min-height: 36px; font-weight: 600;
}
.search-close:hover { background: #E2E8F0; }

.search-results { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.search-results-empty { padding: 2.5rem 1.5rem; text-align: center; color: var(--text-muted); font-size: 1rem; }
.search-result {
    display: block; padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-light); transition: 0.15s;
    min-height: 72px;
}
.search-result:hover, .search-result:focus { background: var(--bg-tertiary); text-decoration: none; outline: none; }
.search-result.focus { background: #EFF6FF; }
.search-result-title { font-weight: 600; color: var(--primary); font-size: 1rem; margin-bottom: 0.25rem; }
.search-result-desc { font-size: 0.875rem; color: var(--text-muted); line-height: 1.4; }
.search-result-match { background: #FEF08A; padding: 0 0.15rem; border-radius: 2px; }

.search-footer {
    padding: 0.875rem 1.25rem; background: var(--bg-tertiary);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    font-size: 0.8rem; color: var(--text-muted);
    display: flex; gap: 1rem; flex-shrink: 0;
}
.search-footer kbd {
    background: var(--bg-primary); padding: 0.2rem 0.4rem;
    border-radius: 3px; border: 1px solid var(--border-light);
    font-family: var(--font-mono); font-size: 0.75rem;
}

/* ============================================
   TABLE OF CONTENTS
   ============================================ */
.toc-container {
    background: var(--bg-primary); border: 1px solid var(--border-light);
    border-radius: var(--radius-md); margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}
.toc-header {
    padding: 0.875rem 1rem; background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-light);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    display: flex; justify-content: space-between; align-items: center;
    cursor: pointer; transition: 0.2s;
    min-height: var(--touch-target);
}
.toc-header:hover { background: #E2E8F0; }
.toc-header h3 { font-size: 0.9rem; margin: 0; display: flex; align-items: center; gap: 0.5rem; }
.toc-toggle { background: none; border: none; cursor: pointer; color: var(--primary); font-size: 0.9rem; transition: transform 0.2s; padding: 0.5rem; }
.toc-container.collapsed .toc-toggle { transform: rotate(-90deg); }
.toc-container.collapsed .toc-body { display: none; }

.toc-body { padding: 0.875rem 1rem; }
.toc-list { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.toc-item a {
    display: inline-flex; align-items: center; padding: 0.5rem 0.875rem;
    background: var(--bg-tertiary); border-radius: var(--radius-sm);
    font-size: 0.85rem; color: var(--text-secondary); transition: 0.2s;
    min-height: 40px;
}
.toc-item a:hover { background: #DBEAFE; color: var(--primary); text-decoration: none; }
.toc-item a.active { background: var(--primary); color: #fff; }

/* ============================================
   RELATED PAGES
   ============================================ */
.related-pages {
    background: var(--bg-tertiary); border: 1px solid var(--border-light);
    border-radius: var(--radius-md); padding: 1.25rem; margin-top: 2rem;
}
.related-pages h3 { font-size: 1rem; margin-bottom: 1rem; display: flex; align-items: center; gap: 0.5rem; }
.related-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.related-card {
    background: var(--bg-primary); border: 1px solid var(--border-light);
    border-radius: var(--radius-md); padding: 1rem; transition: 0.2s;
    min-height: 80px;
}
.related-card:hover { border-color: var(--primary); box-shadow: var(--shadow-md); transform: translateY(-2px); text-decoration: none; }
.related-card-title { font-weight: 600; color: var(--primary); font-size: 0.95rem; margin-bottom: 0.35rem; }
.related-card-desc { font-size: 0.85rem; color: var(--text-muted); line-height: 1.4; }

/* ============================================
   BACK TO TOP
   ============================================ */
.back-to-top {
    position: fixed; bottom: 1.5rem; right: 1.5rem;
    width: 48px; height: 48px;
    background: var(--primary); color: #fff;
    border: none; border-radius: 50%;
    cursor: pointer; box-shadow: var(--shadow-lg);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; visibility: hidden; transform: translateY(20px);
    transition: all 0.3s ease; z-index: 900;
    -webkit-tap-highlight-color: transparent;
}
.back-to-top.visible { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover { background: var(--primary-light); }
.back-to-top:active { transform: scale(0.95); }
.back-to-top:focus { outline: 3px solid var(--warning); outline-offset: 2px; }
.back-to-top svg { width: 22px; height: 22px; }

/* ============================================
   MODAL
   ============================================ */
.modal-overlay {
    display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5); z-index: 2000;
    justify-content: center; align-items: center; padding: 1rem;
    -webkit-tap-highlight-color: transparent;
}
.modal-overlay.active { display: flex; }
.journey-modal {
    background: white; border-radius: var(--radius-lg);
    max-width: 900px; width: 100%; max-height: 90vh; overflow-y: auto;
    box-shadow: 0 25px 50px rgba(0,0,0,0.25); animation: modalIn 0.2s ease-out;
    -webkit-overflow-scrolling: touch;
}
@keyframes modalIn { from { opacity: 0; transform: scale(0.95) translateY(-10px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.modal-header {
    padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--border-light);
    display: flex; justify-content: space-between; align-items: center;
    position: sticky; top: 0; background: white; z-index: 1;
}
.modal-header h2 { margin: 0; font-size: clamp(1.1rem, 3vw, 1.2rem); }
.modal-close {
    background: var(--bg-tertiary); border: none; font-size: 1.25rem;
    cursor: pointer; color: var(--text-secondary);
    min-width: var(--touch-target); min-height: var(--touch-target);
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { background: #E2E8F0; color: var(--text-primary); }
.modal-body { padding: 1.5rem; }
.modal-footer { padding: 1rem 1.5rem; border-top: 1px solid var(--border-light); text-align: center; font-size: 0.85rem; color: var(--text-muted); background: var(--bg-tertiary); }

/* Journey Cards */
.journey-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.journey-card {
    border: 2px solid var(--border-light); border-radius: var(--radius-md);
    padding: 1.25rem; cursor: pointer; transition: 0.2s;
    background: var(--bg-primary); position: relative;
    min-height: 120px;
}
.journey-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--primary); }
.journey-card:focus { outline: 3px solid var(--primary); outline-offset: 2px; }
.journey-card:active { transform: scale(0.98); }
.journey-card.selected { border-color: var(--primary); background: #EFF6FF; }
.journey-card.selected::after {
    content: ''; position: absolute; top: 0.75rem; right: 0.75rem;
    width: 24px; height: 24px; background: var(--success) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center/14px no-repeat;
    border-radius: 50%;
}
.journey-card-icon { font-size: 2rem; margin-bottom: 0.5rem; }
.journey-card-title { font-weight: 700; color: var(--primary); margin-bottom: 0.35rem; font-size: 0.95rem; }
.journey-card-desc { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.5rem; line-height: 1.4; }
.journey-card-focus { font-size: 0.8rem; color: var(--text-secondary); }
.journey-card-focus strong { color: var(--primary); }

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content { max-width: 1400px; margin: 0 auto; padding: 1.5rem; animation: fadeIn 0.3s ease-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } }

.page-header { margin-bottom: 1.5rem; padding-bottom: 1rem; border-bottom: 2px solid var(--border-medium); }
.page-header h1 { margin-bottom: 0.25rem; }
.page-header .lead { font-size: clamp(0.9rem, 2.5vw, 1rem); color: var(--text-secondary); margin: 0; }

/* Cards */
.card { background: var(--bg-primary); border: 1px solid var(--border-light); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); margin-bottom: 1.25rem; transition: box-shadow 0.2s; }
.card:hover { box-shadow: var(--shadow-md); }
.card-header { padding: 0.875rem 1rem; background: linear-gradient(to bottom, #FAFBFC, #F5F7FA); border-bottom: 1px solid var(--border-light); border-radius: var(--radius-md) var(--radius-md) 0 0; }
.card-header h2 { font-size: clamp(0.95rem, 2.5vw, 1rem); margin: 0; display: flex; align-items: center; gap: 0.5rem; }
.card-body { padding: 1rem; }
.card[id] { scroll-margin-top: calc(var(--header-height) + var(--nav-height) + 20px); }

/* Grid */
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ============================================
   TABLES - RESPONSIVE
   ============================================ */
.table-wrapper { overflow-x: auto; margin: 0 -1rem; padding: 0 1rem; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: clamp(0.8rem, 2vw, 0.9rem); }
td, th { padding: 0.625rem 0.875rem; text-align: left; border-bottom: 1px solid var(--border-light); }
th { background: var(--bg-tertiary); font-weight: 600; color: var(--primary); font-size: 0.75rem; text-transform: uppercase; white-space: nowrap; }
tr:hover { background: var(--bg-secondary); }
.decision-matrix th { background: var(--primary); color: #fff; }
.decision-matrix .yes { background: #D1FAE5; color: #065F46; font-weight: 600; text-align: center; }
.decision-matrix .no { background: #FEE2E2; color: #991B1B; font-weight: 600; text-align: center; }
.decision-matrix .partial { background: #FEF3C7; color: #92400E; font-weight: 600; text-align: center; }

/* Mobile Card-style Tables */
.table-responsive-cards { display: none; }
.table-card {
    background: var(--bg-primary); border: 1px solid var(--border-light);
    border-radius: var(--radius-md); padding: 1rem; margin-bottom: 0.75rem;
}
.table-card-header { font-weight: 700; color: var(--primary); font-size: 0.95rem; margin-bottom: 0.5rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--border-light); }
.table-card-row { display: flex; justify-content: space-between; padding: 0.5rem 0; border-bottom: 1px solid var(--border-light); font-size: 0.875rem; }
.table-card-row:last-child { border-bottom: none; }
.table-card-label { color: var(--text-muted); font-weight: 500; }
.table-card-value { color: var(--text-primary); text-align: right; }

/* Badges */
.badge { display: inline-block; padding: 0.2rem 0.5rem; border-radius: var(--radius-sm); font-size: 0.7rem; font-weight: 600; text-transform: uppercase; }
.badge-verified { background: #D1FAE5; color: #065F46; }
.badge-partial { background: #E0E7FF; color: #3730A3; }
.badge-unverified { background: #FEF3C7; color: #92400E; }
.badge-gap { background: #FEE2E2; color: #991B1B; }
.badge-active { background: #D1FAE5; color: #065F46; }
.badge-cancelled { background: #FEE2E2; color: #991B1B; }
.badge-proposed { background: #FEF3C7; color: #92400E; }
.badge-info { background: #DBEAFE; color: #1E40AF; }
.badge-statutory { background: #E0E7FF; color: #3730A3; }
.badge-policy { background: #DBEAFE; color: #1E40AF; }

/* Alerts */
.alert { padding: 0.875rem 1rem; border-radius: var(--radius-md); margin-bottom: 1rem; border-left: 4px solid; }
.alert-info { background: #EFF6FF; border-color: #3B82F6; color: #1E40AF; }
.alert-success { background: #ECFDF5; border-color: #10B981; color: #065F46; }
.alert-warning { background: #FFFBEB; border-color: #F59E0B; color: #92400E; }
.alert-danger { background: #FEF2F2; border-color: #EF4444; color: #991B1B; }
.alert-title { font-weight: 700; margin-bottom: 0.25rem; }

/* Hierarchy */
.hierarchy-container { padding-left: 0.5rem; }
.hierarchy-item { position: relative; padding: 0.875rem 1rem; background: var(--bg-primary); border: 1px solid var(--border-light); border-radius: var(--radius-md); margin-bottom: 0.5rem; transition: 0.2s; }
.hierarchy-item:hover { border-color: var(--primary); box-shadow: var(--shadow-md); }
.hierarchy-item.level-0 { border-left: 4px solid #1E3A5F; margin-left: 0; }
.hierarchy-item.level-1 { border-left: 4px solid #2563EB; margin-left: 1.5rem; }
.hierarchy-item.level-2 { border-left: 4px solid #3B82F6; margin-left: 3rem; }
.hierarchy-title { font-weight: 700; color: var(--primary); font-size: 0.95rem; }
.hierarchy-subtitle { font-size: 0.85rem; color: var(--text-muted); }
.hierarchy-role { display: inline-block; background: var(--bg-tertiary); padding: 0.15rem 0.5rem; border-radius: var(--radius-sm); font-size: 0.75rem; font-weight: 600; color: var(--primary); margin-top: 0.25rem; }

/* Expandable */
.expandable { border: 1px solid var(--border-light); border-radius: var(--radius-md); margin-bottom: 0.5rem; background: var(--bg-primary); }
.expandable-header {
    padding: 0.875rem 1rem; cursor: pointer;
    display: flex; align-items: center; gap: 0.75rem; transition: 0.2s;
    min-height: 52px;
}
.expandable-header:hover { background: var(--bg-tertiary); }
.expandable-header:focus { outline: 2px solid var(--primary); outline-offset: -2px; }
.expandable-icon { width: 18px; color: var(--primary); transition: transform 0.2s; flex-shrink: 0; }
.expandable.open .expandable-icon { transform: rotate(90deg); }
.expandable-title { flex: 1; font-weight: 600; color: var(--primary); font-size: 0.9rem; }
.expandable-content { display: none; padding: 1rem; border-top: 1px solid var(--border-light); background: var(--bg-secondary); }
.expandable.open .expandable-content { display: block; animation: expandIn 0.2s ease-out; }
@keyframes expandIn { from { opacity: 0; } }

/* Verification */
.verification-item { padding: 0.875rem; border-left: 4px solid var(--border-light); margin-bottom: 0.5rem; background: var(--bg-primary); }
.verification-item.verified { border-left-color: var(--success); }
.verification-item.partial { border-left-color: #6366F1; }
.verification-item.gap { border-left-color: var(--danger); }

/* Glossary */
.glossary-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 0.75rem; }
.glossary-item { padding: 0.875rem 1rem; background: var(--bg-primary); border: 1px solid var(--border-light); border-radius: var(--radius-md); transition: 0.2s; scroll-margin-top: calc(var(--header-height) + var(--nav-height) + 20px); }
.glossary-item:hover { border-color: var(--primary); box-shadow: var(--shadow-md); }
.glossary-item:target { background: #DBEAFE; border-color: var(--primary); animation: highlight 2s ease-out; }
@keyframes highlight { 0%, 30% { background: #FEF08A; } 100% { background: #DBEAFE; } }
.glossary-abbr { font-weight: 700; color: var(--primary); font-size: 0.95rem; }
.glossary-full { font-size: 0.9rem; color: var(--text-primary); }
.glossary-desc { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.35rem; padding-top: 0.35rem; border-top: 1px solid var(--border-light); line-height: 1.5; }
.glossary-links { margin-top: 0.35rem; padding-top: 0.35rem; border-top: 1px dashed var(--border-light); display: flex; flex-wrap: wrap; gap: 0.5rem; }
.glossary-links a { font-size: 0.75rem; padding: 0.25rem 0.5rem; background: var(--bg-tertiary); border-radius: var(--radius-sm); }

/* Document Library */
.doc-library { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 0.75rem; }
.doc-item { display: flex; align-items: flex-start; gap: 0.75rem; padding: 1rem; background: var(--bg-primary); border: 1px solid var(--border-light); border-radius: var(--radius-md); transition: 0.2s; }
.doc-item:hover { border-color: var(--primary); box-shadow: var(--shadow-md); }
.doc-item-icon { font-size: 1.75rem; flex-shrink: 0; }
.doc-item-info { flex: 1; min-width: 0; }
.doc-item-title { font-weight: 600; color: var(--primary); font-size: 0.9rem; line-height: 1.3; }
.doc-item-meta { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.25rem; }
.doc-item-actions { margin-top: 0.5rem; display: flex; gap: 0.5rem; flex-wrap: wrap; }
.doc-item-actions a {
    font-size: 0.75rem; padding: 0.4rem 0.6rem;
    background: var(--bg-tertiary); border-radius: var(--radius-sm);
    color: var(--primary); text-decoration: none;
    min-height: 36px; display: inline-flex; align-items: center;
}
.doc-item-actions a:hover { background: #DBEAFE; }

/* Process Steps */
.process-steps { counter-reset: step; padding-left: 2rem; }
.process-step { position: relative; padding: 0.875rem 1rem; background: var(--bg-primary); border: 1px solid var(--border-light); border-radius: var(--radius-md); margin-bottom: 0.75rem; }
.process-step::before { counter-increment: step; content: counter(step); position: absolute; left: -2rem; top: 0.875rem; width: 2.25rem; height: 2.25rem; background: var(--primary); color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.95rem; }
.process-step-title { font-weight: 700; color: var(--primary); font-size: 0.95rem; }
.process-step-subtitle { font-size: 0.85rem; color: var(--text-muted); }

/* ============================================
   FOOTER
   ============================================ */
.site-footer { background: var(--bg-primary); border-top: 1px solid var(--border-medium); padding: 1.5rem; margin-top: 2rem; }
.footer-content { max-width: 1400px; margin: 0 auto; text-align: center; }
.footer-disclaimer { background: #FEF2F2; border: 1px solid #FECACA; padding: 1rem; border-radius: var(--radius-md); color: #991B1B; margin-bottom: 1rem; font-size: clamp(0.75rem, 2vw, 0.85rem); line-height: 1.5; }
.footer-meta { font-size: clamp(0.75rem, 2vw, 0.85rem); color: var(--text-muted); }
.footer-brand { font-weight: 600; color: var(--primary); }

/* ============================================
   LOADING INDICATOR
   ============================================ */
.page-loading {
    position: fixed; top: 0; left: 0; right: 0;
    height: 3px; background: linear-gradient(90deg, var(--primary), var(--primary-light), var(--primary));
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    z-index: 9999; opacity: 0; transition: opacity 0.3s;
}
.page-loading.active { opacity: 1; }
@keyframes loading { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ============================================
   TOAST NOTIFICATION
   ============================================ */
.toast-notification {
    position: fixed; bottom: 80px; right: 1.5rem; left: 1.5rem;
    background: var(--primary); color: white;
    padding: 1rem 1.25rem; border-radius: var(--radius-md);
    font-size: 0.9rem; font-weight: 500;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 9999; animation: toastIn 0.3s ease-out;
    text-align: center;
}
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ============================================
   UTILITIES
   ============================================ */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mt-2 { margin-top: 1rem; }
.list-styled { padding-left: 1.25rem; }
.list-styled li { margin-bottom: 0.35rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* Focus Visible Styles */
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ============================================
   RESPONSIVE - TABLET (600px)
   ============================================ */
@media (max-width: 1024px) {
    .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .journey-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    :root { --header-height: 56px; --nav-height: 0px; }
    body { padding-top: var(--header-height); }

    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .journey-grid { grid-template-columns: repeat(2, 1fr); }

    .site-header { padding: 0 1rem; }
    .site-subtitle { display: none; }
    .logo-text { display: none; }
    .site-title-group { margin-left: 0.75rem; padding-left: 0.75rem; }
    .journey-btn-text { display: none; }
    .search-trigger span { display: none; }
    .print-btn span { display: none; }

    .mobile-menu-btn { display: flex; }
    .site-nav { display: none; }

    .main-content { padding: 1rem; }
    .hierarchy-item { margin-left: 0 !important; }

    .breadcrumb { padding: 0.75rem 1rem; }
    .breadcrumb-current { max-width: 150px; }

    .toc-list { flex-direction: column; gap: 0.375rem; }
    .toc-item a { display: flex; width: 100%; }

    .back-to-top { bottom: 1rem; right: 1rem; }

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

    /* Search fullscreen on mobile */
    .search-modal { padding: 0; align-items: stretch; }
    .search-container { max-width: 100%; border-radius: 0; max-height: 100vh; height: 100%; }
    .search-input { font-size: 1rem; }

    /* Toast positioning */
    .toast-notification { bottom: 70px; left: 1rem; right: 1rem; }

    /* Tooltips on mobile */
    .abbr-tooltip { position: fixed; bottom: auto; top: 50%; left: 50% !important; right: auto !important; transform: translate(-50%, -50%); max-width: calc(100vw - 2rem); }
    .abbr-tooltip::after { display: none; }
    .abbr-tooltip-close { display: flex; }
}

@media (max-width: 600px) {
    /* Tablet portrait / Large phone */
    .journey-grid { grid-template-columns: 1fr; }
    .journey-card { min-height: auto; padding: 1rem; }

    .glossary-grid { grid-template-columns: 1fr; }
    .doc-library { grid-template-columns: 1fr; }

    /* Simplified header - only menu + search */
    .print-btn { display: none; }
    .classification-badge { display: none; }
    .header-meta { gap: 0.375rem; }

    /* Card-style tables on small screens */
    .table-wrapper table { display: none; }
    .table-responsive-cards { display: block; }
}

@media (max-width: 480px) {
    :root { --header-height: 52px; }

    .site-title { font-size: 0.85rem; }
    .header-meta { gap: 0.25rem; }

    .logo-icon { width: 30px; height: 30px; font-size: 10px; }
    .site-title-group { margin-left: 0.5rem; padding-left: 0.5rem; }

    .journey-btn { padding: 0.5rem; }
    .search-trigger { padding: 0.5rem; }

    .modal-body { padding: 1rem; }
    .modal-header { padding: 1rem; }

    .card-body { padding: 0.875rem; }

    .process-steps { padding-left: 1.75rem; }
    .process-step::before { width: 2rem; height: 2rem; left: -1.75rem; font-size: 0.85rem; }
}

/* ============================================
   TOUCH DEVICE SPECIFIC
   ============================================ */
@media (hover: none) and (pointer: coarse) {
    /* Increase all interactive element sizes */
    .nav-link { padding: 0 1rem; }
    .expandable-header { min-height: 56px; }
    .toc-item a { min-height: var(--touch-target); }
    .search-result { min-height: 76px; }
    .glossary-links a { min-height: 36px; display: inline-flex; align-items: center; }

    /* Disable hover effects that don't work on touch */
    .card:hover { box-shadow: var(--shadow-sm); }
    .journey-card:hover { transform: none; }
    .related-card:hover { transform: none; }
    .back-to-top:hover { background: var(--primary); }

    /* Make active states more prominent */
    .journey-card:active { transform: scale(0.98); background: var(--bg-tertiary); }
    .related-card:active { transform: scale(0.98); }
    .mobile-nav-link:active { background: #DBEAFE; }
}

/* ============================================
   PRINT
   ============================================ */
@media print {
    * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }

    body { padding-top: 0; background: white; font-size: 11pt; }

    .site-header, .site-nav, .journey-btn, .modal-overlay,
    .back-to-top, .search-trigger, .print-btn, .mobile-menu-btn,
    .mobile-nav-overlay, .mobile-nav-drawer, .search-modal,
    .toc-container, .skip-link, .related-pages { display: none !important; }

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

    .expandable-content { display: block !important; }

    .card { break-inside: avoid; box-shadow: none; border: 1px solid #ccc; page-break-inside: avoid; margin-bottom: 1rem; }

    .page-header { border-bottom: 2px solid var(--primary); margin-bottom: 1rem; }
    .page-header h1 { font-size: 18pt; }

    a { color: var(--primary); text-decoration: underline; }
    a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.8em; color: var(--text-muted); }
    a[href^="assets/"]::after { content: " [Local Document]"; font-size: 0.8em; color: var(--text-muted); }

    .abbr-link::after { content: none; }
    .abbr-tooltip { display: none !important; }

    .site-footer { border-top: 1px solid #ccc; padding: 1rem 0; margin-top: 2rem; }
    .footer-disclaimer { background: #f5f5f5; border: 1px solid #ccc; }

    table { font-size: 9pt; }
    th, td { padding: 0.35rem 0.5rem; }

    .badge { border: 1px solid currentColor; }

    .table-responsive-cards { display: none !important; }
    .table-wrapper table { display: table !important; }
}
