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

        :root {
            --primary: #1a1a2e;
            --secondary: #16213e;
            --accent: #0f3460;
            --highlight: #e94560;
            --text: #eee;
            --text-dim: #a0a0a0;
            --sidebar-bg: #0a0a15;
            --content-bg: #13131f;
            --code-bg: #1e1e2e;
            --border: #2a2a3e;
        }

body {
            font-family: 'Work Sans', sans-serif;
            background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
            color: var(--text);
            line-height: 1.7;
            overflow-x: hidden;
        }

        .container {
            display: flex;
            min-height: 100vh;
        }

        .sidebar {
            width: 320px;
            background: var(--sidebar-bg);
            position: fixed;
            left: 0;
            top: 0;
            height: 100vh;
            overflow-y: auto;
            border-right: 2px solid var(--border);
            z-index: 100;
            box-shadow: 4px 0 20px rgba(0, 0, 0, 0.5);
        }

        .sidebar-header {
            padding: 30px 20px;
            background: linear-gradient(135deg, var(--accent), var(--highlight));
            position: sticky;
            top: 0;
            z-index: 10;
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
        }

        .sidebar-header h1 {
            font-family: 'Playfair Display', serif;
            font-size: 28px;
            font-weight: 900;
            color: #fff;
            letter-spacing: -0.5px;
            margin-bottom: 5px;
        }

        .sidebar-header p {
            font-size: 12px;
            color: rgba(255, 255, 255, 0.8);
            font-weight: 300;
            letter-spacing: 1px;
            text-transform: uppercase;
        }

        .toc {
            padding: 20px 0;
        }

        .toc-item {
            display: block;
            padding: 12px 20px;
            color: var(--text-dim);
            text-decoration: none;
            font-size: 14px;
            transition: all 0.3s ease;
            border-left: 3px solid transparent;
            font-weight: 400;
        }

        .toc-level-1 {
            font-weight: 600;
            font-size: 15px;
            color: var(--text);
            margin-top: 15px;
        }

        .toc-level-2 {
            font-size: 14px;
        }

        .toc-level-3 {
            font-size: 13px;
            color: #888;
        }

        .toc-item:hover {
            background: rgba(233, 69, 96, 0.1);
            color: var(--highlight);
            border-left-color: var(--highlight);
            padding-left: 25px;
        }

        .toc-item.active {
            background: rgba(233, 69, 96, 0.15);
            color: var(--highlight);
            border-left-color: var(--highlight);
            font-weight: 600;
        }

        .sidebar::-webkit-scrollbar {
            width: 8px;
        }

        .sidebar::-webkit-scrollbar-track {
            background: var(--sidebar-bg);
        }

        .sidebar::-webkit-scrollbar-thumb {
            background: var(--accent);
            border-radius: 4px;
        }

        .sidebar::-webkit-scrollbar-thumb:hover {
            background: var(--highlight);
        }

        .content {
            flex: 1;
            margin-left: 320px;
            padding: 60px;
            max-width: 1200px;
            background: var(--content-bg);
            min-height: 100vh;
        }

        .content-header {
            margin-bottom: 50px;
            padding-bottom: 30px;
            border-bottom: 2px solid var(--border);
        }

        .content-header h1 {
            font-family: 'Playfair Display', serif;
            font-size: 48px;
            font-weight: 900;
            background: linear-gradient(135deg, var(--highlight), #ff6b9d);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            margin-bottom: 10px;
        }

        .content-header p {
            color: var(--text-dim);
            font-size: 18px;
        }

        h1, h2, h3, h4, h5, h6 {
            font-family: 'Playfair Display', serif;
            font-weight: 700;
            margin: 40px 0 20px 0;
            line-height: 1.3;
            scroll-margin-top: 20px;
        }

        #content h1 {
            font-size: 42px;
            color: var(--highlight);
            border-bottom: 3px solid var(--accent);
            padding-bottom: 15px;
        }

        #content h2 {
            font-size: 36px;
            color: #ff6b9d;
        }

        #content h3 {
            font-size: 28px;
            color: #ffa07a;
        }

        #content h4 {
            font-size: 24px;
            color: #87ceeb;
        }

        #content h5 {
            font-size: 20px;
            color: #98d8c8;
        }

        #content h6 {
            font-size: 18px;
            color: var(--text);
        }

        p {
            margin: 15px 0;
            font-size: 16px;
            color: var(--text);
        }

        code {
            font-family: 'JetBrains Mono', monospace;
            background: var(--code-bg);
            padding: 3px 8px;
            border-radius: 4px;
            font-size: 14px;
            color: #ff79c6;
            border: 1px solid var(--border);
        }

        pre {
            background: var(--code-bg);
            padding: 25px;
            border-radius: 8px;
            overflow-x: auto;
            margin: 25px 0;
            border: 1px solid var(--border);
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
        }

        pre code {
            background: none;
            padding: 0;
            border: none;
            color: #8be9fd;
            font-size: 14px;
            line-height: 1.6;
        }

        ul, ol {
            margin: 20px 0;
            padding-left: 30px;
        }

        li {
            margin: 10px 0;
            color: var(--text);
        }

        table {
            width: 100%;
            border-collapse: collapse;
            margin: 30px 0;
            background: var(--code-bg);
            border-radius: 8px;
            overflow: hidden;
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
        }

        th {
            background: var(--accent);
            color: #fff;
            padding: 15px;
            text-align: left;
            font-weight: 600;
            text-transform: uppercase;
            font-size: 13px;
            letter-spacing: 1px;
        }

        td {
            padding: 15px;
            border-bottom: 1px solid var(--border);
            color: var(--text);
        }

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

        tr:hover {
            background: rgba(233, 69, 96, 0.05);
        }

        blockquote {
            border-left: 4px solid var(--highlight);
            padding: 15px 25px;
            margin: 25px 0;
            background: rgba(233, 69, 96, 0.1);
            border-radius: 4px;
            font-style: italic;
            color: var(--text-dim);
        }

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

        .scroll-top {
            position: fixed;
            bottom: 30px;
            right: 30px;
            width: 50px;
            height: 50px;
            background: var(--highlight);
            color: white;
            border: none;
            border-radius: 50%;
            cursor: pointer;
            display: none;
            align-items: center;
            justify-content: center;
            font-size: 24px;
            box-shadow: 0 4px 20px rgba(233, 69, 96, 0.4);
            transition: all 0.3s ease;
            z-index: 1000;
        }

        .scroll-top:hover {
            transform: translateY(-5px);
            box-shadow: 0 6px 25px rgba(233, 69, 96, 0.6);
        }

        .scroll-top.visible {
            display: flex;
        }

        .menu-toggle {
            display: none;
        }

        .details-toggle {
            position: fixed;
            top: 20px;
            right: 20px;
            z-index: 1001;
            background: var(--highlight);
            color: white;
            border: none;
            padding: 10px 14px;
            border-radius: 8px;
            cursor: pointer;
            font-size: 13px;
            letter-spacing: 0.5px;
            text-transform: uppercase;
            box-shadow: 0 4px 15px rgba(233, 69, 96, 0.35);
            transition: transform 0.2s ease, box-shadow 0.2s ease;
        }

        .details-toggle:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(233, 69, 96, 0.55);
        }

        @media (max-width: 968px) {
            .sidebar {
                width: 280px;
            }

            .content {
                margin-left: 280px;
                padding: 40px 30px;
            }
        }

        @media (max-width: 768px) {
            .sidebar {
                transform: translateX(-100%);
                transition: transform 0.3s ease;
            }

            .sidebar.open {
                transform: translateX(0);
            }

            .content {
                margin-left: 0;
                padding: 30px 20px;
            }

            .menu-toggle {
                display: block;
                position: fixed;
                top: 20px;
                left: 20px;
                z-index: 1001;
                background: var(--highlight);
                color: white;
                border: none;
                padding: 12px 15px;
                border-radius: 8px;
                cursor: pointer;
                font-size: 20px;
            }
        }

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

        em {
            color: #ffa07a;
            font-style: italic;
        }

        .welcome-banner {
            position: fixed;
            top: 16px;
            left: 50%;
            transform: translateX(-50%);
            background: rgba(233, 69, 96, 0.12);
            border: 1px solid rgba(233, 69, 96, 0.35);
            color: var(--text);
            padding: 10px 16px;
            border-radius: 10px;
            z-index: 1200;
            font-weight: 600;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
            transition: opacity 0.4s ease, transform 0.4s ease;
        }

        .welcome-banner.fade {
            opacity: 0;
            transform: translateX(-50%) translateY(-10px);
        }

        /* Kural banner */
        .kural-banner {
            position: relative;
            padding: 22px 28px 18px;
            min-height: 120px;
            background: rgba(15, 52, 96, 0.28);
            border: 1px solid rgba(255, 255, 255, 0.14);
            border-radius: 14px;
            box-shadow: 0 14px 40px rgba(0, 0, 0, 0.35);
            overflow: hidden;
        }

        .kural-banner.kural-floating {
            position: fixed;
            top: 70px;
            left: 50%;
            transform: translateX(-50%);
            width: min(980px, calc(100% - 80px));
            z-index: 1300;
            backdrop-filter: blur(10px);
            transition: opacity 0.4s ease, transform 0.4s ease;
        }

        .kural-banner.kural-hidden {
            opacity: 0;
            transform: translateX(-50%) translateY(-8px);
            pointer-events: none;
        }

        .kural-label {
            position: absolute;
            top: 10px;
            left: 14px;
            font-size: 12px;
            text-transform: uppercase;
            letter-spacing: 2px;
            color: var(--highlight);
            text-shadow: 0 0 10px rgba(233, 69, 96, 0.8), 0 0 18px rgba(233, 69, 96, 0.5);
        }

        .kural-bubbles {
            position: absolute;
            inset: 0;
            overflow: hidden;
            pointer-events: none;
            z-index: 1;
        }

        .kural-bubble {
            position: absolute;
            top: 10%;
            border-radius: 50%;
            background: rgba(255, 255, 255, 0.18);
            border: 1px solid rgba(255, 255, 255, 0.22);
            box-shadow: 0 0 10px rgba(255, 255, 255, 0.12);
            opacity: 0.2;
            animation: bubbleFloat 10s ease-in-out infinite;
        }

        .kural-bubble:nth-child(1) { left: 6%; top: 18%; width: 18px; height: 18px; animation-duration: 9s; animation-delay: 0s; }
        .kural-bubble:nth-child(2) { left: 14%; top: 55%; width: 28px; height: 28px; animation-duration: 15s; animation-delay: 1.5s; }
        .kural-bubble:nth-child(3) { left: 22%; top: 30%; width: 14px; height: 14px; animation-duration: 10s; animation-delay: 2s; }
        .kural-bubble:nth-child(4) { left: 32%; top: 65%; width: 24px; height: 24px; animation-duration: 13s; animation-delay: 0.8s; }
        .kural-bubble:nth-child(5) { left: 42%; top: 24%; width: 16px; height: 16px; animation-duration: 11s; animation-delay: 2.8s; }
        .kural-bubble:nth-child(6) { left: 52%; top: 48%; width: 30px; height: 30px; animation-duration: 17s; animation-delay: 0.4s; }
        .kural-bubble:nth-child(7) { left: 60%; top: 20%; width: 20px; height: 20px; animation-duration: 12s; animation-delay: 3.2s; }
        .kural-bubble:nth-child(8) { left: 68%; top: 60%; width: 12px; height: 12px; animation-duration: 8s; animation-delay: 1.1s; }
        .kural-bubble:nth-child(9) { left: 76%; top: 32%; width: 26px; height: 26px; animation-duration: 16s; animation-delay: 2.4s; }
        .kural-bubble:nth-child(10) { left: 84%; top: 52%; width: 18px; height: 18px; animation-duration: 10.5s; animation-delay: 0.9s; }
        .kural-bubble:nth-child(11) { left: 90%; top: 26%; width: 22px; height: 22px; animation-duration: 14s; animation-delay: 3.6s; }
        .kural-bubble:nth-child(12) { left: 94%; top: 70%; width: 14px; height: 14px; animation-duration: 9.5s; animation-delay: 1.8s; }

        .kural-label,
        .kural-next,
        .kural-content,
        .kural-loading {
            position: relative;
            z-index: 2;
        }

        @keyframes bubbleFloat {
            0%, 100% { transform: translate(0, 0) scale(0.95); opacity: 0.2; }
            35% { transform: translate(10px, -8px) scale(1.05); opacity: 0.3; }
            70% { transform: translate(-6px, 10px) scale(1); opacity: 0.25; }
        }

        @media (prefers-reduced-motion: reduce) {
            .kural-bubble {
                animation: none;
                opacity: 0.35;
                bottom: 10%;
            }
        }

        .kural-next {
            display: none;
        }

        .kural-content {
            display: flex;
            flex-direction: column;
            gap: 6px;
            text-align: center;
        }

        .kural-number {
            font-size: 12px;
            text-transform: uppercase;
            letter-spacing: 2px;
            color: var(--text-dim);
        }

        .kural-tamil {
            font-size: 18px;
            font-weight: 600;
            line-height: 1.4;
            color: var(--text);
        }

        .kural-tamil span {
            display: block;
        }

        .kural-transliteration {
            font-size: 13px;
            color: var(--text-dim);
        }

        .kural-english {
            font-size: 13px;
            color: var(--text);
        }

        .kural-loading {
            margin-top: 8px;
            font-size: 12px;
            color: var(--text-dim);
            opacity: 0;
            min-height: 16px;
            transition: opacity 0.2s ease;
        }

        .kural-loading.visible {
            opacity: 1;
            animation: kuralShimmer 1.4s ease-in-out infinite;
        }

        @keyframes kuralShimmer {
            0%, 100% { opacity: 0.35; }
            50% { opacity: 0.9; }
        }

        .kural-timer {
            display: none;
            margin-top: 8px;
            align-items: center;
            justify-content: center;
            gap: 8px;
            font-size: 12px;
            color: var(--text-dim);
        }

        .kural-banner.kural-floating .kural-timer {
            display: inline-flex;
        }

        .kural-timer-value {
            font-weight: 700;
            color: var(--highlight);
            text-shadow: 0 0 10px rgba(233, 69, 96, 0.7);
        }

        .kural-timer-pulse {
            animation: timerPulse 0.9s ease;
        }

        .kural-timer-bar {
            position: relative;
            width: 120px;
            height: 6px;
            background: rgba(255, 255, 255, 0.1);
            border-radius: 999px;
            overflow: hidden;
            box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.35);
        }

        .kural-timer-bar span {
            position: absolute;
            inset: 0;
            background: linear-gradient(90deg, rgba(233, 69, 96, 0.9), rgba(255, 107, 157, 0.9));
            transform-origin: left center;
            box-shadow: 0 0 12px rgba(233, 69, 96, 0.6);
        }

        @keyframes timerShrink {
            from { transform: scaleX(1); }
            to { transform: scaleX(0); }
        }

        @keyframes timerPulse {
            0% { transform: scale(1); }
            35% { transform: scale(1.15); }
            100% { transform: scale(1); }
        }

        @media (max-width: 768px) {
            .kural-banner.kural-floating {
                width: calc(100% - 30px);
                top: 84px;
            }

            .kural-tamil {
                font-size: 16px;
            }
        }

        /* Chat widget (content pages) */
