/* Base styles from your styles.css */
body { font-family: 'Inter', sans-serif; }
textarea::-webkit-scrollbar { width: 8px; }
textarea::-webkit-scrollbar-track { background: transparent; }
textarea::-webkit-scrollbar-thumb { background-color: #d1d5db; border-radius: 20px; border: 3px solid transparent; }
.dark textarea::-webkit-scrollbar-thumb { background-color: #4b5563; }
* { transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out, border-color 0.2s ease-in-out; }
.output-box { -webkit-appearance: none; -moz-appearance: none; appearance: none; resize: none; overflow-y: auto; }


/* CSS Custom Properties for Safe Area Insets */
:root {
    --sat: env(safe-area-inset-top, 0px);
    --sab: env(safe-area-inset-bottom, 0px);
    --sal: env(safe-area-inset-left, 0px);
    --sar: env(safe-area-inset-right, 0px);
}

/* Browser compatibility fixes for text areas */
@supports not (height: 100dvh) {
    body {
        height: 100vh !important;
    }
}

/* Ensure text areas don't shrink in different browsers */
textarea {
    box-sizing: border-box !important;
    min-height: 180px !important;
}

/* Fix for browsers that don't support calc() properly */
@supports not (height: calc(50% - 0.125rem)) {
    .w-full.md\:w-1\/2 {
        height: 45% !important;
        min-height: 200px !important;
    }
}

/* Additional fixes for testing tools and emulators */
@media screen and (max-width: 768px) {
    /* Force minimum sizes for problematic browsers */
    .w-full.md\:w-1\/2 {
        min-height: 200px !important;
        height: 45% !important;
    }
    
    /* Ensure text areas don't shrink */
    #input-text, #output-text {
        min-height: 180px !important;
        height: 100% !important;
        flex: 1 !important;
    }
    
    /* Override any conflicting styles */
    .flex.flex-col.md\:flex-row {
        min-height: 400px !important;
    }
}

/* Feedback note inline styles */
#feedback-note-text {
    font-size: 0.875rem; /* text-sm - increased from text-xs */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: none; /* Remove max-width constraint for desktop */
    flex-shrink: 0; /* Prevent shrinking */
}

@media (max-width: 768px) {
    #feedback-note-text {
        font-size: 0.75rem; /* text-xs on tablets and smaller */
        max-width: 400px; /* Much more generous width for tablets */
    }
}

@media (max-width: 480px) {
    #feedback-note-text {
        font-size: 0.625rem; /* Smaller on very small screens */
        max-width: 250px; /* Only restrict on very small screens */
    }
}

/* Mobile Navigation Styles */
.mobile-nav { 
    position: fixed; 
    bottom: 0; 
    left: 0; 
    right: 0; 
    z-index: 1000; 
    background: rgba(255, 255, 255, 0.95); 
    backdrop-filter: blur(10px);
    border-top: 1px solid #e5e7eb;
    height: calc(3.5rem + var(--sab));
    min-height: calc(3.5rem + var(--sab));
    max-height: calc(3.5rem + var(--sab));
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: stretch;
    padding-bottom: 0; /* safe area handled by child absolute positioning */
}
.dark .mobile-nav { 
    background: rgba(17, 24, 39, 0.95); 
    border-top-color: #374151; 
}
.mobile-nav-tabs { 
    position: absolute;
    left: 0;
    right: 0;
    bottom: var(--sab);
    height: 3.5rem;
    display: flex; 
    justify-content: space-around; 
    align-items: center; 
    padding-top: 0; 
    padding-bottom: 0;
}
.mobile-nav-tab { 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    padding: 0.375rem; 
    border-radius: 0.5rem; 
    transition: all 0.2s ease; 
    color: #6b7280; 
    text-decoration: none; 
    min-width: 3.5rem;
}
.mobile-nav-tab.active { 
    color: #2563eb; 
    background-color: rgba(37, 99, 235, 0.1); 
}
.dark .mobile-nav-tab.active { 
    color: #60a5fa; 
    background-color: rgba(96, 165, 250, 0.1); 
}
.mobile-nav-tab:hover { 
    background-color: rgba(0, 0, 0, 0.05); 
}
.dark .mobile-nav-tab:hover { 
    background-color: rgba(255, 255, 255, 0.05); 
}
.mobile-nav-icon { 
    width: 1.25rem; 
    height: 1.25rem; 
    margin-bottom: 0.125rem; 
}
.mobile-nav-label { 
    font-size: 0.625rem; 
    font-weight: 500; 
    text-align: center; 
}

