 :root {
            --bg: #f3f4f6; --card: #ffffff; --text: #1f2937; --text-light: #6b7280;
            --blue: #002654; --red: #ed2939; --accent: #2563eb;
            --border: #e5e7eb; --radius: 12px;
            --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
        }
        * { box-sizing: border-box; margin: 0; padding: 0; }
        body { font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.6; display: flex; flex-direction: column; height: 100vh; overflow: hidden; }
        header { background: var(--card); padding: 1rem 0; box-shadow: 0 1px 3px rgba(0,0,0,0.05); z-index: 50; flex-shrink: 0; }
        .flag-line { height: 3px; width: 100%; display: flex; position: absolute; top: 0; left: 0; }
        .flag-blue { background: var(--blue); width: 33.33%; } .flag-white { background: #fff; width: 33.33%; } .flag-red { background: var(--red); width: 33.33%; }
        .container { max-width: 600px; margin: 0 auto; padding: 0 1.5rem; width: 100%; }
        .nav-flex { display: flex; justify-content: center; align-items: center; position: relative; }
        .brand-logo { font-size: 1.4rem; font-weight: 800; color: var(--blue); text-decoration: none; }
        .hero { text-align: center; padding: 4rem 0 2rem; }
        .hero h1 { font-size: 2.5rem; font-weight: 800; letter-spacing: -0.03em; margin-bottom: 0.5rem; }
        .hero p { color: var(--text-light); font-size: 1.1rem; max-width: 600px; margin: 0 auto; }
        .highlight { color: var(--blue); position: relative; }
        .nav-btn { background: var(--blue); color: white; padding: 0.8rem 1.5rem; border-radius: 99px; font-size: 1rem; text-decoration: none; border: none; cursor: pointer; display: inline-block; text-align: center; font-weight: 600;}
        
        main { flex: 1; overflow-y: auto; padding-bottom: 80px; padding-top: 1rem; }
        .tab-content { display: none; animation: fadeIn 0.3s ease; }
        .tab-content.active { display: block; }
        @keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

        .card { background: var(--card); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05); border: 1px solid transparent; margin-bottom: 1.5rem; }
        .card-body { padding: 1.5rem; }
        .card h2 { font-size: 1.25rem; margin-bottom: 1rem; font-weight: 700; border-bottom: 1px solid var(--border); padding-bottom: 0.5rem; display: flex; justify-content: space-between; align-items: center;}
        .card h3 { font-size: 1.1rem; margin-bottom: 1rem; font-weight: 600; }
        
        .meta { font-size: 0.75rem; color: var(--text-light); font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; display: flex; gap: 10px; }
        input[type="text"], input[type="number"], input[type="email"], input[type="url"], select, textarea { width: 100%; padding: 0.8rem; border: 1px solid #d1d5db; border-radius: 6px; font-family: inherit; margin-bottom: 1rem; background: #f9fafb; outline: none; transition: border-color 0.2s; }
        input:focus, select:focus, textarea:focus { border-color: var(--accent); }
        .btn-primary { background: var(--accent); color: white; border: none; padding: 0.8rem 1.5rem; border-radius: 6px; cursor: pointer; font-weight: 600; width: 100%; display: block; text-align: center; text-decoration: none; }
        .btn-primary:hover { background: var(--blue); }
        .btn-secondary { background: var(--bg); color: var(--text); border: 1px solid var(--border); padding: 0.8rem 1.5rem; border-radius: 6px; cursor: pointer; font-weight: 600; width: 100%; }
        
        .btn-group { display: flex; gap: 0.5rem; }
        .btn-group button { flex: 1; }
        
        .progress-bar-bg { background: var(--border); height: 10px; border-radius: 5px; width: 100%; overflow: hidden; margin-top: 0.5rem; }
        .progress-bar-fill { background: var(--accent); height: 100%; transition: width 0.4s ease; }
        .pomodoro-display { font-size: 3.5rem; font-weight: 300; text-align: center; color: var(--text); margin-bottom: 1rem; font-variant-numeric: tabular-nums; }
        
        .history-item { padding: 1rem; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 1rem; background: var(--bg); }
        .history-meta { display: flex; justify-content: space-between; font-size: 0.85rem; color: var(--text-light); margin-bottom: 0.5rem; font-weight: 600; }
        
        .chat-box { height: 350px; overflow-y: auto; background: var(--bg); border-radius: 6px; padding: 1rem; margin-bottom: 1rem; display: flex; flex-direction: column; gap: 0.8rem; border: 1px solid var(--border); }
        .chat-msg { padding: 0.8rem 1rem; border-radius: 8px; max-width: 90%; font-size: 0.95rem; line-height: 1.5; }
        .chat-user { background: var(--blue); color: white; align-self: flex-end; border-bottom-right-radius: 2px; }
        .chat-bot { background: white; border: 1px solid var(--border); align-self: flex-start; border-bottom-left-radius: 2px; }
        .chat-input-row { display: flex; gap: 0.5rem; }
        .chat-input-row input { margin-bottom: 0; }
        .chat-input-row button { width: auto; padding: 0 1.5rem; }
        
        .friend-list { display: flex; flex-direction: column; gap: 0.5rem; }
        .friend-item { display: flex; justify-content: space-between; align-items: center; padding: 1rem; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; }
        .friend-info { display: flex; flex-direction: column; }
        .friend-email { font-weight: 600; font-size: 0.95rem; }
        .friend-level { font-size: 0.8rem; color: var(--text-light); }
        .streak-badge { display: flex; align-items: center; gap: 4px; background: rgba(237, 41, 57, 0.1); color: var(--red); padding: 0.3rem 0.6rem; border-radius: 99px; font-weight: 800; font-size: 0.85rem; }
        
        .streak-header { text-align: center; padding: 1rem 0; }
        .streak-icon { font-size: 3rem; margin-bottom: 0.5rem; }
        .streak-text { font-size: 1.2rem; font-weight: 800; color: var(--text); }

        .bottom-nav { position: fixed; bottom: 0; left: 0; width: 100%; background: var(--card); border-top: 1px solid var(--border); display: flex; justify-content: space-around; padding: 0.8rem 0; z-index: 100; box-shadow: 0 -2px 10px rgba(0,0,0,0.05); }
        .nav-item { display: flex; flex-direction: column; align-items: center; color: var(--text-light); text-decoration: none; font-size: 0.75rem; font-weight: 600; gap: 4px; cursor: pointer; transition: color 0.2s; background: none; border: none; }
        .nav-item svg { width: 24px; height: 24px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
        .nav-item.active { color: var(--blue); }

        .flex-row { display: flex; gap: 1rem; align-items: flex-end; }
        .flex-1 { flex: 1; }
        
        .markdown-content ul { list-style-type: disc; margin-left: 1.5rem; margin-bottom: 0.5rem; }
        .markdown-content ol { list-style-type: decimal; margin-left: 1.5rem; margin-bottom: 0.5rem; }
        .markdown-content h1, .markdown-content h2, .markdown-content h3 { margin-top: 1rem; margin-bottom: 0.5rem; font-weight: bold; }
        .markdown-content p { margin-bottom: 0.5rem; }
        
        .ex-checkbox-label { display: flex; align-items: center; gap: 10px; padding: 12px; background: var(--bg); border-radius: 8px; cursor: pointer; transition: background 0.2s; border: 1px solid var(--border); }
        .ex-checkbox-label:hover { background: #e5e7eb; }
        .ex-checkbox-label input:checked + span { text-decoration: line-through; color: var(--text-light); }

        @media (max-width: 600px) { .flex-row { flex-direction: column; align-items: stretch; } }