/* ============================================
   Narayaneeyam - Interactive Study App
   Modeled after the Bhagavad Gita interface
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
    --color-bg: #FFFAF0;
    --color-bg-alt: #f5eed8;
    --color-text: #2c1810;
    --color-text-muted: #6b5744;
    --color-saffron: #B8860B;
    --color-saffron-light: #DAA520;
    --color-saffron-pale: #fdf5e6;
    --color-gold: #B8860B;
    --color-gold-light: #DAA520;
    --color-green: #1B5E20;
    --color-red: #c62828;
    --color-border: #d4c4a0;
    --color-border-light: #e8ddc0;
    --color-white: #ffffff;

    --font-display: 'Playfair Display', Georgia, serif;
    --font-body: 'Source Serif 4', 'Georgia', serif;
    --font-devanagari: 'Noto Sans Devanagari', sans-serif;

    --radius: 8px;
    --shadow-sm: 0 1px 3px rgba(44, 24, 16, 0.08);
    --shadow-md: 0 4px 12px rgba(44, 24, 16, 0.1);
    --shadow-lg: 0 8px 24px rgba(44, 24, 16, 0.12);
}

/* --- Reset & Base --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 18px;
}

body {
    font-family: var(--font-body);
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

/* --- Top Bar --- */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1.5rem;
    background: #1a1410;
    color: #a09070;
    font-family: var(--font-body);
    font-size: 0.75rem;
    letter-spacing: 0.03em;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.top-bar a {
    color: #c4a872;
    text-decoration: none;
    transition: color 0.2s ease;
}

.top-bar a:hover {
    color: var(--color-gold-light);
}

.top-bar .back-link {
    font-weight: 500;
}

.top-bar-title {
    font-family: var(--font-devanagari);
    font-size: 0.85rem;
    color: #d4b07a;
}

/* --- Reading Progress Bar --- */
.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--color-saffron), var(--color-gold-light));
    z-index: 1000;
    transition: width 0.1s ease;
    width: 0%;
}

/* --- Header --- */
.site-header {
    background: linear-gradient(135deg, #7a5c1e 0%, #B8860B 50%, #7a5c1e 100%);
    color: var(--color-white);
    text-align: center;
    padding: 3rem 1.5rem 2.5rem;
    position: relative;
    overflow: hidden;
}

.site-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at center, rgba(218, 165, 32, 0.2) 0%, transparent 70%);
    pointer-events: none;
}

.header-content {
    position: relative;
    max-width: 700px;
    margin: 0 auto;
}

.header-ornament {
    font-size: 1.5rem;
    color: var(--color-gold-light);
    margin-bottom: 1rem;
    opacity: 0.9;
}

.site-title {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    margin-bottom: 0.25rem;
    background: linear-gradient(135deg, #fff 0%, #ffd54f 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.site-title-sanskrit {
    font-family: var(--font-devanagari);
    font-size: 1.2rem;
    opacity: 0.8;
    margin-bottom: 0.5rem;
}

.site-subtitle {
    font-family: var(--font-body);
    font-size: 1.1rem;
    font-weight: 300;
    opacity: 0.9;
    margin-bottom: 0.25rem;
}

.site-source {
    font-size: 0.78rem;
    opacity: 0.6;
    font-style: italic;
    margin-bottom: 1rem;
}

.header-sections {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.header-tag {
    font-size: 0.7rem;
    padding: 0.25rem 0.75rem;
    background: rgba(218, 165, 32, 0.15);
    border: 1px solid rgba(218, 165, 32, 0.3);
    border-radius: 20px;
    color: rgba(255, 255, 255, 0.85);
    letter-spacing: 0.02em;
}

/* --- Navigation --- */
.view-nav {
    position: sticky;
    top: 3px;
    z-index: 100;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border-light);
    box-shadow: var(--shadow-sm);
}

.nav-inner {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    gap: 0;
    padding: 0 1rem;
}

.nav-btn {
    flex: 1;
    padding: 0.75rem 0.5rem;
    border: none;
    background: transparent;
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: var(--color-text-muted);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease;
}

.nav-btn:hover {
    color: var(--color-saffron);
    background: var(--color-saffron-pale);
}

.nav-btn.active {
    color: var(--color-saffron);
    border-bottom-color: var(--color-saffron);
    font-weight: 600;
}

/* --- Content --- */
.content {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1rem;
}

.view {
    display: none;
}

.view.active {
    display: block;
}

/* --- Section Blocks --- */
.section-block {
    margin: 2rem 0;
}

.section-heading {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--color-saffron);
    text-align: center;
    margin-bottom: 0.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--color-border-light);
    position: relative;
}