/* Mobile Header Styles */
.mobile-header { 
    position: fixed; 
    top: 0; 
    left: 0; 
    right: 0; 
    z-index: 1002; /* Higher than language switcher */
    background: rgba(255, 255, 255, 0.95); 
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #e5e7eb;
    padding: 0.375rem 1rem; 
    padding-top: calc(0.375rem + var(--sat));
    height: calc(3rem + var(--sat));
    min-height: calc(3rem + var(--sat));
    max-height: calc(3rem + var(--sat));
    /* Ensure header doesn't interfere with pull-to-refresh */
    pointer-events: none;
}
.mobile-header-content {
    pointer-events: auto;
}
.dark .mobile-header { 
    background: rgba(17, 24, 39, 0.95); 
    border-bottom-color: #374151; 
}
.mobile-header-content { 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    gap: 0.5rem; 
    height: 100%;
    position: relative; /* allow right-aligned overlay button */
}
.mobile-logo { 
    width: 1.75rem; 
    height: 1.75rem; 
}
.mobile-app-name { 
    font-size: 1rem; 
    font-weight: 700; 
    color: #111827; 
}
.dark .mobile-app-name { 
    color: #fff; 
}

@media (max-width: 768px) {
    body { 
        justify-content: flex-start !important; 
        padding-top: calc(3rem + var(--sat)) !important; 
        padding-bottom: calc(3.5rem + var(--sab)) !important; 
        min-height: 100vh !important;
        min-height: 100dvh !important; /* Dynamic viewport height */
        overflow-y: auto !important; /* Allow vertical scrolling for pull-to-refresh */
        overflow-x: hidden !important; /* Prevent horizontal scrolling */
    }
    main { 
        margin-top: 0 !important; 
        min-height: calc(100vh - 6.5rem - var(--sat) - var(--sab)) !important;
        min-height: calc(100dvh - 6.5rem - var(--sat) - var(--sab)) !important;
        max-height: calc(100vh - 6.5rem - var(--sat) - var(--sab)) !important;
        max-height: calc(100dvh - 6.5rem - var(--sat) - var(--sab)) !important;
        overflow: visible !important; /* Allow content to overflow for pull-to-refresh */
    }
    .mobile-translator-container {
        margin-top: 0 !important;
        border-radius: 0 !important;
        height: calc(100dvh - 3rem - 3.5rem - var(--sat) - var(--sab)) !important; /* header(3rem) + nav(3.5rem) */
        max-height: calc(100dvh - 3rem - 3.5rem - var(--sat) - var(--sab)) !important;
        box-sizing: border-box !important;
        /* Ensure language switcher is visible */
        position: relative;
        z-index: 1000; /* Higher than mobile header */
    }
    
    /* Ensure language switcher border is visible */
    .flex.flex-row.items-center.justify-between.border-b {
        position: relative;
        z-index: 1001; /* Higher than container but below header */
        background: white;
        margin-top: 0 !important; /* Body already padded for header height */
    }
    .dark .flex.flex-row.items-center.justify-between.border-b {
        background: #1f2937; /* dark:bg-gray-800 */
    }
    .bg-white.dark\:bg-gray-800 { 
        height: 100% !important; 
        display: flex !important; 
        flex-direction: column !important; 
        overflow: hidden !important;
        border-radius: 0 !important;
    }
    .flex.flex-col.md\:flex-row { 
        flex: 1 !important; 
        display: flex !important; 
        flex-direction: column !important; 
        gap: 0.25rem !important;
        min-height: 0 !important;
        overflow: hidden !important;
    }
    .w-full.md\:w-1\/2 { 
        flex: 1 !important; 
        min-height: 0 !important;
        max-height: calc(50% - 0.125rem) !important;
        overflow: hidden !important;
        height: calc(50% - 0.125rem) !important;
        min-height: 200px !important; /* Ensure minimum height */
    }
    .w-full.h-64.md\:h-80 { 
        height: 100% !important; 
        min-height: 0 !important;
        max-height: 100% !important;
        overflow: hidden !important;
        min-height: 200px !important; /* Ensure minimum height */
    }
    #input-text {
        height: 100% !important;
        min-height: 180px !important; /* Ensure minimum height */
        max-height: 100% !important;
        overflow-y: auto !important;
        resize: none !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: thin !important;
        font-size: 16px !important;
        flex: 1 !important;
        padding-bottom: 2rem !important; /* Further reduced space for buttons and char counter */
    }
    #output-text { 
        height: 100% !important;
        min-height: 180px !important; /* Ensure minimum height */
        max-height: 100% !important;
        overflow-y: auto !important;
        padding-bottom: 2rem !important; /* Further reduced space for buttons */
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: thin !important;
        font-size: 16px !important;
        flex: 1 !important;
    }
    #feedback-note { 
        padding-bottom: 0.5rem !important; 
        margin-bottom: 0 !important;
    }
    .desktop-header { display: none !important; }
    
    /* Ensure mobile header and nav don't take too much space */
    .mobile-header {
        height: calc(3rem + var(--sat)) !important;
        min-height: calc(3rem + var(--sat)) !important;
        max-height: calc(3rem + var(--sat)) !important;
    }
    .mobile-nav {
        height: calc(3.5rem + var(--sab)) !important;
        min-height: calc(3.5rem + var(--sab)) !important;
        max-height: calc(3.5rem + var(--sab)) !important;
    }
    
    /* Reduce padding and margins for better space utilization */
    .p-4 {
        padding: 0.75rem !important;
    }
    .px-4 {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }
    .py-6 {
        padding-top: 1rem !important;
        padding-bottom: 1rem !important;
    }

    /* When keyboard is open, relax split heights and allow scroll */
    body.keyboard-open .mobile-translator-container {
        overflow-y: auto !important;
        overflow-x: hidden !important;
    }
    /* removed keyboard-open flex override */
    /* No panel size overrides on keyboard-open */
    /* No textarea size overrides on keyboard-open */
}
@media (min-width: 769px) {
    .mobile-nav { display: none !important; }
    .mobile-header { display: none !important; }
    .mobile-more-dropdown { display: none !important; }
}