.chat-widget {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: min(80vw, 900px);
    height: 80vh;
    min-height: 320px;
    background: #121224;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    min-width: 280px;
    min-height: 320px;
}

.hidden {
    display: none;
}

.chat-header {
    padding: 10px 12px;
    background: rgba(233, 69, 96, 0.2);
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.chat-min-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text);
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 12px;
    cursor: pointer;
}

        .chat-status {
            padding: 6px 12px;
            background: rgba(255, 107, 157, 0.18);
            color: #ffd1de;
            font-size: 12px;
        }

        .chat-tabs {
            display: flex;
            gap: 4px;
            padding: 8px 10px;
        }

        .chat-tab {
            flex: 1;
            background: rgba(255, 255, 255, 0.08);
            border: 1px solid rgba(255, 255, 255, 0.12);
            color: var(--text);
            padding: 6px;
            border-radius: 8px;
            cursor: pointer;
            font-size: 12px;
        }

.chat-tab.active {
    background: var(--highlight);
    border-color: var(--highlight);
}

.chat-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--accent);
    color: white;
    font-size: 11px;
    margin-left: 6px;
}

.chat-body {
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 12px;
    flex: 1;
}

.chat-item {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 6px 8px;
    border-radius: 8px;
    align-self: flex-start;
    max-width: 85%;
}

