:root {
    --primary: #2563eb;
    --primary-light: #3b82f6;
    --primary-dark: #1d4ed8;
    --secondary: #64748b;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --bg: #f8fafc;
    --surface: #ffffff;
    --surface-hover: #f1f5f9;
    --text: #1e293b;
    --text-secondary: #64748b;
    --border: #e2e8f0;
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius: 8px;
    --radius-lg: 12px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 100%;
    margin: 0 auto;
    padding: 1.5rem 2rem;
}

header {
    text-align: center;
    margin-bottom: 2rem;
}

h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Top navigation between the two pages */
.top-nav {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.hamburger {
    display: none;
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.5rem 1rem;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s;
}

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

@media (max-width: 768px) {
    .hamburger {
        display: block;
    }
    
    .top-nav {
        flex-direction: column;
        gap: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }
    
    .top-nav.open {
        max-height: 200px;
    }
    
    .top-nav a {
        padding: 0.75rem 1rem;
        font-size: 1rem;
        border-radius: 0;
        border-bottom: 1px solid var(--border);
    }
    
    .top-nav a.active {
        background: var(--primary);
        border-color: var(--primary);
        color: white;
    }
}

.top-nav a {
    text-decoration: none;
    padding: 0.5rem 1.5rem;
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    background: var(--surface);
    transition: all 0.2s;
}

.top-nav a:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.top-nav a.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* Reading Test Selector */
.test-selector {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

.test-selector label {
    font-weight: 500;
    margin-right: 1rem;
    color: var(--text);
}

.test-selector select {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    background: var(--surface);
    cursor: pointer;
    min-width: 300px;
}

.test-selector select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Main Layout */
.main-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    min-height: calc(100vh - 200px);
    position: relative;
}

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
    
    .subtitle {
        font-size: 0.9rem;
    }
    
    .test-selector select {
        min-width: 100%;
    }
    
    .stats-bar {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .stat-card {
        min-width: 100%;
        padding: 0.75rem 1rem;
    }
    
    .main-layout {
        grid-template-columns: 1fr;
        gap: 1rem;
        min-height: auto;
    }
    
    .reading-section {
        padding: 1.5rem;
    }
    
    .reading-title {
        font-size: 1.5rem;
    }
    
    .reading-content {
        font-size: 1rem;
    }
    
    .section-heading {
        font-size: 1.125rem;
        margin: 1rem 0 0.5rem;
    }
    
    .sentence {
        padding: 0.25rem;
        margin: 0 -0.25rem;
    }
    
    .analysis-panel {
        position: static;
        max-height: none;
        margin-top: 1rem;
    }
    
    .top-nav {
        flex-direction: row;
        justify-content: center;
        gap: 0.25rem;
    }
    
    .top-nav a {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }
    
    .theme-toggle {
        bottom: 1rem;
        right: 1rem;
        width: 44px;
        height: 44px;
        font-size: 1.2rem;
    }
    
    .answer-options {
        flex-direction: column;
    }
    
    .gap-inputs input {
        min-width: 100px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0.75rem;
    }
    
    header h1 {
        font-size: 1.25rem;
    }
    
    .subtitle {
        font-size: 0.85rem;
    }
    
    .test-selector label {
        display: none;
    }
    
    .test-selector select {
        padding: 0.5rem;
        font-size: 0.85rem;
    }
    
    .stats-bar {
        gap: 0.5rem;
    }
    
    .stat-card {
        padding: 0.5rem 0.75rem;
        min-width: 100%;
    }
    
    .stat-value {
        font-size: 1.25rem;
    }
    
    .main-layout {
        gap: 0.75rem;
    }
    
    .reading-section {
        padding: 1rem;
    }
    
    .reading-title {
        font-size: 1.3rem;
    }
    
    .reading-content {
        font-size: 0.95rem;
        line-height: 1.4;
    }
    
    .section-heading {
        font-size: 1rem;
        margin: 0.75rem 0 0.5rem;
    }
    
    .sentence {
        padding: 0.15rem 0.25rem;
        margin: 0 -0.25rem;
        font-size: 0.95rem;
    }
    
    .sentence-number {
        font-size: 0.65rem;
    }
    
    .analysis-panel {
        padding: 1rem 0.75rem;
    }
    
    .panel-header {
        margin-bottom: 0.5rem;
    }
    
    .panel-title {
        font-size: 0.9rem;
    }
    
    .question-group-title {
        font-size: 1rem;
    }
    
    .question-item {
        padding: 0.75rem;
    }
    
    .question-text {
        font-size: 0.9rem;
    }
    
    .answer-options {
        flex-direction: column;
    }
    
    .opt-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }
    
    .gap-inputs input {
        min-width: 120px;
        font-size: 0.85rem;
        padding: 0.4rem 0.5rem;
    }
    
    .check-btn,
    .reset-btn {
        padding: 0.4rem 0.75rem;
        font-size: 0.75rem;
    }
    
    .feedback {
        font-size: 0.8rem;
    }
    
    .explanation {
        font-size: 0.75rem;
        padding: 0.4rem 0.5rem;
    }
    
    .sentence.active {
        border-radius: 2px;
    }
    
    .theme-toggle {
        bottom: 0.75rem;
        right: 0.75rem;
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
}

/* Reading Section */
.reading-section {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 2rem 2.5rem;
    box-shadow: var(--shadow);
}

.reading-title {
    font-family: 'Merriweather', Georgia, serif;
    font-size: 1.85rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text);
    line-height: 1.3;
}