/* iOS standalone (Add to Home Screen) adjustments */
@media (max-width: 768px) {
    .standalone body {
        padding-bottom: calc(4rem + var(--sab)) !important; /* add a bit more space above the fixed bottom nav */
    }
    .standalone .mobile-translator-container {
        margin-top: -0.75rem !important; /* Nudge content up to avoid overlap under bottom nav */
    }
}

/* Minimal, auto-appearing scrollbars for input/output (cross-browser) */
#input-text, #output-text { 
    overflow-y: auto; /* show scrollbar only when needed */
    -webkit-overflow-scrolling: touch; /* momentum on iOS */
    scrollbar-width: thin; /* Firefox */
    scrollbar-color: #d1d5db transparent; /* Firefox */
}
.dark #input-text, .dark #output-text { 
    scrollbar-color: #4b5563 transparent; /* Firefox dark */
}
/* WebKit-based browsers */
#input-text::-webkit-scrollbar, #output-text::-webkit-scrollbar { width: 8px; height: 8px; }
#input-text::-webkit-scrollbar-track, #output-text::-webkit-scrollbar-track { background: transparent; }
#input-text::-webkit-scrollbar-thumb, #output-text::-webkit-scrollbar-thumb { background-color: #d1d5db; border-radius: 20px; border: 2px solid transparent; }
.dark #input-text::-webkit-scrollbar-thumb, .dark #output-text::-webkit-scrollbar-thumb { background-color: #4b5563; }