.section-heading::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 2px;
    background: var(--color-saffron);
}

.section-heading-sanskrit {
    display: block;
    font-family: var(--font-devanagari);
    font-size: 1rem;
    color: var(--color-text-muted);
    font-weight: 400;
    margin-top: 0.25rem;
}

.section-intro {
    text-align: center;
    color: var(--color-text-muted);
    font-size: 0.9rem;
    font-style: italic;
    margin-bottom: 1.5rem;
}

/* --- Dashaka Grid --- */
.dashaka-grid-inner {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.6rem;
    margin-bottom: 1.5rem;
}

.dashaka-card {
    background: var(--color-white);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius);
    padding: 0.75rem 0.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
    position: relative;
}

.dashaka-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.dashaka-card.visited {
    background: var(--color-saffron-pale);
}

.dashaka-card:not(.has-data) {
    opacity: 0.55;
}

.dashaka-card:not(.has-data) .dashaka-card-title::after {
    content: ' (coming soon)';
    font-style: italic;
    font-size: 0.55rem;
    color: var(--color-text-muted);
}

.dashaka-card.has-data {
    border-bottom: 2px solid var(--color-green);
}

.dashaka-card-number {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 0.15rem;
}

.dashaka-card-icon {
    font-size: 0.85rem;
    margin-bottom: 0.2rem;
}

.dashaka-card-title {
    font-size: 0.65rem;
    color: var(--color-text-muted);
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.dashaka-card-meta {
    font-size: 0.6rem;
    color: var(--color-text-muted);
    opacity: 0.7;
    margin-top: 0.2rem;
}

.dashaka-card-visited {
    position: absolute;
    top: 4px;
    right: 6px;
    font-size: 0.6rem;
    color: var(--color-green);
}

/* --- Theme Legend --- */
.theme-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
    margin-bottom: 1rem;
}

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

.legend-color {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

/* --- Theme Filter --- */
.theme-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 1.25rem;
}

.theme-filter-btn {
    padding: 0.3rem 0.8rem;
    border: 1px solid var(--color-border);
    border-radius: 20px;
    background: var(--color-white);
    font-family: var(--font-body);
    font-size: 0.72rem;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.theme-filter-btn:hover {
    border-color: var(--color-saffron);
    color: var(--color-saffron);
}

.theme-filter-btn.active {
    background: var(--color-saffron);
    color: var(--color-white);
    border-color: var(--color-saffron);
}

.dashaka-card.filtered-out {
    display: none;
}

/* --- Reading Stats --- */
.reading-stats {
    text-align: center;
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin-top: 1rem;
}

/* --- Dashaka Quick Jump --- */
.dashaka-quick-jump {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    justify-content: center;
}

.dashaka-quick-jump select {
    padding: 0.3rem 0.6rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 0.75rem;
    color: var(--color-text);
    background: var(--color-white);
    cursor: pointer;
    max-width: 220px;
}

/* --- Bottom Navigation in Reading View --- */
.dashaka-bottom-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    padding: 1rem 0;
    border-top: 1px solid var(--color-border-light);
}

.bottom-nav-btn {
    padding: 0.6rem 1.5rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-white);
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.bottom-nav-btn:hover {
    border-color: var(--color-saffron);
    color: var(--color-saffron);
    background: var(--color-saffron-pale);
}

.bottom-nav-btn.primary {
    background: var(--color-saffron);
    color: var(--color-white);
    border-color: var(--color-saffron);
}

.bottom-nav-btn.primary:hover {
    background: var(--color-saffron-light);
}

