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

        html, body {
            width: 100%;
            height: 100%;
            overflow: hidden;
        }

        body {
            font-family: 'Inter', sans-serif;
            background: #f5f3ef;
            display: flex;
            align-items: stretch;
            justify-content: stretch;
            padding: 0;
            margin: 0;
        }

        .container {
            background: white;
            border-radius: 0;
            box-shadow: none;
            width: 100%;
            height: 100vh;
            display: flex;
            flex-direction: column;
            overflow: hidden;
        }
        
        @media (min-width: 768px) {
            .container {
                border-radius: 0;
                box-shadow: none;
            }
        }

        .header {
            background: #1a5563;
            color: #f8f6f2;
            padding: 20px 30px;
            position: relative;
            box-shadow: 0 2px 8px rgba(26, 85, 99, 0.15);
            display: flex;
            align-items: center;
            gap: 18px;
            z-index: 100;
        }

        .header::before {
            content: '';
            position: absolute;
            top: -50%;
            right: 10%;
            width: 50%;
            height: 200%;
            background: radial-gradient(ellipse, rgba(212, 175, 100, 0.15), transparent 60%);
            pointer-events: none;
        }

        .header::after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 0;
            right: 0;
            height: 2px;
            background: linear-gradient(90deg, 
                transparent, 
                rgba(212, 175, 100, 0.4) 30%, 
                rgba(212, 175, 100, 0.4) 70%, 
                transparent);
        }

        /* Burger button */
        .burger-button {
            background: rgba(255, 255, 255, 0.1);
            border: 1px solid rgba(255, 255, 255, 0.2);
            color: white;
            padding: 12px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 8px;
            transition: all 0.3s ease;
            position: relative;
            z-index: 1;
            flex-shrink: 0;
        }

        .burger-button:hover {
            background: rgba(255, 255, 255, 0.2);
            border-color: rgba(212, 175, 100, 0.5);
            transform: translateY(-1px);
        }

        .burger-button.active .burger-icon span:nth-child(1) {
            transform: rotate(45deg) translate(5px, 5px);
        }

        .burger-button.active .burger-icon span:nth-child(2) {
            opacity: 0;
        }

        .burger-button.active .burger-icon span:nth-child(3) {
            transform: rotate(-45deg) translate(6px, -6px);
        }

        .burger-icon {
            display: flex;
            flex-direction: column;
            gap: 3px;
            width: 20px;
        }

        .burger-icon span {
            display: block;
            height: 2px;
            background: white;
            border-radius: 2px;
            transition: all 0.3s ease;
        }

        /* Header title section */
        .header-title-container {
            flex: 1;
            position: relative;
            z-index: 1;
        }

        .chat-mode-header-context {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 52px;
            height: 52px;
            border-radius: 50%;
            padding: 0;
            border: 1px solid rgba(248, 246, 242, 0.25);
            background: rgba(255, 255, 255, 0.12);
            color: #f8f6f2;
            flex-shrink: 0;
            z-index: 1;
        }

        .chat-mode-header-context.is-private {
            border-color: rgba(212, 175, 100, 0.55);
            background: rgba(212, 175, 100, 0.18);
        }

        .chat-mode-header-avatar {
            width: 44px;
            height: 44px;
            border-radius: 50%;
            object-fit: cover;
            flex-shrink: 0;
            border: 1px solid rgba(255, 255, 255, 0.25);
            background: rgba(255, 255, 255, 0.95);
        }

        .chat-mode-header-label {
            display: none;
        }

        .header h1 {
            font-family: 'Crimson Text', serif;
            font-size: 1.8em;
            font-weight: 600;
            line-height: 1.2;
            margin-bottom: 3px;
        }

        .header p {
            font-size: 0.85em;
            opacity: 0.85;
            font-weight: 300;
        }
        
        .header p a {
            color: #f8f6f2;
            text-decoration: underline;
            cursor: pointer;
            transition: opacity 0.2s;
            display: inline;
        }
        
        .header p a:hover {
            opacity: 0.8;
        }

        /* Episode Selector */
        .episode-selector {
            position: relative;
            display: inline-block;
        }

        .episode-display {
            font-size: 14px;
            font-weight: 300;
            opacity: 0.85;
            cursor: pointer;
            padding: 4px 8px;
            border-radius: 4px;
            transition: background-color 0.2s;
            display: inline-flex;
            align-items: center;
            gap: 6px;
        }

        .episode-selector.has-dropdown .episode-display::after {
            content: '▼';
            font-size: 10px;
            opacity: 0.7;
            transition: transform 0.2s;
        }

        .episode-selector.has-dropdown .episode-display:hover {
            background-color: rgba(255, 255, 255, 0.1);
        }

        .episode-selector.dropdown-open .episode-display::after {
            transform: rotate(180deg);
        }

        .episode-dropdown {
            position: absolute;
            top: 100%;
            left: 0;
            margin-top: 8px;
            background: white;
            border-radius: 8px;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
            min-width: 200px;
            z-index: 1000;
            overflow: hidden;
        }

        .episode-dropdown-item {
            padding: 12px 16px;
            cursor: pointer;
            transition: background-color 0.2s;
            border-bottom: 1px solid #f0f0f0;
            display: flex;
            align-items: center;
            justify-content: space-between;
        }

        .episode-dropdown-item:last-child {
            border-bottom: none;
        }

        .episode-dropdown-item:hover {
            background-color: #f5f3ef;
        }

        .episode-dropdown-item.current {
            background-color: #e8f4f7;
            font-weight: 500;
        }

        .episode-dropdown-item.locked {
            opacity: 0.5;
            cursor: not-allowed;
        }

        .episode-dropdown-item.completed::after {
            content: '✓';
            color: #0097b2;
            margin-left: 8px;
        }

        .episode-name {
            font-size: 14px;
            color: #333;
        }

        .episode-status {
            font-size: 12px;
            color: #666;
            margin-left: 8px;
        }
        
        /* Horizontal dropdown menu */
        .horizontal-menu {
            background: white;
            border-bottom: none;
            box-shadow: none;
            display: flex;
            justify-content: center;
            gap: 0;
            padding: 0;
            max-height: 0;
            overflow: hidden;
            opacity: 0;
            transition: all 0.3s ease;
            position: relative;
        }

        .horizontal-menu::before {
            content: '';
            position: absolute;
            top: 0;
            left: 30px;
            right: 30px;
            height: 2px;
            background: linear-gradient(90deg, 
                transparent, 
                rgba(212, 175, 100, 0.3) 30%, 
                rgba(212, 175, 100, 0.3) 70%, 
                transparent);
        }

        .horizontal-menu.active {
            border-bottom: 1px solid rgba(26, 85, 99, 0.1);
            box-shadow: 0 4px 12px rgba(26, 85, 99, 0.08);
            max-height: 80px;
            opacity: 1;
            padding: 18px 30px;
        }

        .horizontal-menu-item {
            flex: 1;
            max-width: 280px;
            padding: 16px 24px;
            cursor: pointer;
            display: flex;
            flex-direction: column;
            gap: 4px;
            transition: all 0.2s ease;
            border-radius: 8px;
            position: relative;
            background: transparent;
        }

        .horizontal-menu-item::after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 20%;
            right: 20%;
            height: 3px;
            background: linear-gradient(90deg, #1e6a7a, #d4af64);
            opacity: 0;
            transition: all 0.3s ease;
            border-radius: 3px 3px 0 0;
        }

        .horizontal-menu-item:hover {
            background: rgba(30, 106, 122, 0.04);
        }

        .horizontal-menu-item:hover::after {
            opacity: 1;
            left: 10%;
            right: 10%;
        }

        .horizontal-menu-item-name {
            font-weight: 600;
            font-size: 15px;
            color: #1a5563;
            letter-spacing: 0.2px;
            text-align: center;
        }

        .horizontal-menu-item-description {
            font-size: 13px;
            color: #5a6a72;
            text-align: center;
            line-height: 1.3;
        }

        /* Location switcher (episodes 2+) */
        .location-switcher {
            display: flex;
            height: 54px;
            flex-shrink: 0;
            overflow: hidden;
            border-bottom: 1px solid rgba(26, 85, 99, 0.08);
            background: #111;
        }

        .location-switcher-tab {
            flex: 1;
            position: relative;
            cursor: pointer;
            overflow: hidden;
            transition: flex 0.5s cubic-bezier(0.4, 0, 0.2, 1);
            outline: none;
        }

        .location-switcher-tab.active {
            flex: 2;
            cursor: default;
        }

        .location-switcher-bg {
            position: absolute;
            inset: 0;
            background-size: cover;
            background-position: center;
            transition: filter 0.4s ease, opacity 0.4s ease;
        }

        .location-switcher-bg.fallback {
            background:
                radial-gradient(circle at 80% 35%, rgba(212, 175, 100, 0.35), transparent 45%),
                linear-gradient(110deg, #1b4f5d 0%, #143a45 52%, #0f2c34 100%);
        }

        .location-switcher-tab:not(.active) .location-switcher-bg {
            filter: grayscale(0.45) brightness(0.46);
        }

        .location-switcher-tab.active .location-switcher-bg {
            filter: brightness(0.72);
        }

        .location-switcher-tab:hover:not(.active) .location-switcher-bg {
            filter: grayscale(0.25) brightness(0.54);
        }

        .location-switcher-label {
            position: relative;
            z-index: 2;
            height: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-family: 'Crimson Text', serif;
            font-weight: 600;
            font-size: 0.95em;
            letter-spacing: 1.5px;
            text-transform: uppercase;
            color: white;
            text-shadow: 0 1px 6px rgba(0, 0, 0, 0.7), 0 0 20px rgba(0, 0, 0, 0.3);
            transition: all 0.3s;
        }

        .location-switcher-tab.active .location-switcher-label {
            font-weight: 700;
            letter-spacing: 2px;
        }

        .location-switcher-tab:not(.active) .location-switcher-label {
            opacity: 0.75;
        }

        .location-switcher-tab.active::after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 12%;
            right: 12%;
            height: 2.5px;
            background: #d4af64;
            border-radius: 2px 2px 0 0;
            z-index: 3;
        }

        .location-switcher-divider {
            width: 1px;
            background: rgba(255, 255, 255, 0.2);
            z-index: 3;
            flex-shrink: 0;
        }

        .location-switcher-tab:focus-visible {
            box-shadow: inset 0 0 0 2px rgba(212, 175, 100, 0.75);
        }

        /* Navigation buttons below menu */
        .navigation-bar {
            background: white;
            padding: 15px 30px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            border-bottom: 1px solid rgba(26, 85, 99, 0.1);
            box-shadow: 0 2px 8px rgba(26, 85, 99, 0.05);
        }

        .nav-button {
            padding: 10px 20px;
            background: white;
            border: 1.5px solid rgba(26, 85, 99, 0.2);
            color: #1a5563;
            border-radius: 8px;
            cursor: pointer;
            font-size: 0.9em;
            font-weight: 500;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .nav-button:hover {
            background: linear-gradient(135deg, #1e6a7a, #1a5563);
            color: white;
            border-color: transparent;
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(26, 85, 99, 0.2);
        }

        .nav-button.right {
            margin-left: auto;
        }

        .login-screen {
            padding: 48px 24px;
            text-align: center;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 20px;
        }

        .login-screen h2 {
            margin-bottom: 0;
            color: #333;
            font-size: 1.75rem;
        }

        .login-screen p {
            color: #666;
            margin: 0;
            max-width: 480px;
        }

        input[type="text"] {
            width: 100%;
            max-width: 420px;
            padding: 15px 20px;
            font-size: 16px;
            border: 2px solid #e0e0e0;
            border-radius: 12px;
            transition: border-color 0.3s;
        }

        input[type="text"]:focus {
            outline: none;
            border-color: #0097b2;
        }

        button {
            background: #0097b2;
            color: white;
            border: none;
            padding: 15px 40px;
            font-size: 16px;
            font-weight: 600;
            border-radius: 10px;
            cursor: pointer;
            transition: transform 0.2s, box-shadow 0.2s;
        }

        button:hover {
            transform: translateY(-2px);
            box-shadow: 0 10px 20px rgba(0, 151, 178, 0.4);
        }

        button:active {
            transform: translateY(0);
        }

        button:disabled {
            opacity: 0.6;
            cursor: not-allowed;
        }

        .login-button-row {
            display: flex;
            justify-content: center;
        }

        .login-screen .error {
            min-height: 22px;
            color: #c62828;
            font-weight: 600;
        }

        .game-screen {
            display: none;
            flex-direction: column;
            flex: 1;
            min-height: 0;
            position: relative;
            overflow: hidden;
        }

        .game-screen.active {
            display: flex;
        }

        .chat-area {
            flex: 1;
            overflow-y: auto;
            overflow-x: hidden;
            padding: 30px;
            background: #f5f3ef;
            min-height: 0;
            -webkit-overflow-scrolling: touch;
            overscroll-behavior: contain;
        }

        .message {
            margin-bottom: 15px;
            display: flex;
            align-items: flex-start;
            gap: 8px;
        }

        .message.user {
            flex-direction: row-reverse;
        }

        .message-avatar {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            object-fit: cover;
            flex-shrink: 0;
            margin-top: 2px;
        }

        .message-content {
            max-width: 70%;
            padding: 12px 16px;
            border-radius: 18px;
            word-wrap: break-word;
            display: flex;
            flex-direction: column;
            position: relative;
        }

        .message-content .message-content-wrapper {
            width: 100%;
        }

        .message.user .message-content {
            background: #0097b2;
            color: white;
            border-bottom-right-radius: 4px;
        }

        .message.bot .message-content,
        .message.system .message-content {
            background: white;
            color: #333;
            border: 1px solid #e0e0e0;
            border-bottom-left-radius: 4px;
        }
        
        .message.character .message-content {
            background: white;
            color: #333;
            border: 2px solid #0097b2;
            border-bottom-left-radius: 4px;
        }

        /* Narrator lines: plain italic text without chat bubble or sender label */
        .message.narrator-message {
            justify-content: center;
            margin: 20px 0;
        }

        .message.narrator-message .message-content {
            max-width: min(72ch, 100%);
            background: transparent;
            border: none;
            border-radius: 0;
            padding: 0;
            box-shadow: none;
        }

        .message.narrator-message .message-text {
            font-style: italic;
            color: #4c5560;
            line-height: 1.7;
            text-align: center;
        }

        .message.tutor-message {
            flex-direction: column;
            align-items: stretch;
            gap: 14px;
        }

        .message.tutor-message .message-content {
            background: linear-gradient(180deg, #fff9e6 0%, #fff2cc 100%);
            border: 1px solid rgba(214, 179, 76, 0.6);
            box-shadow: 0 12px 28px rgba(214, 179, 76, 0.18);
            border-radius: 18px;
            padding: 22px 26px;
            max-width: 520px;
            width: 100%;
            color: #5c4a12;
        }

        .message.tutor-message .message-content-wrapper {
            display: flex;
            flex-direction: column;
            gap: 12px;
        }

        .message.tutor-message .message-sender {
            font-size: 0.75rem;
            letter-spacing: 0.08em;
            text-transform: uppercase;
            color: #a07400;
            margin-bottom: 0;
            opacity: 0.85;
        }

        .message.tutor-message .message-text {
            font-size: 0.95rem;
            line-height: 1.6;
            color: #5c4a12;
        }

        .message.tutor-message .message-text strong {
            color: #8a6500;
        }

        .message.tutor-message .button-row {
            margin-top: 12px;
        }

        @media (max-width: 768px) {
            .message.tutor-message .message-content {
                max-width: none;
                padding: 18px 20px;
            }

            .message.tutor-message .message-text {
                font-size: 0.9rem;
            }
        }

        .message-sender {
            font-weight: 600;
            font-size: 12px;
            margin-bottom: 5px;
            opacity: 0.8;
        }

        /* Book style for intro text - modern book appearance */
        .message.typewriter-intro .message-content {
            background: #FEFDFB;
            border-radius: 2px;
            padding: 30px 40px;
            box-shadow: 
                0 2px 8px rgba(0,0,0,0.08),
                0 8px 24px rgba(0,0,0,0.06);
            position: relative;
            border: none;
            border-left: 3px solid #D4C5B0;
        }
        
        .message.typewriter-intro .message-sender {
            font-family: 'Lato', sans-serif;
            font-size: 0.85em;
            letter-spacing: 8px; /* Increased spacing for asterisks (chapter marker) */
            text-transform: uppercase;
            color: #8B7355;
            margin-bottom: 20px;
            font-weight: 600;
            opacity: 1;
            text-align: center; /* Center asterisks like chapter start in a book */
        }
        
        .message.typewriter-intro .message-text {
            font-family: 'Crimson Text', serif;
            font-size: 1.15em;
            line-height: 1.9;
            color: #2C2C2C;
        }

        .message.typewriter-intro .message-text p {
            margin-bottom: 0.5em;
            text-align: justify;
            text-indent: 0;
        }

        .message.typewriter-intro .message-text p:first-of-type::first-letter {
            font-size: 3.5em;
            line-height: 0.9;
            float: left;
            margin: 0.05em 0.1em 0 0;
            color: #1e7a8c;
            font-weight: 600;
        }

        /* Responsive styles for book-style message */
        @media (max-width: 768px) {
            .message.typewriter-intro .message-content {
                padding: 25px 30px;
                max-width: none; /* Remove max-width restriction */
                width: 100%; /* Full width of parent */
                margin-right: 20px; /* Small right margin matching left padding */
            }

            .message.typewriter-intro .message-text {
                font-size: 1em;
                line-height: 1.8;
            }

            .message.typewriter-intro .message-text p:first-of-type::first-letter {
                font-size: 2.5em;
            }
        }

        /* Loading spinner */
        .loading-spinner {
            display: inline-block;
            width: 20px;
            height: 20px;
            border: 3px solid #f3f3f3;
            border-top: 3px solid #0097b2;
            border-radius: 50%;
            animation: spin 1s linear infinite;
            margin-right: 12px;
            vertical-align: middle;
        }

        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }

        .loading-spinner-container {
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 20px;
            color: #666;
            font-size: 14px;
            min-height: 60px;
        }

        .loading-spinner-container span {
            color: #856404;
        }
        
        /* Loading spinner inside typewriter-intro message */
        .message.typewriter-intro .loading-spinner-container {
            color: #8B7355;
        }
        
        .message.typewriter-intro .loading-spinner-container span {
            color: #8B7355;
        }
        
        .message.typewriter-intro .loading-spinner {
            border: 3px solid #FEFDFB;
            border-top: 3px solid #8B7355;
        }

        .private-mode-controls {
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 0;
            background: transparent;
            border: none;
            position: relative;
            z-index: 11;
        }

        .private-mode-controls-header {
            margin-left: 8px;
            z-index: 1;
        }

        .main-chat-area.chat-mode-public .chat-area {
            border-top: 2px solid rgba(0, 151, 178, 0.2);
            background:
                radial-gradient(circle at top right, rgba(0, 151, 178, 0.06), transparent 38%),
                #f5f3ef;
        }

        .main-chat-area.chat-mode-private .chat-area {
            border-top: 2px solid rgba(212, 175, 100, 0.45);
            background:
                radial-gradient(circle at top right, rgba(212, 175, 100, 0.13), transparent 38%),
                #f7f3e8;
        }

        .main-chat-area.chat-mode-public .input-area {
            box-shadow: inset 0 2px 0 rgba(0, 151, 178, 0.2);
            background: #ffffff;
        }

        .main-chat-area.chat-mode-private .input-area {
            box-shadow: inset 0 2px 0 rgba(212, 175, 100, 0.35);
            background: #fff9ee;
        }

        #charactersList .drawer-item .status::before {
            content: '';
            display: inline-block;
            width: 6px;
            height: 6px;
            margin-right: 6px;
            border-radius: 50%;
            vertical-align: middle;
            transform: translateY(-1px);
        }

        #charactersList .drawer-item.chat-target-public .status::before {
            background: #0097b2;
        }

        #charactersList .drawer-item.chat-target-private .status::before {
            background: #d4af64;
        }

        #charactersList .drawer-item.active .status::before {
            background: rgba(255, 255, 255, 0.9);
        }

        .back-to-common-dialogue-btn {
            background: #f8f6f2;
            color: #0097b2;
            border: 1px solid rgba(0, 151, 178, 0.35);
            border-radius: 50%;
            width: 36px;
            height: 36px;
            padding: 0;
            font-size: 34px;
            font-weight: 600;
            line-height: 0.85;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
            transform: none;
            transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
        }

        .back-to-common-dialogue-btn:hover {
            background: #ffffff;
            border-color: rgba(0, 151, 178, 0.6);
            transform: translateY(-1px);
        }

        .back-to-common-dialogue-btn.is-private {
            background: #ffffff;
            border-color: rgba(0, 151, 178, 0.6);
            color: #0097b2;
            box-shadow: 0 2px 10px rgba(0, 151, 178, 0.24);
        }

        .input-area {
            padding: 20px;
            display: flex;
            gap: 10px;
            flex-shrink: 0;
            min-height: 60px;
            background: white;
            position: relative;
            z-index: 10;
        }
        
        /* Mobile fixes for input area */
        @media (max-width: 767px) {
            .private-mode-controls {
                position: relative;
                z-index: 11;
            }

            .chat-mode-header-context {
                width: 42px;
                height: 42px;
            }

            .chat-mode-header-avatar {
                width: 34px;
                height: 34px;
            }

            .back-to-common-dialogue-btn {
                width: 32px;
                height: 32px;
                font-size: 26px;
            }

            .input-area {
                padding: 12px 15px;
                padding-bottom: calc(12px + env(safe-area-inset-bottom));
                /* Ensure input area stays visible above browser bottom bar */
                position: sticky;
                bottom: 0;
                z-index: 100;
                background: white;
            }
            
            /* Add extra padding to chat area to prevent content from being hidden behind input */
            .chat-area {
                padding-bottom: calc(150px + env(safe-area-inset-bottom));
            }

            /* Ensure button rows are not hidden */
            .button-row {
                margin-bottom: 10px;
            }
        }

        /* Mobile styles for header and menu */
        @media (max-width: 768px) {
            .header {
                padding: 15px 20px;
                gap: 12px;
            }

            .header-title-container h1 {
                font-size: 1.4em;
            }

            .header-title-container p {
                font-size: 0.8em;
            }

            .episode-display {
                font-size: 0.8em;
            }

            /* Mobile: menu becomes 2x2 grid */
            .horizontal-menu {
                flex-wrap: wrap;
                justify-content: stretch;
                padding: 0;
            }

            .horizontal-menu.active {
                max-height: 200px;
                padding: 12px 15px;
            }

            .horizontal-menu-item {
                flex: 0 0 calc(50% - 8px);
                max-width: none;
                padding: 14px 16px;
                margin: 4px;
            }

            .horizontal-menu-item-name {
                font-size: 14px;
            }

            .horizontal-menu-item-description {
                font-size: 12px;
            }

            .navigation-bar {
                padding: 8px 15px;
                min-height: auto;
            }

            .location-switcher {
                height: 46px;
            }

            .location-switcher-label {
                font-size: 0.85em;
                letter-spacing: 1.2px;
            }

            .nav-button {
                padding: 6px 12px;
                font-size: 0.85em;
                min-height: auto;
            }

            .chat-area {
                padding: 20px;
                /* Keep safe-area padding from mobile fixes */
                padding-bottom: calc(150px + env(safe-area-inset-bottom));
            }
        }

        /* Very small mobile */
        @media (max-width: 480px) {
            .horizontal-menu-item {
                flex: 0 0 100%;
                margin: 4px 0;
            }

            .horizontal-menu.active {
                max-height: 250px;
            }

            .navigation-bar {
                padding: 6px 12px;
            }

            .location-switcher {
                height: 42px;
            }

            .location-switcher-label {
                font-size: 0.78em;
                letter-spacing: 1px;
            }

            .nav-button {
                padding: 5px 10px;
                font-size: 0.8em;
            }
        }

        .input-area input,
        .input-area textarea {
            flex: 1;
            padding: 12px 15px;
            border: 2px solid #e0e0e0;
            border-radius: 25px;
            font-size: 14px;
            resize: none;
            overflow: hidden;
            min-height: 44px;
            max-height: 120px;
            font-family: inherit;
            line-height: 1.4;
        }
        
        .input-area textarea {
            padding-top: 12px;
            padding-bottom: 12px;
        }

        .input-area button {
            padding: 12px 25px;
        }

        .error {
            color: #e74c3c;
            font-size: 14px;
            margin-top: 10px;
        }

        .loading {
            display: inline-block;
            width: 20px;
            height: 20px;
            border: 3px solid #f3f3f3;
            border-top: 3px solid #0097b2;
            border-radius: 50%;
            animation: spin 1s linear infinite;
            margin-left: 10px;
        }

        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }
        
        /* Typing indicator animation */
        .typing-indicator {
            display: flex;
            gap: 4px;
            align-items: center;
            padding: 8px 0;
        }
        
        .typing-dot {
            width: 8px;
            height: 8px;
            background: #999;
            border-radius: 50%;
            animation: typing-bounce 1.4s ease-in-out infinite;
        }
        
        .typing-dot:nth-child(1) {
            animation-delay: 0s;
        }
        
        .typing-dot:nth-child(2) {
            animation-delay: 0.2s;
        }
        
        .typing-dot:nth-child(3) {
            animation-delay: 0.4s;
        }
        
        @keyframes typing-bounce {
            0%, 60%, 100% {
                transform: translateY(0);
                opacity: 0.7;
            }
            30% {
                transform: translateY(-10px);
                opacity: 1;
            }
        }

        .button-row {
            display: flex;
            gap: 10px;
            flex-wrap: wrap;
            margin-top: 15px;
            justify-content: center;
        }

        .button-row button {
            font-size: 14px;
            padding: 10px 20px;
        }

        .message-content-and-button {
            display: flex;
            flex-direction: column;
            gap: 8px;
        }
        
        .explain-button {
            background: rgba(0, 151, 178, 0.1);
            color: #0097b2;
            border: 1px solid #0097b2;
            padding: 8px 15px;
            font-size: 13px;
            font-weight: 500;
            border-radius: 8px;
            cursor: pointer;
            align-self: flex-start;
        }

        .explain-button:hover {
            background: #0097b2;
            color: white;
        }