/* Custom mobile overlay scrollbar */
@media (max-width: 768px) {
    .custom-scrollbar {
        position: absolute;
        top: 6px;
        right: 2px;
        bottom: 6px;
        width: 4px;
        background: transparent;
        pointer-events: none;
        opacity: 0;
        transition: opacity 0.2s ease;
    }
    .custom-scrollbar-thumb {
        position: absolute;
        right: 0;
        width: 4px;
        border-radius: 9999px;
        background: rgba(209, 213, 219, 0.9); /* gray-300 */
        box-shadow: 0 0 1px rgba(0,0,0,0.1);
    }
    .dark .custom-scrollbar-thumb {
        background: rgba(75, 85, 99, 0.9); /* gray-600 */
    }
}

/* Add to Home Screen Banner Styles */
.a2hs-banner {
    position: fixed;
    bottom: calc(3.5rem + var(--sab));
    left: 0;
    right: 0;
    z-index: 1001;
    background: #059669;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    animation: slideUpFadeIn 0.4s ease-out;
}

.a2hs-banner-content {
    display: flex;
    align-items: center;
    padding: 0.625rem 1rem;
    gap: 0.75rem;
    max-width: 100%;
}

.a2hs-banner-icon {
    font-size: 1.125rem;
    flex-shrink: 0;
}

.a2hs-banner-text {
    flex: 1;
    min-width: 0;
}

.a2hs-banner-title {
    color: white;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.2;
    margin: 0;
}

.a2hs-banner-subtitle {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.75rem;
    line-height: 1.2;
    margin: 0;
}

.a2hs-banner-action {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 0.375rem;
    padding: 0.5rem 1rem; /* Increased from 0.25rem 0.5rem */
    font-size: 0.875rem; /* Increased from 0.75rem */
    font-weight: 600; /* Increased from 500 */
    cursor: pointer;
    transition: background 0.2s ease;
    flex-shrink: 0;
    margin-right: 0.75rem; /* Added spacing from close button */
}

.a2hs-banner-action:hover {
    background: rgba(255, 255, 255, 0.25);
}