/* --- Dashaka Detail View --- */
.dashaka-nav-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--color-border-light);
}

.dashaka-nav-arrows {
    display: flex;
    gap: 0.5rem;
}

.nav-control-btn {
    padding: 0.4rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-white);
    font-family: var(--font-body);
    font-size: 0.8rem;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: all 0.15s ease;
}

.nav-control-btn:hover {
    border-color: var(--color-saffron);
    color: var(--color-saffron);
}

.nav-control-btn.back-btn {
    font-weight: 600;
    color: var(--color-saffron);
    border-color: var(--color-saffron);
}

/* --- Dashaka Header --- */
.dashaka-header {
    background: var(--color-white);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.dashaka-header-number {
    font-family: var(--font-display);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 0.25rem;
}

.dashaka-header-title-sanskrit {
    font-family: var(--font-devanagari);
    font-size: 1.2rem;
    color: var(--color-text-muted);
    margin-bottom: 0.25rem;
}

.dashaka-header-title {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 0.5rem;
}

.dashaka-header-theme {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.theme-badge {
    display: inline-block;
    padding: 0.15rem 0.6rem;
    border-radius: 12px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: capitalize;
    color: var(--color-white);
    letter-spacing: 0.05em;
}

.dashaka-verse-count {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.dashaka-header-summary {
    font-size: 0.88rem;
    line-height: 1.65;
    color: var(--color-text-muted);
    font-style: italic;
}

/* --- Expand/Collapse Controls --- */
.expand-controls {
    text-align: center;
    margin-bottom: 1rem;
}

.expand-btn {
    padding: 0.4rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-white);
    font-family: var(--font-body);
    font-size: 0.8rem;
    color: var(--color-text-muted);
    cursor: pointer;
    margin: 0 0.25rem;
    transition: all 0.15s ease;
}

.expand-btn:hover {
    border-color: var(--color-saffron);
    color: var(--color-saffron);
}

/* --- Verse Card --- */
.verse-card {
    background: var(--color-white);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}

.verse-card:hover {
    box-shadow: var(--shadow-md);
}

.verse-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    background: linear-gradient(135deg, var(--color-saffron-pale) 0%, var(--color-bg-alt) 100%);
    border-bottom: 1px solid var(--color-border-light);
    cursor: pointer;
}

.verse-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 50%;
    background: var(--color-saffron);
    color: var(--color-white);
    font-family: var(--font-display);
    font-size: 0.8rem;
    font-weight: 700;
    flex-shrink: 0;
}

.verse-text-preview {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: var(--font-devanagari);
}

.verse-toggle {
    color: var(--color-text-muted);
    font-size: 1.2rem;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.verse-card.expanded .verse-toggle {
    transform: rotate(180deg);
}

.verse-body {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.4s ease, opacity 0.3s ease, padding 0.3s ease;
    padding: 0 1.25rem;
}

.verse-card.expanded .verse-body {
    max-height: 5000px;
    opacity: 1;
    padding: 1.25rem;
}

/* --- Sloka Devanagari --- */
.sloka-devanagari {
    font-family: var(--font-devanagari);
    font-size: 1.3rem;
    line-height: 2;
    padding: 1.5rem;
    background: var(--color-bg-alt);
    border-radius: var(--radius);
    margin-bottom: 1rem;
    text-align: center;
    border: 1px solid var(--color-border-light);
    color: var(--color-text);
    white-space: pre-line;
}

/* --- Sloka Transliteration --- */
.sloka-transliteration {
    font-size: 0.95rem;
    line-height: 1.9;
    padding: 1rem 1.25rem;
    background: var(--color-white);
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-style: italic;
    color: var(--color-text);
    border: 1px solid var(--color-border-light);
    text-align: center;
    white-space: pre-line;
}

/* --- Word-by-Word --- */
.word-section-label {
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-saffron);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
    margin-top: 0.5rem;
}

.word-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.word-card {
    background: var(--color-white);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius);
    padding: 0.85rem 0.65rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
    min-width: 0;
    overflow: hidden;
}

.word-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--color-saffron);
    transform: translateY(-2px);
}