.reading-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-style: italic;
}

.reading-content {
    font-family: 'Merriweather', Georgia, serif;
    font-size: 1.15rem;
    line-height: 2;
}

.section-heading {
    font-family: 'Merriweather', Georgia, serif;
    font-size: 1.25rem;
    font-weight: 600;
    margin: 1.5rem 0 0.75rem;
    color: var(--text);
}

/* Sentence highlighting */
.sentence {
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    margin: 0 -0.5rem;
    border-radius: 4px;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.sentence:hover {
    background: var(--surface-hover);
}

.sentence.active {
    background: #eff6ff;
    border-left-color: var(--primary);
}

.sentence-number {
    display: inline-block;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-right: 0.5rem;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    opacity: 0;
    transition: opacity 0.2s;
}

.sentence:hover .sentence-number,
.sentence.active .sentence-number {
    opacity: 1;
}

/* Questions */
.questions-instructions {
    background: var(--surface-hover);
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.question-group-title {
    font-family: 'Merriweather', Georgia, serif;
    font-size: 1.1rem;
    font-weight: 600;
    margin: 1.5rem 0 0.75rem;
    color: var(--text);
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.question-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 0.75rem;
}

.question-number {
    display: inline-block;
    background: var(--primary);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 3px;
    margin-right: 0.5rem;
}

.question-text {
    font-size: 0.95rem;
    color: var(--text);
    line-height: 1.6;
    margin-bottom: 0.75rem;
}

.question-text .blank {
    color: var(--primary);
    font-weight: 600;
    border-bottom: 2px solid var(--primary);
    padding: 0 0.25rem;
}

.answer-options {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.opt-btn {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.4rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    color: var(--text);
    text-align: left;
    line-height: 1.4;
}

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

.opt-btn.correct {
    background: #d1fae5;
    border-color: var(--success);
    color: #065f46;
}

.opt-btn.wrong {
    background: #fee2e2;
    border-color: var(--danger);
    color: #991b1b;
}

.opt-btn.revealed-correct {
    background: #d1fae5;
    border-color: var(--success);
    color: #065f46;
}

.gap-inputs {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.gap-inputs input {
    flex: 1;
    min-width: 200px;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.9rem;
    background: var(--surface);
    color: var(--text);
}

.gap-inputs input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.check-btn,
.reset-btn {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    padding: 0.5rem 1.25rem;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.check-btn:hover,
.reset-btn:hover {
    background: var(--primary-dark);
}

.reset-btn {
    background: var(--warning);
}

.reset-btn:hover {
    background: #d97706;
}

.feedback {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    display: none;
}

.feedback.correct-fb {
    color: var(--success);
}

.feedback.wrong-fb {
    color: var(--danger);
}

.explanation {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    background: var(--surface-hover);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
    display: none;
    line-height: 1.5;
}

.quiz-controls {
    display: flex;
    gap: 0.5rem;
    margin-top: 1.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.score-display {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary);
    background: #eff6ff;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
}

/* Analysis Panel */
.analysis-panel {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    overflow-y: auto;
    position: sticky;
    top: 1rem;
    max-height: calc(100vh - 2rem);
    align-self: start;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.panel-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0.25rem;
    line-height: 1;
}

.close-btn:hover {
    color: var(--text);
}

.panel-placeholder {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
}

.panel-placeholder svg {
    width: 64px;
    height: 64px;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.analysis-content {
    display: none;
}

.analysis-content.active {
    display: block;
}

.analysis-section {
    margin-bottom: 1.5rem;
}

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

.analysis-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.analysis-label .icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    font-size: 0.75rem;
}

.icon-vocab {
    background: #dbeafe;
    color: var(--primary);
}

.icon-grammar {
    background: #d1fae5;
    color: var(--success);
}

.icon-structure {
    background: #fef3c7;
    color: var(--warning);
}

.icon-note {
    background: #ede9fe;
    color: #8b5cf6;
}

.original-sentence {
    background: var(--surface-hover);
    padding: 0.6rem 0.75rem;
    border-radius: var(--radius);
    font-family: 'Merriweather', Georgia, serif;
    font-size: 0.88rem;
    line-height: 1.5;
    margin-bottom: 0.75rem;
    border-left: 3px solid var(--primary);
}

.vocab-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.vocab-item {
    background: #f0f9ff;
    padding: 0.35rem 0.6rem;
    border-radius: var(--radius);
    border: 1px solid #bae6fd;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.25rem 0.5rem;
    font-size: 0.88rem;
    line-height: 1.4;
}

.vocab-word {
    font-weight: 600;
    color: var(--primary-dark);
    font-size: 0.95rem;
}

.vocab-phonetic {
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin-left: 0;
}

.vocab-pos {
    display: inline-block;
    background: var(--primary);
    color: white;
    font-size: 0.65rem;
    padding: 0.05rem 0.35rem;
    border-radius: 3px;
    margin-left: 0.25rem;
    font-weight: 500;
}

.vocab-definition {
    font-size: 0.85rem;
    color: var(--text);
    flex: 1 1 auto;
}

.vocab-example {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-style: italic;
    width: 100%;
}

.vocab-paraphrase {
    font-size: 0.82rem;
    color: var(--primary-dark);
    width: 100%;
    border-top: 1px dashed var(--border);
    padding-top: 0.15rem;
    margin-top: 0.1rem;
}

.vocab-paraphrase em {
    color: var(--primary);
    font-style: normal;
}

.vocab-collocations {
    font-size: 0.8rem;
    color: var(--text-secondary);
    width: 100%;
}

body.dark-theme .vocab-paraphrase {
    color: #93c5fd;
}

.grammar-item {
    background: #f0fdf4;
    padding: 0.35rem 0.6rem;
    border-radius: var(--radius);
    border: 1px solid #bbf7d0;
    margin-bottom: 0.4rem;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.25rem 0.5rem;
    font-size: 0.85rem;
    line-height: 1.4;
}

.grammar-item:last-child {
    margin-bottom: 0;
}

.grammar-pattern {
    font-weight: 600;
    color: #166534;
    font-size: 0.88rem;
}

.grammar-explanation {
    font-size: 0.85rem;
    color: var(--text);
    flex: 1 1 auto;
}

.structure-item {
    background: #fffbeb;
    padding: 0.35rem 0.6rem;
    border-radius: var(--radius);
    border: 1px solid #fde68a;
    margin-bottom: 0.4rem;
    font-size: 0.85rem;
    line-height: 1.4;
}

.structure-item:last-child {
    margin-bottom: 0;
}

.structure-type {
    font-weight: 600;
    color: #92400e;
    font-size: 0.88rem;
}

.structure-explanation {
    margin-top: 0.15rem;
    font-size: 0.85rem;
    color: var(--text);
}

.note-item {
    background: #f5f3ff;
    padding: 0.5rem 0.6rem;
    border-radius: var(--radius);
    border: 1px solid #ddd6fe;
    font-size: 0.85rem;
    color: var(--text);
    line-height: 1.6;
}

/* Stats Bar */
.stats-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.stat-card {
    background: var(--surface);
    padding: 1rem 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    flex: 1;
    min-width: 150px;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
}

.stat-value.primary {
    color: var(--primary);
}

.stat-value.success {
    color: var(--success);
}

.stat-value.warning {
    color: var(--warning);
}

/* Progress Tracking */
.progress-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.progress-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.progress-bar {
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* Bookmark Button */
.bookmark-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    transition: all 0.2s;
}

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

.bookmark-btn.bookmarked {
    background: #fef3c7;
    border-color: #f59e0b;
    color: #92400e;
}

/* Dark mode toggle */
.theme-toggle {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    font-size: 1.25rem;
    transition: all 0.2s;
}

.theme-toggle:hover {
    transform: scale(1.1);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.analysis-content.active {
    animation: fadeIn 0.3s ease;
}

/* Scrollbar styling */
.analysis-panel::-webkit-scrollbar {
    width: 6px;
}

.analysis-panel::-webkit-scrollbar-track {
    background: var(--surface-hover);
    border-radius: 3px;
}

.analysis-panel::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.analysis-panel::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Print styles */
@media print {
    .analysis-panel,
    .theme-toggle,
    .test-selector,
    .stats-bar,
    .top-nav {
        display: none !important;
    }

    .main-layout {
        grid-template-columns: 1fr;
    }

    .sentence {
        cursor: default;
    }

    .sentence:hover {
        background: none;
    }
}

/* Dark Theme */
body.dark-theme {
    --bg: #0f172a;
    --surface: #1e293b;
    --surface-hover: #334155;
    --text: #f1f5f9;
    --text-secondary: #94a3b8;
    --border: #334155;
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.3), 0 1px 2px -1px rgb(0 0 0 / 0.3);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.3), 0 4px 6px -4px rgb(0 0 0 / 0.3);
}

body.dark-theme .vocab-item {
    background: #1e3a5f;
    border-color: #2563eb;
}

body.dark-theme .vocab-word {
    color: #60a5fa;
}

body.dark-theme .grammar-item {
    background: #14532d;
    border-color: #22c55e;
}

body.dark-theme .grammar-pattern {
    color: #4ade80;
}

body.dark-theme .structure-item {
    background: #451a03;
    border-color: #f59e0b;
}

body.dark-theme .structure-type {
    color: #fbbf24;
}

body.dark-theme .note-item {
    background: #2e1065;
    border-color: #a78bfa;
}

body.dark-theme .original-sentence {
    background: #1e293b;
    border-left-color: #60a5fa;
}

body.dark-theme .sentence.active {
    background: #1e3a5f;
    border-left-color: #3b82f6;
}

body.dark-theme .bookmark-btn.bookmarked {
    background: #451a03;
    border-color: #f59e0b;
    color: #fbbf24;
}

body.dark-theme .stat-card,
body.dark-theme .question-item {
    background: #1e293b;
}

body.dark-theme .opt-btn.correct,
body.dark-theme .opt-btn.revealed-correct {
    background: #14532d;
    border-color: #22c55e;
    color: #4ade80;
}

body.dark-theme .opt-btn.wrong {
    background: #7f1d1d;
    border-color: #ef4444;
    color: #fca5a5;
}

body.dark-theme .feedback.correct-fb {
    color: #4ade80;
}

body.dark-theme .feedback.wrong-fb {
    color: #fca5a5;
}

body.dark-theme .score-display {
    background: #1e3a5f;
}

body.dark-theme .top-nav a.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}
/* Mobile Bottom Sheet */
.mobile-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.mobile-backdrop.active {
    display: block;
}

.mobile-bottom-sheet {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--surface);
    border-top-left-radius: var(--radius-lg);
    border-top-right-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: 1050;
    max-height: 75vh;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.mobile-bottom-sheet.active {
    display: block;
    transform: translateY(0);
}

@media (max-width: 768px) {
    .mobile-backdrop,
    .mobile-bottom-sheet {
        display: none; /* Initially hidden */
    }
    
    /* Hide desktop analysis panel on mobile */
    .analysis-panel {
        display: none;
    }
}

.mobile-sheet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--border);
}

.mobile-sheet-title {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text);
}

.mobile-close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0.25rem;
    line-height: 1;
}

.mobile-close-btn:hover {
    color: var(--text);
}

.mobile-sheet-content {
    padding: 1rem;
}

.mobile-original-sentence {
    background: var(--surface-hover);
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    font-family: 'Merriweather', Georgia, serif;
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 1rem;
    border-left: 3px solid var(--primary);
}

.mobile-bookmark-btn {
    width: 100%;
    text-align: left;
    justify-content: flex-start;
    padding: 0.75rem 1rem;
    margin-top: 1rem;
}

/* Resize Handle Styles */
.panel-resize-handle {
    width: 8px;
    height: 100%;
    position: absolute;
    top: 0;
    left: calc(50% - 4px);
    cursor: col-resize;
    background: transparent;
    transition: background 0.2s;
    z-index: 2;
}

.panel-resize-handle:hover,
.panel-resize-handle.dragging {
    background: var(--primary);
}

.mobile-resize-handle {
    width: 44px;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    margin: 0 auto 0.5rem;
    cursor: row-resize;
}

.mobile-resize-handle:active {
    background: var(--primary);
}

