* { box-sizing: border-box; }
        html { height: 100%; -webkit-text-size-adjust: 100%; }
        html, body { overflow-x: hidden; }

        :root {
            --bg-page: #f0f2f5; --bg-surface: #ffffff;
            --text-body: #333; --text-muted: #666; --text-faint: #65676b;
            --border: #ddd; --border-light: #eee;
            --input-bg: #f0f2f5; --input-border: #ccc;
            --stranger-bg: #e4e6eb; --stranger-text: #050505;
            --accent: #0084ff; --accent-dark: #0073e6;
            --disabled: #9cbfe3; --avatar-stranger: #9aa0a6;
        }
        body.dark {
            --bg-page: #0d1117; --bg-surface: #171b22;
            --text-body: #e4e6eb; --text-muted: #a8adb4; --text-faint: #9aa0a6;
            --border: #2a2f37; --border-light: #262b32;
            --input-bg: #1f242b; --input-border: #333941;
            --stranger-bg: #262b32; --stranger-text: #f0f2f5;
            --disabled: #2d4a6b; --avatar-stranger: #5b6169;
        }

        body { font-family: 'Inter', Arial, sans-serif; background-color: var(--bg-page); margin: 0; padding: 0; display: flex; flex-direction: column; align-items: center; height: 100vh; height: 100dvh; -webkit-tap-highlight-color: transparent; transition: background-color 0.25s ease; }

        .chat-container { width: 100%; max-width: 600px; background: var(--bg-surface); border-radius: 14px; box-shadow: 0 2px 10px rgba(0,0,0,0.1); display: flex; flex-direction: column; flex-shrink: 0; height: 90vh; height: 90dvh; margin-top: 2vh; overflow: hidden; border: 1px solid var(--border); transition: border-radius 0.3s ease, box-shadow 0.3s ease, margin 0.3s ease, height 0.3s ease, background-color 0.25s ease, border-color 0.25s ease; }

        /* Start screen: branded hero */
        #start-screen { display: flex; flex-direction: column; align-items: center; height: 100%; text-align: center; padding: 30px 24px; overflow-y: auto; background: radial-gradient(120% 60% at 50% -10%, rgba(0,132,255,0.10) 0%, rgba(0,132,255,0) 60%), var(--bg-surface); }
        .start-content { margin: auto 0; width: 100%; }
        .brand-badge { width: 64px; height: 64px; border-radius: 20px; background: linear-gradient(135deg, #0084ff 0%, #0073e6 100%); display: flex; align-items: center; justify-content: center; margin: 0 auto 18px; box-shadow: 0 10px 22px rgba(0,132,255,0.35); }
        .brand-badge svg { width: 30px; height: 30px; }
        #start-screen h1 { color: #0084ff; margin: 0 0 10px; font-size: clamp(1.5em, 6vw, 1.9em); font-weight: 800; letter-spacing: -0.02em; }
        .region-pill { display: inline-flex; align-items: center; gap: 6px; background: rgba(0,132,255,0.12); color: #0084ff; border: 1px solid rgba(0,132,255,0.22); padding: 6px 16px; border-radius: 20px; font-size: 0.8em; font-weight: 700; margin: 0 0 16px; letter-spacing: 0.2px; }
        #start-screen p { color: var(--text-muted); margin: 0 0 24px; font-size: 0.98em; }
        .trust-badges { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 0 0 28px; }
        .trust-badge { background: var(--bg-page); color: var(--text-faint); font-size: 12.5px; font-weight: 600; padding: 7px 13px; border-radius: 14px; border: 1px solid var(--border-light); }
        #start-btn { background: linear-gradient(135deg, #0084ff 0%, #0073e6 100%); color: white; border: none; padding: 16px 44px; font-size: 1.15em; border-radius: 30px; cursor: pointer; font-weight: 700; box-shadow: 0 10px 24px rgba(0,132,255,0.35); transition: 0.25s ease; display: inline-flex; align-items: center; gap: 10px; touch-action: manipulation; }
        #start-btn:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(0,132,255,0.4); }
        #start-btn:active { transform: translateY(0); box-shadow: 0 6px 14px rgba(0,132,255,0.3); }
        .start-note { color: var(--text-faint); font-size: 12.5px; margin: 16px 0 0 !important; }

        /* Chat screen */
        #chat-ui { display: none; flex-direction: column; height: 100%; position: relative; }
        .header { background: var(--bg-surface); color: var(--text-body); padding: 12px 15px; display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 1.1em; font-weight: bold; border-bottom: 1px solid var(--border-light); transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease; }
        .header-left { display: flex; align-items: center; gap: 8px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
        .header-right { display: flex; align-items: center; gap: 2px; flex-shrink: 0; }
        .icon-toggle { background: none; border: none; cursor: pointer; font-size: 17px; padding: 6px 8px; border-radius: 8px; line-height: 1; transition: background 0.15s ease; }
        .icon-toggle:hover { background: rgba(0,132,255,0.1); }
        .status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--disabled); flex-shrink: 0; }
        .status-dot.connected { background: #0084ff; animation: pulseDot 1.6s ease-out infinite; }
        @keyframes pulseDot { 0% { box-shadow: 0 0 0 0 rgba(0,132,255,0.45); } 70% { box-shadow: 0 0 0 8px rgba(0,132,255,0); } 100% { box-shadow: 0 0 0 0 rgba(0,132,255,0); } }

        .messages { flex: 1; padding: 15px; overflow-y: auto; -webkit-overflow-scrolling: touch; display: flex; flex-direction: column; gap: 12px; background: var(--bg-surface); transition: background-color 0.25s ease; }

        .msg-row { display: flex; gap: 8px; align-items: flex-end; max-width: 82%; }
        .msg-row.my-msg { align-self: flex-end; }
        .msg-row.stranger-msg { align-self: flex-start; }
        .msg-row.grouped { margin-top: -6px; }
        .msg-row.grouped .avatar { visibility: hidden; }
        .bubble-col { display: flex; flex-direction: column; min-width: 0; }
        .msg-row.my-msg .bubble-col { align-items: flex-end; }
        .msg-row.stranger-msg .bubble-col { align-items: flex-start; }
        .avatar { width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: #fff; flex-shrink: 0; }
        .msg-row.stranger-msg .avatar { background: var(--avatar-stranger); }

        .message { padding: 8px 12px 7px; border-radius: 18px; max-width: 100%; word-wrap: break-word; font-size: 15px; line-height: 1.4; box-shadow: 0 1px 2px rgba(0,0,0,0.05); animation: msgIn 0.25s ease; }
        @keyframes msgIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
        .msg-text { display: block; }
        .msg-time { display: block; text-align: right; font-size: 10px; margin-top: 2px; opacity: 0.85; }
        .my-msg .msg-time { color: rgba(255,255,255,0.85); }
        .stranger-msg .msg-time { color: var(--text-faint); }
        .my-msg { background: #0084ff; color: #fff; border-bottom-right-radius: 4px; }
        .stranger-msg { background: var(--stranger-bg); color: var(--stranger-text); border-bottom-left-radius: 4px; }
        .system-msg { align-self: center; text-align: center; font-size: 0.85em; color: var(--text-faint); font-weight: 600; margin: 6px 0; background: transparent; }
        .sys-icon { display: inline-block; margin-right: 5px; animation: pulseIcon 1.4s ease-in-out infinite; }
        @keyframes pulseIcon { 0%, 100% { opacity: 0.5; transform: scale(0.9); } 50% { opacity: 1; transform: scale(1.05); } }

        .typing-bubble { display: flex; align-items: center; gap: 3px; padding: 12px 15px; }
        .typing-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--text-faint); display: inline-block; animation: typingBounce 1.2s infinite ease-in-out; }
        .typing-dot:nth-child(2) { animation-delay: 0.15s; }
        .typing-dot:nth-child(3) { animation-delay: 0.3s; }
        @keyframes typingBounce { 0%, 60%, 100% { transform: translateY(0); opacity: 0.5; } 30% { transform: translateY(-4px); opacity: 1; } }

        .scroll-pill { display: none; align-items: center; gap: 6px; position: absolute; left: 50%; bottom: 76px; transform: translateX(-50%); background: #0084ff; color: #fff; border: none; padding: 8px 16px; border-radius: 20px; font-size: 12.5px; font-weight: 700; cursor: pointer; box-shadow: 0 4px 14px rgba(0,132,255,0.4); z-index: 5; }

        .controls { display: flex; padding: 10px; padding-bottom: calc(10px + env(safe-area-inset-bottom)); background: var(--bg-surface); border-top: 1px solid var(--border); gap: 8px; transition: background-color 0.25s ease, border-color 0.25s ease; }
        .input-wrap { position: relative; flex: 1; min-width: 0; }
        #msg-input { width: 100%; padding: 12px 54px 12px 12px; border: 1px solid var(--input-border); border-radius: 20px; font-size: 16px; outline: none; background: var(--input-bg); color: var(--text-body); transition: box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease; }
        #msg-input:focus { background: var(--bg-surface); box-shadow: 0 0 0 3px rgba(0,132,255,0.15); border-color: #0084ff; }
        .char-count { display: none; position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-size: 10.5px; color: var(--text-faint); pointer-events: none; }
        button.action-btn { padding: 10px 18px; border: none; border-radius: 20px; cursor: pointer; font-size: 1em; font-weight: 700; transition: 0.2s ease; touch-action: manipulation; flex-shrink: 0; }
        button.action-btn.icon-only { padding: 10px 13px; font-size: 1.05em; }
        #send-btn { background: #0084ff; color: #fff; }
        #send-btn:hover:not(:disabled) { background: #0073e6; }
        #send-btn:disabled { background: var(--disabled); cursor: not-allowed; }
        #skip-btn, #report-btn { background: var(--stranger-bg); color: var(--stranger-text); }
        #skip-btn:hover, #report-btn:hover { filter: brightness(0.95); }

        button:focus-visible, a:focus-visible { outline: 2px solid #0084ff; outline-offset: 2px; }

        /* Immersive full-screen chat mode: triggered on "Start chatten" so only the chat is visible */
        body.chat-active footer { display: none; }
        body.chat-active .chat-container { height: 100vh; height: 100dvh; margin: 0; border-radius: 0; box-shadow: none; border: none; }

        /* Footer: segmented region switcher + info card */
        .footer-links { display: flex; justify-content: center; gap: 4px; margin: 24px auto 18px; padding: 5px; background: var(--bg-surface); border-radius: 30px; max-width: 320px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); border: 1px solid var(--border-light); transition: background-color 0.25s ease, border-color 0.25s ease; }
        .footer-links a { color: var(--text-faint); text-decoration: none; padding: 8px 16px; border-radius: 22px; font-size: 13.5px; font-weight: 600; transition: 0.2s ease; }
        .footer-links a:hover { background: rgba(0,132,255,0.08); color: #0084ff; }
        .footer-links a.active { background: #0084ff; color: #fff; }

        /* City dropdown (Städte-Übersicht) */
        .city-dropdown { width: 100%; max-width: 320px; margin: 0 auto 18px; background: var(--bg-surface); border: 1px solid var(--border-light); border-radius: 14px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); overflow: hidden; transition: background-color 0.25s ease, border-color 0.25s ease; }
        .city-dropdown summary { list-style: none; cursor: pointer; padding: 10px 16px; font-size: 13.5px; font-weight: 600; color: var(--text-faint); display: flex; align-items: center; justify-content: center; gap: 6px; user-select: none; }
        .city-dropdown summary::-webkit-details-marker { display: none; }
        .city-dropdown[open] summary { color: #0084ff; border-bottom: 1px solid var(--border-light); }
        .city-dropdown .chev { font-size: 10px; transition: transform 0.2s ease; }
        .city-dropdown[open] .chev { transform: rotate(180deg); }
        .city-list { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; padding: 10px; max-height: 260px; overflow-y: auto; }
        .city-group-label { grid-column: 1 / -1; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; color: var(--text-faint); padding: 8px 8px 2px; }
        .city-group-label:first-child { padding-top: 2px; }
        .city-list a { color: var(--text-body); text-decoration: none; font-size: 13px; padding: 7px 10px; border-radius: 8px; transition: background 0.15s ease, color 0.15s ease; }
        .city-list a:hover { background: rgba(0,132,255,0.08); color: #0084ff; }
        .city-list a.active { background: #0084ff; color: #fff; font-weight: 700; }


        .info-section { width: 100%; max-width: 600px; margin: 0 auto 30px; padding: 0 15px; box-sizing: border-box; }
        .info-card, .content-section { background: var(--bg-surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 2px 10px rgba(0,0,0,0.1); padding: 26px 28px; transition: background-color 0.25s ease, border-color 0.25s ease; }
        .info-card { border-top: 4px solid #0084ff; }
        .info-card h2, .content-section h2 { color: #0084ff; font-size: 1.15em; font-weight: bold; margin: 0 0 6px 0; }
        .info-card .info-subtitle { color: var(--text-muted); font-size: 13px; margin: 0 0 16px 0; }
        .info-card p { color: var(--text-body); font-size: 14px; line-height: 1.75; margin: 0; text-align: left; }

        /* Rotating announcement / link banner — generic slot, empty by default */
        .ad-banner { display: flex; align-items: center; gap: 10px; width: 100%; max-width: 600px; margin: 0 auto 16px; padding: 12px 16px; background: var(--bg-surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); box-sizing: border-box; }
        .ad-banner .ad-icon { font-size: 18px; flex-shrink: 0; }
        .ad-banner .ad-text { flex: 1; min-width: 0; font-size: 13px; color: var(--text-body); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: opacity 0.3s ease; }
        .ad-banner .ad-text a { color: #0084ff; font-weight: 700; text-decoration: none; }
        .ad-banner .ad-text a:hover { text-decoration: underline; }
        .ad-banner .ad-label { font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-faint); border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px; flex-shrink: 0; }

        /* How it works */
        .steps-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; text-align: left; }
        .step-num { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; background: #0084ff; color: #fff; font-weight: 700; font-size: 12.5px; margin-bottom: 8px; }
        .steps-grid h3 { font-size: 14px; color: var(--text-body); margin: 0 0 4px; }
        .steps-grid p { font-size: 13px; color: var(--text-muted); line-height: 1.5; margin: 0; }

        /* Features grid */
        .features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; text-align: left; }
        .feature-icon { font-size: 20px; display: block; margin-bottom: 8px; }
        .features-grid h3 { font-size: 14px; color: var(--text-body); margin: 0 0 4px; }
        .features-grid p { font-size: 13px; color: var(--text-muted); line-height: 1.5; margin: 0; }

        /* FAQ */
        .faq-item { padding-bottom: 16px; margin-bottom: 16px; border-bottom: 1px solid var(--border-light); }
        .faq-item:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
        .faq-item h3 { font-size: 14.5px; color: var(--text-body); margin: 0 0 6px; font-weight: 700; }
        .faq-item p { font-size: 13.5px; color: var(--text-muted); line-height: 1.6; margin: 0; }

        .content-section + .content-section { margin-top: 18px; }
        .info-card + .content-section { margin-top: 18px; }

        @media (max-width: 600px) {
            .steps-grid, .features-grid { grid-template-columns: 1fr 1fr; }
        }
        @media (max-width: 420px) {
            .steps-grid, .features-grid { grid-template-columns: 1fr; }
            .content-section, .info-card { padding: 20px 20px; }
        }

        /* Phones: keep a proper card for the idle screen, only go edge-to-edge once chat is active */
        @media (max-width: 480px) {
            .chat-container { margin: 14px auto; height: calc(100dvh - 28px); border-radius: 16px; }
            #start-screen { padding: 24px 18px; padding-top: calc(24px + env(safe-area-inset-top)); padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
            .brand-badge { width: 56px; height: 56px; border-radius: 16px; }
            .header { font-size: 1em; padding: 10px 12px; padding-top: calc(10px + env(safe-area-inset-top)); }
            .icon-toggle { font-size: 15px; padding: 5px 6px; }
            .avatar { width: 22px; height: 22px; font-size: 10px; }
            .msg-row { max-width: 88%; }
            .message { font-size: 14px; }
            .controls { padding: 8px; gap: 6px; }
            button.action-btn { padding: 12px 14px; }
            #msg-input { padding-right: 48px; }
            .info-section { margin: 0 auto 24px; padding: 0 12px; }
            .info-card { padding: 20px 20px; }
            .info-card h2 { font-size: 1.05em; }
        }

        body.chat-active .chat-container { margin: 0; border-radius: 0; height: 100vh; height: 100dvh; }

        @media (max-width: 480px) and (orientation: landscape) {
            .brand-badge { width: 44px; height: 44px; margin-bottom: 8px; }
            #start-screen p { margin-bottom: 14px; }
            .trust-badges { margin-bottom: 14px; }
            #start-btn { padding: 12px 32px; }
            .start-note { margin-top: 8px !important; }
        }


/* ===== Site header (logo + primary nav) ===== */
.site-header { width: 100%; max-width: 600px; display: flex; align-items: center; justify-content: space-between; padding: 10px 6px; flex-shrink: 0; box-sizing: border-box; }
.site-header .brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: #0084ff; font-weight: 800; font-size: 15px; }
.site-header .brand-icon { width: 26px; height: 26px; border-radius: 8px; background: linear-gradient(135deg, #0084ff 0%, #0073e6 100%); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.site-header .brand-icon svg { width: 14px; height: 14px; }
.site-header nav { display: flex; gap: 2px; }
.site-header nav a { color: var(--text-faint); text-decoration: none; font-size: 12.5px; font-weight: 600; padding: 7px 10px; border-radius: 8px; transition: background 0.15s ease, color 0.15s ease; white-space: nowrap; }
.site-header nav a:hover { background: rgba(0,132,255,0.08); color: #0084ff; }
body.chat-active .site-header { display: none; }
@media (max-width: 480px) {
    .site-header .brand-text { display: none; }
    .site-header nav a { font-size: 11.5px; padding: 6px 8px; }
}
@media (max-width: 340px) { .site-header nav a:nth-child(n+3) { display: none; } }

/* ===== Footer navigation (site-wide links + legal) ===== */
.footer-nav { width: 100%; max-width: 600px; margin: 24px auto 0; padding: 20px 15px 0; box-sizing: border-box; display: grid; grid-template-columns: 1fr 1fr; gap: 20px; text-align: left; border-top: 1px solid var(--border-light); }
.footer-nav-col h4 { font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-faint); margin: 0 0 10px; font-weight: 700; }
.footer-nav-col a { display: block; color: var(--text-body); text-decoration: none; font-size: 13px; padding: 5px 0; }
.footer-nav-col a:hover { color: #0084ff; text-decoration: underline; }
.footer-legal-note { grid-column: 1 / -1; font-size: 11.5px; color: var(--text-faint); margin-top: 4px; }
@media (max-width: 420px) { .footer-nav { grid-template-columns: 1fr; gap: 16px; } }

/* ===== Simple content pages (legal / about / safety) ===== */
.content-page { width: 100%; max-width: 600px; margin: 0 auto; padding: 0 15px 30px; box-sizing: border-box; }
.content-page .page-card { background: var(--bg-surface); border: 1px solid var(--border); border-top: 4px solid #0084ff; border-radius: 14px; box-shadow: 0 2px 10px rgba(0,0,0,0.1); padding: 28px; text-align: left; }
.content-page .page-card h1 { color: #0084ff; font-size: 1.4em; margin: 0 0 6px; }
.content-page .page-updated { font-size: 12.5px; color: var(--text-faint); margin: 0 0 22px; }
.content-page .page-card h2 { color: var(--text-body); font-size: 1.05em; margin: 24px 0 8px; }
.content-page .page-card p, .content-page .page-card li { color: var(--text-muted); font-size: 14px; line-height: 1.75; }
.content-page .page-card ul { margin: 8px 0; padding-left: 20px; }
.content-page .page-card a { color: #0084ff; }
.content-page .back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--text-faint); text-decoration: none; font-size: 13px; font-weight: 600; margin-bottom: 16px; }
.content-page .back-link:hover { color: #0084ff; }
.content-page .fill-in { background: rgba(255,180,0,0.12); border: 1px dashed #d9a400; border-radius: 6px; padding: 2px 6px; color: #8a6400; font-weight: 700; }
body.dark .content-page .fill-in { color: #ffcf5c; }