.word-devanagari {
    font-family: var(--font-devanagari);
    font-size: 1.4rem;
    line-height: 1.4;
    color: var(--color-text);
    margin-bottom: 0.35rem;
    font-weight: 500;
    overflow-wrap: break-word;
    word-break: break-word;
}

.word-transliteration {
    font-size: 0.8rem;
    font-style: italic;
    color: var(--color-saffron);
    margin-bottom: 0.3rem;
    line-height: 1.3;
    overflow-wrap: break-word;
    word-break: break-word;
}

.word-meaning {
    font-size: 0.72rem;
    color: var(--color-text-muted);
    line-height: 1.4;
    overflow-wrap: break-word;
    word-break: break-word;
}

/* --- Translation Block --- */
.translation-block {
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    border-left: 3px solid var(--color-saffron);
    background: var(--color-saffron-pale);
    border-radius: 0 var(--radius) var(--radius) 0;
}

.translation-label {
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-saffron);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.4rem;
}

.translation-text {
    font-size: 0.92rem;
    line-height: 1.7;
    color: var(--color-text);
}

/* --- Commentary Block --- */
.commentary-block {
    padding: 1rem 1.25rem;
    margin-bottom: 0;
    border-left: 3px solid var(--color-green);
    background: rgba(27, 94, 32, 0.04);
    border-radius: 0 var(--radius) var(--radius) 0;
}

.commentary-label {
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-green);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.4rem;
}

.commentary-text {
    font-size: 0.88rem;
    line-height: 1.75;
    color: var(--color-text-muted);
    font-style: italic;
}

/* --- Coming Soon --- */
.coming-soon {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--color-text-muted);
}

.coming-soon-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    opacity: 0.5;
}

.coming-soon-title {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 0.5rem;
}

.coming-soon-text {
    font-size: 0.9rem;
    font-style: italic;
    line-height: 1.6;
}

/* --- Search --- */
.search-box {
    position: relative;
    margin-bottom: 1.5rem;
}

.search-box input {
    width: 100%;
    padding: 0.9rem 1.25rem;
    padding-right: 5rem;
    border: 2px solid var(--color-border);
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--color-text);
    background: var(--color-white);
    outline: none;
    transition: border-color 0.2s ease;
}

.search-box input:focus {
    border-color: var(--color-saffron);
}

.search-box input::placeholder {
    color: var(--color-border);
}