.chat-item-own {
    align-self: flex-end;
    background: rgba(233, 69, 96, 0.18);
    border-color: rgba(233, 69, 96, 0.45);
    text-align: left;
}

.chat-meta {
    color: var(--text-dim);
    font-size: 11px;
    margin-bottom: 4px;
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.chat-time {
    color: var(--text-dim);
    font-size: 11px;
}

.chat-seen {
    margin-top: 4px;
    font-size: 10px;
    color: var(--text-dim);
}

.chat-day {
    text-align: center;
    font-size: 11px;
    color: var(--text-dim);
    margin: 6px 0;
}

.chat-form {
    display: flex;
    gap: 6px;
    padding: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.chat-tools {
    display: flex;
    justify-content: flex-end;
    padding: 6px 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.chat-tool-btn,
.chat-delete-btn,
.chat-copy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.chat-tool-btn:hover,
.chat-delete-btn:hover,
.chat-copy-btn:hover {
    background: rgba(233, 69, 96, 0.18);
    border-color: rgba(233, 69, 96, 0.45);
}

.chat-tool-btn svg,
.chat-delete-btn svg,
.chat-copy-btn svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

.chat-actions {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    margin-top: 6px;
}

.chat-minimized {
    display: none;
}

.chat-bubble {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    color: white;
    border: none;
    font-weight: 600;
    box-shadow: 0 12px 30px rgba(233, 69, 96, 0.35);
    cursor: pointer;
    z-index: 2001;
    transition: left 1.2s ease, top 1.2s ease;
}

.chat-resizer {
    position: absolute;
    left: 6px;
    top: 6px;
    width: 16px;
    height: 16px;
    border-left: 2px solid rgba(255, 255, 255, 0.35);
    border-top: 2px solid rgba(255, 255, 255, 0.35);
    cursor: nwse-resize;
}

.chat-bounce {
    animation: chatBounce 0.6s ease;
}

@keyframes chatBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-18px); }
}

        .chat-form textarea {
            flex: 1;
            background: rgba(255, 255, 255, 0.06);
            border: 1px solid rgba(255, 255, 255, 0.12);
            color: var(--text);
            padding: 6px 8px;
            border-radius: 8px;
            font-size: 12px;
            resize: vertical;
            min-height: 34px;
            max-height: 140px;
            font-family: inherit;
            line-height: 1.4;
            overflow-y: hidden;
        }

        .chat-form button {
            background: var(--highlight);
            border: none;
            color: white;
            padding: 6px 10px;
            border-radius: 8px;
            font-size: 12px;
            cursor: pointer;
        }

        .chat-message {
            white-space: pre-wrap;
            word-break: break-word;
        }

        .chat-table {
            width: 100%;
            border-collapse: collapse;
            font-size: 11px;
            background: rgba(255, 255, 255, 0.03);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 8px;
            overflow: hidden;
        }

        .chat-table th,
        .chat-table td {
            border: 1px solid rgba(255, 255, 255, 0.08);
            padding: 4px 6px;
            text-align: left;
            vertical-align: top;
        }

        .chat-table th {
            background: rgba(233, 69, 96, 0.18);
            color: var(--text);
            font-weight: 600;
        }

        .chat-table-row-hidden {
            display: none;
        }

        .chat-message.clamp {
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: var(--chat-line-clamp, 5);
            overflow: hidden;
        }

        .chat-toggle-btn {
            background: transparent;
            border: none;
            color: var(--highlight);
            font-size: 11px;
            cursor: pointer;
            padding: 2px 4px;
        }