.a2hs-banner-close {
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    border: none;
    font-size: 1.25rem; /* Slightly increased from 1.125rem */
    line-height: 1;
    cursor: pointer;
    padding: 0.375rem; /* Slightly increased from 0.25rem */
    margin: -0.25rem;
    transition: color 0.2s ease;
    flex-shrink: 0;
    min-width: 2rem; /* Ensure consistent touch target */
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.a2hs-banner-close:hover {
    color: white;
}

@keyframes slideUpFadeIn {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Hide banner on desktop */
@media (min-width: 769px) {
    .a2hs-banner {
        display: none !important;
    }
}

/* Mobile More Dropdown Styles */
.mobile-more-dropdown {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.mobile-more-dropdown.active {
    display: flex;
    opacity: 1;
}

.mobile-more-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.mobile-more-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-radius: 16px 16px 0 0;
    padding-bottom: calc(3.5rem + var(--sab));
    transform: translateY(100%);
    transition: transform 0.3s ease-in-out;
    max-height: 60vh;
    overflow: hidden;
}

.dark .mobile-more-content {
    background: #1f2937;
    border-top: 1px solid #374151;
}

.mobile-more-dropdown.active .mobile-more-content {
    transform: translateY(0);
}

.mobile-more-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.dark .mobile-more-header {
    border-bottom-color: #374151;
}

.mobile-more-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
}

.dark .mobile-more-title {
    color: #f9fafb;
}

.mobile-more-close {
    padding: 0.5rem;
    border-radius: 0.5rem;
    background: transparent;
    border: none;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mobile-more-close:hover {
    background: #f3f4f6;
    color: #374151;
}

.dark .mobile-more-close:hover {
    background: #374151;
    color: #d1d5db;
}

.mobile-more-options {
    padding: 0.5rem;
}

.mobile-more-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    text-decoration: none;
    color: #374151;
    border-radius: 0.75rem;
    transition: all 0.2s ease;
    margin: 0.25rem 0;
}

.dark .mobile-more-option {
    color: #d1d5db;
}

.mobile-more-option:hover {
    background: #f3f4f6;
    color: #111827;
}

.dark .mobile-more-option:hover {
    background: #374151;
    color: #f9fafb;
}

.mobile-more-icon {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
}

.mobile-more-option span {
    font-size: 1rem;
    font-weight: 500;
}

/* Pre-generated TailwindCSS (Corrected Version) */
:root { 
    --tw-ring-color: rgb(59 130 246 / 0.5);
    --tw-translate-x: 0;
    --tw-translate-y: 0;
    --tw-rotate: 0;
    --tw-skew-x: 0;
    --tw-skew-y: 0;
    --tw-scale-x: 1;
    --tw-scale-y: 1;
}
*, ::before, ::after { 
    box-sizing: border-box; 
    border-width: 0; 
    border-style: solid; 
    border-color: #e5e7eb;
}
::before, ::after { --tw-content: ''; } /* FIX: Added for pseudo-elements like the toggle */
html { line-height: 1.5; -webkit-text-size-adjust: 100%; -moz-tab-size: 4; tab-size: 4; font-feature-settings: normal; font-variation-settings: normal; }
body { margin: 0; line-height: inherit; }
h1, h2, p { margin: 0; }
/* svg { display: block; vertical-align: middle; } */
textarea { font-family: inherit; font-size: 100%; font-weight: inherit; line-height: inherit; color: inherit; margin: 0; padding: 0; }
button { font-family: inherit; font-size: 100%; font-weight: inherit; line-height: inherit; color: inherit; margin: 0; padding: 0; text-transform: none; background-color: transparent; background-image: none; cursor: pointer; }
.dark { color-scheme: dark; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border-width: 0; }
.absolute { position: absolute; } .relative { position: relative; }
.bottom-2 { bottom: 0.1rem; } .bottom-3 { bottom: 0.05rem; } .bottom-4 { bottom: 1rem; } .left-0 { left: 0; } .left-2 { left: 0.5rem; } .left-4 { left: 1rem; }
.right-2 { right: 0.5rem; } .right-4 { right: 1rem; } .top-4 { top: 1rem; }
.mx-auto { margin-left: auto; margin-right: auto; } .ml-2 { margin-left: 0.5rem; }
.mt-12 { margin-top: 3rem; } .mb-4 { margin-bottom: 1rem; } .mt-4 { margin-top: 1rem; } .mt-8 { margin-top: 2rem; }
.mt-0\.5 { margin-top: 0.125rem; }
.flex { display: flex; } .inline-flex { display: inline-flex; } .hidden { display: none; }
.h-6 { height: 1.5rem; } .h-10 { height: 2.5rem; } .h-14 { height: 3.5rem; } .h-64 { height: 16rem; } .h-80 { height: 20rem; } .h-full { height: 100%; }
.w-6 { width: 1.5rem; } .w-10 { width: 2.5rem; } .w-11 { width: 2.75rem; } .w-14 { width: 3.5rem; } .w-full { width: 100%; }
.max-w-4xl { max-width: 56rem; } /* FIX: Added max-width */
.max-w-5xl { max-width: 64rem; } /* FIX: Added max-width */
.min-h-screen { min-height: 100vh; }
.flex-1 { flex: 1 1 0%; }
.flex-col { flex-direction: column; } .flex-row { flex-direction: row; }
.items-center { align-items: center; } .justify-center { justify-content: center; } .justify-between { justify-content: space-between; }
.space-x-1 > :not([hidden]) ~ :not([hidden]) { margin-right: 0; margin-left: 0.25rem; }
.space-x-2 > :not([hidden]) ~ :not([hidden]) { margin-right: 0; margin-left: 0.5rem; }
.space-x-3 > :not([hidden]) ~ :not([hidden]) { margin-right: 0; margin-left: 0.75rem; }
.overflow-hidden { overflow: hidden; }
.rounded-full { border-radius: 9999px; } .rounded-lg { border-radius: 0.5rem; } .rounded-xl { border-radius: 0.75rem; } .rounded-r-lg { border-top-right-radius: 0.5rem; border-bottom-right-radius: 0.5rem; }
.border { border-width: 1px; } .border-t { border-top-width: 1px; } .border-b { border-bottom-width: 1px; }
.border-l { border-left-width: 1px; } .border-l-4 { border-left-width: 4px; }
.border-gray-200 { border-color: #e5e7eb; } .dark .dark\:border-gray-700 { border-color: #374151; }
.border-gray-300 { border-color: #d1d5db; } .dark .dark\:border-gray-600 { border-color: #4b5563; }
.border-yellow-500 { border-color: #eab308; }
.bg-gray-100 { background-color: #f3f4f6; } .dark .dark\:bg-gray-900 { background-color: #111827; }
.bg-white { background-color: #fff; } .dark .dark\:bg-gray-800 { background-color: #1f2937; }
.bg-gray-50 { background-color: #f9fafb; }
.bg-gray-300 { background-color: #d1d5db; } .dark .dark\:bg-gray-700 { background-color: #374151; }
.bg-yellow-100 { background-color: #fef9c3; } .dark .dark\:bg-yellow-900\/30 { background-color: rgb(113 63 18 / 0.3); }
.bg-blue-600 { background-color: #2563eb; } .bg-transparent { background-color: transparent; }
.p-2 { padding: 0.5rem; } .p-3 { padding: 0.75rem; } .p-4 { padding: 1rem; } .px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; } .px-12 { padding-left: 3rem; padding-right: 3rem; }
.py-1\.125 { padding-top: 0.28125rem; padding-bottom: 0.28125rem; }
.py-1\.25 { padding-top: 0.3125rem; padding-bottom: 0.3125rem; }
.py-1\.5 { padding-top: 0.375rem; padding-bottom: 0.375rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; } .py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.pl-2 { padding-left: 0.5rem; }
.text-center { text-align: center; } .text-left { text-align: left; }
.text-xs { font-size: 0.75rem; line-height: 1rem; } .text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-base { font-size: 1rem; line-height: 1.5rem; } .text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.font-semibold { font-weight: 600; } .font-bold { font-weight: 700; } .font-medium { font-weight: 500; }
.leading-tight { line-height: 1.25; }
.text-gray-800 { color: #1f2937; } .dark .dark\:text-gray-200 { color: #e5e7eb; }
.text-gray-900 { color: #111827; } .dark .dark\:text-white { color: #fff; }
.text-gray-500 { color: #6b7280; } .dark .dark\:text-gray-400 { color: #9ca3af; }
.text-gray-600 { color: #4b5563; } .dark .dark\:text-gray-500 { color: #6b7280; }
.text-blue-600 { color: #2563eb; } .dark .dark\:text-blue-400 { color: #60a5fa; }
.text-green-500 { color: #22c55e; } .text-yellow-800 { color: #854d0e; }
.dark .dark\:text-yellow-200 { color: #fef08a; } .text-white { color: #fff; }
.opacity-0 { opacity: 0; }
.shadow-lg { box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1); }
.shadow-md { box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1); }
.object-contain { object-fit: contain; } .resize-none { resize: none; }
.outline-none { outline: 2px solid transparent; outline-offset: 2px; }
.hover\:bg-gray-200:hover { background-color: #e5e7eb; } .dark .dark\:hover\:bg-gray-700:hover { background-color: #374151; }
.hover\:bg-green-100:hover { background-color: #dcfce7; } .dark .dark\:hover\:bg-green-800:hover { background-color: #166534; }
.hover\:bg-red-100:hover { background-color: #fee2e2; } .dark .dark\:hover\:bg-red-800:hover { background-color: #991b1b; }
.hover\:bg-blue-700:hover { background-color: #1d4ed8; } .hover\:underline:hover { text-decoration-line: underline; }
.hover\:bg-gray-100:hover { background-color: #f3f4f6; } .dark .dark\:hover\:bg-gray-800:hover { background-color: #1f2937; }
.hover\:text-blue-600:hover { color: #2563eb; } .dark .dark\:hover\:text-blue-400:hover { color: #60a5fa; }
.focus\:outline-none:focus { outline: 2px solid transparent; outline-offset: 2px; }
.focus\:ring-2:focus { --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color); --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color); box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000); }
.focus\:ring-blue-500:focus { --tw-ring-color: #3b82f6; }
.focus\:ring-opacity-75:focus { --tw-ring-opacity: 0.75; }
.transition-colors { transition-property: color, background-color, border-color, text-decoration-color, fill, stroke; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.disabled\:cursor-not-allowed:disabled { cursor: not-allowed; }
.disabled\:bg-blue-400:disabled { background-color: #60a5fa; }
.peer:focus ~ .peer-focus\:outline-none { outline: 2px solid transparent; outline-offset: 2px; }
.peer:checked ~ .peer-checked\:after\:translate-x-full::after { --tw-translate-x: 100%; transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); }
.peer:checked ~ .peer-checked\:after\:border-white::after { border-color: #fff; }
.peer:checked ~ .peer-checked\:bg-blue-600 { background-color: #2563eb; }
.after\:absolute::after { content: var(--tw-content); position: absolute; }
.after\:left-\[2px\]::after { left: 2px; } .after\:top-\[2px\]::after { top: 2px; } .after\:h-5::after { height: 1.25rem; }
.after\:w-5::after { width: 1.25rem; } .after\:rounded-full::after { border-radius: 9999px; }
.after\:border::after { border-width: 1px; } .after\:border-gray-300::after { border-color: #d1d5db; }
.after\:bg-white::after { background-color: #fff; } .after\:transition-all::after { transition-property: all; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 200ms; }
.transition-opacity { transition-property: opacity; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.animate-spin { animation: spin 1s linear infinite; } @keyframes spin { to { transform: rotate(360deg); } }
@media (min-width: 768px) {
    .md\:hidden { display: none; }
    .md\:flex { display: flex; }
    .md\:h-80 { height: 20rem; }
    .md\:w-1\/2 { width: 50%; } .md\:w-auto { width: auto; }
    .md\:flex-row { flex-direction: row; } /* FIX: Added flex-direction */
    .md\:border-r { border-right-width: 1px; } .md\:border-r-0 { border-right-width: 0px; }
    .md\:border-t-0 { border-top-width: 0px; }
    .md\:p-4 { padding: 1rem; }
    .md\:text-lg { font-size: 1.125rem; line-height: 1.75rem; }
}

/* Tips Modal Styles */
.tips-modal { position: fixed; inset: 0; z-index: 3000; display: none; opacity: 0; transition: opacity 0.2s ease-in-out; }
.tips-modal.active { display: flex; opacity: 1; }
.tips-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.5); backdrop-filter: blur(4px); }
.tips-card { position: relative; margin: auto; width: 92%; max-width: 28rem; background: #ffffff; color: #111827; border-radius: 0.75rem; border: 1px solid #e5e7eb; box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04); }
.dark .tips-card { background: #1f2937; color: #f3f4f6; border-color: #374151; }
.tips-card-header { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1rem 0.5rem 1.25rem; border-bottom: 1px solid #e5e7eb; }
.dark .tips-card-header { border-bottom-color: #374151; }
.tips-title { font-size: 1.125rem; font-weight: 600; }
.tips-close { padding: 0.375rem; border-radius: 0.5rem; background: transparent; border: none; color: #6b7280; cursor: pointer; }
.tips-close:hover { background: #f3f4f6; color: #374151; }
.dark .tips-close:hover { background: #374151; color: #d1d5db; }
.tips-content { padding: 0.75rem 1.25rem 1.25rem 1.25rem; }
.tips-list { margin: 0.5rem 0 0 0; padding-left: 1.25rem; }
.tips-list li { margin: 0.375rem 0; line-height: 1.4; }
.tips-note { 
    font-size: 0.875rem; 
    color: #6b7280; 
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.dark .tips-note { color: #9ca3af; }
.tips-footnote { 
    font-size: 0.8rem; 
    color: #6b7280; 
    margin-top: 0.75rem; 
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.dark .tips-footnote { color: #9ca3af; }
/* Example highlight styles (light, readable on both themes) */
.eg { padding: 0 0.25rem; border-radius: 0.375rem; }
.bad-example { color: #b91c1c; background-color: #fee2e2; border: 1px solid #fecaca; }
.dark .bad-example { color: #fecaca; background-color: rgba(185, 28, 28, 0.18); border-color: rgba(248, 113, 113, 0.35); }
.good-example { color: #166534; background-color: #dcfce7; border: 1px solid #bbf7d0; }
.dark .good-example { color: #bbf7d0; background-color: rgba(22, 101, 52, 0.18); border-color: rgba(187, 247, 208, 0.35); }

/* Mobile: keep Bad/Good lines single-line and slightly smaller */
@media (max-width: 768px) {
    .tips-content .tips-list li div {
        font-size: 0.75rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .tips-content .tips-list li div .eg {
        font-size: 0.75rem;
    }
    .tips-content .eg { padding: 0 0.125rem; }
}

/* Add to Home Screen Modal Styles */
.a2hs-modal { position: fixed; inset: 0; z-index: 3000; display: none; opacity: 0; transition: opacity 0.2s ease-in-out; }
.a2hs-modal.active { display: flex; opacity: 1; }
.a2hs-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.5); backdrop-filter: blur(4px); }
.a2hs-card { position: relative; margin: auto; width: 92%; max-width: 28rem; background: #ffffff; color: #111827; border-radius: 0.75rem; border: 1px solid #e5e7eb; box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04); }
.dark .a2hs-card { background: #1f2937; color: #f3f4f6; border-color: #374151; }
.a2hs-card-header { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1rem 0.5rem 1.25rem; border-bottom: 1px solid #e5e7eb; }
.dark .a2hs-card-header { border-bottom-color: #374151; }
.a2hs-title { font-size: 1.125rem; font-weight: 600; }
.a2hs-close { padding: 0.375rem; border-radius: 0.5rem; background: transparent; border: none; color: #6b7280; cursor: pointer; }
.a2hs-close:hover { background: #f3f4f6; color: #374151; }
.dark .a2hs-close:hover { background: #374151; color: #d1d5db; }
.a2hs-content { padding: 0.75rem 1.25rem 1.25rem 1.25rem; }
.a2hs-steps { margin: 1rem 0 0 0; padding-left: 1.25rem; }
.a2hs-steps li { margin: 0.5rem 0; line-height: 1.5; }
.a2hs-note { font-size: 0.875rem; color: #6b7280; margin-top: 1rem; }
.dark .a2hs-note { color: #9ca3af; }
.a2hs-platform { font-weight: 600; color: #2563eb; }
.dark .a2hs-platform { color: #60a5fa; }
.a2hs-note-box { background-color: #f3f4f6 !important; border-color: #d1d5db !important; color: #374151 !important; }
.dark .a2hs-note-box { background-color: #374151 !important; border-color: #4b5563 !important; color: #d1d5db !important; }
.a2hs-video-section { border-color: #e5e7eb; color: #6b7280; }
.dark .a2hs-video-section { border-color: #4b5563; color: #9ca3af; }