.search-count {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.search-match-field {
    font-size: 0.7rem;
    color: var(--color-text-muted);
    font-style: italic;
    flex: 1;
}

mark {
    background: rgba(218, 165, 32, 0.25);
    color: var(--color-text);
    padding: 0.1em 0.2em;
    border-radius: 3px;
    font-weight: 600;
}

/* --- Floating Scroll Buttons --- */
.scroll-buttons {
    position: fixed;
    bottom: 2rem;
    right: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.scroll-buttons.visible {
    opacity: 1;
    pointer-events: auto;
}

.scroll-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid var(--color-border);
    background: var(--color-white);
    color: var(--color-saffron);
    font-size: 1rem;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.scroll-btn:hover {
    background: var(--color-saffron);
    color: var(--color-white);
    border-color: var(--color-saffron);
    box-shadow: var(--shadow-lg);
    transform: scale(1.1);
}

/* --- Footer --- */
.site-footer {
    text-align: center;
    padding: 2rem 1.5rem;
    background: linear-gradient(135deg, #7a5c1e 0%, #B8860B 50%, #7a5c1e 100%);
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.85rem;
    margin-top: 3rem;
}

.footer-ornament {
    font-size: 1.2rem;
    color: var(--color-gold-light);
    margin-bottom: 0.75rem;
    opacity: 0.8;
}

.footer-note {
    font-size: 0.75rem;
    opacity: 0.5;
    margin-top: 0.25rem;
}

.footer-note a {
    color: var(--color-gold-light);
    text-decoration: none;
}

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

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

/* --- Tablet (max-width: 768px) --- */
@media (max-width: 768px) {
    .dashaka-grid-inner {
        grid-template-columns: repeat(4, 1fr);
    }

    .word-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 0.6rem;
    }

    .sloka-devanagari {
        font-size: 1.15rem;
        padding: 1.25rem;
    }
}

/* --- Mobile (max-width: 600px) --- */
@media (max-width: 600px) {
    html {
        font-size: 16px;
    }

    .top-bar {
        padding: 0.4rem 0.8rem;
        font-size: 0.68rem;
    }

    .top-bar-title {
        display: none;
    }

    .site-header {
        padding: 2rem 1rem 1.5rem;
    }

    .site-title {
        font-size: 1.8rem;
    }

    .site-subtitle {
        font-size: 0.95rem;
    }

    .header-sections {
        flex-direction: column;
        gap: 0.4rem;
    }

    .nav-btn {
        font-size: 0.75rem;
        padding: 0.7rem 0.3rem;
    }

    .content {
        padding: 0 0.75rem;
    }

    /* Dashaka grid: 3 columns on mobile */
    .dashaka-grid-inner {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }

    .dashaka-card {
        padding: 0.6rem 0.35rem;
    }

    .dashaka-card-number {
        font-size: 1.2rem;
    }

    .dashaka-card-title {
        font-size: 0.58rem;
    }

    .dashaka-card-icon {
        font-size: 0.75rem;
    }

    /* Detail view */
    .dashaka-nav-controls {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .nav-control-btn {
        font-size: 0.75rem;
        padding: 0.35rem 0.75rem;
    }

    .dashaka-quick-jump {
        order: 3;
        width: 100%;
    }

    .dashaka-quick-jump select {
        width: 100%;
        max-width: none;
    }

    .dashaka-bottom-nav {
        flex-direction: column;
        gap: 0.5rem;
    }

    .bottom-nav-btn {
        width: 100%;
        text-align: center;
        font-size: 0.78rem;
        padding: 0.5rem 1rem;
    }

    .theme-filter-btn {
        font-size: 0.65rem;
        padding: 0.25rem 0.6rem;
    }

    .dashaka-header {
        padding: 1rem;
    }

    .dashaka-header-title {
        font-size: 1.15rem;
    }

    /* Verse cards */
    .verse-body {
        padding: 0.75rem;
    }

    .sloka-devanagari {
        font-size: 1.05rem;
        padding: 1rem;
        line-height: 1.8;
    }

    .sloka-transliteration {
        font-size: 0.85rem;
        padding: 0.75rem;
    }

    /* Word grid: auto-fill on mobile */
    .word-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 0.5rem;
    }

    .word-card {
        padding: 0.65rem 0.5rem;
    }

    .word-devanagari {
        font-size: 1.2rem;
    }

    .word-transliteration {
        font-size: 0.72rem;
    }

    .word-meaning {
        font-size: 0.65rem;
    }

    /* Search */
    .search-box input {
        padding: 0.75rem 4rem 0.75rem 1rem;
        font-size: 0.9rem;
    }

    /* Scroll buttons */
    .scroll-buttons {
        bottom: 1.25rem;
        right: 1rem;
    }

    .scroll-btn {
        width: 38px;
        height: 38px;
        font-size: 0.9rem;
    }

    /* Theme legend */
    .theme-legend {
        gap: 0.5rem;
    }

    .legend-item {
        font-size: 0.65rem;
    }
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
    .progress-bar,
    .view-nav,
    .expand-controls,
    .verse-toggle,
    .search-box,
    .top-bar,
    .scroll-buttons,
    .dashaka-nav-controls,
    .theme-legend,
    .reading-stats {
        display: none !important;
    }

    .verse-card .verse-body {
        max-height: none !important;
        opacity: 1 !important;
        padding: 1.25rem !important;
        overflow: visible !important;
    }

    .verse-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }

    .word-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }

    body {
        font-size: 12pt;
        background: #fff;
        color: #000;
    }

    .site-header {
        background: none;
        color: #000;
        border-bottom: 2px solid #B8860B;
    }

    .site-title {
        -webkit-text-fill-color: initial;
        background: none;
        color: #2c1810;
    }

    .site-footer {
        background: none;
        color: #000;
        border-top: 1px solid #ccc;
    }
}
