/* ==========================================================================
   HELIOX AI — PURE WHITE MINIMALIST DESIGN SYSTEM
   PROPRIETARY TO NVH SYSTEMS (OWNERS: DWAYN & PYTO)
   EXCLUSIVELY IN PURE WHITE (CZYSTA BIEL) & SWISS TYPOGRAPHY
   ========================================================================== */

:root {
    --bg-pure: #ffffff;
    --bg-subtle: #fafafb;
    --bg-elevated: #f4f4f6;
    --bg-bubble-user: #f2f2f7;
    
    --text-primary: #111111;
    --text-secondary: #48484a;
    --text-muted: #8e8e93;
    
    --border-hairline: #e8e8ec;
    --border-medium: #d1d1d6;
    --border-focus: #111111;
    
    --accent-pure: #111111;
    --accent-contrast: #ffffff;
    
    --radius-full: 9999px;
    --radius-lg: 16px;
    --radius-md: 10px;
    --radius-sm: 6px;
    
    --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-serif: 'Newsreader', Georgia, serif;
    --font-mono: 'JetBrains Mono', monospace;
    
    --shadow-dock: 0 8px 32px rgba(0, 0, 0, 0.06);
    --shadow-card: 0 2px 10px rgba(0, 0, 0, 0.03);
    --transition-fast: all 0.16s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-smooth: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

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

html, body {
    width: 100%;
    max-width: 100%;
    height: 100%;
    height: 100dvh;
    margin: 0;
    padding: 0;
    overflow: hidden !important;
    overflow-x: hidden !important;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    touch-action: pan-y;
    overscroll-behavior: none;
    overscroll-behavior-x: none;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
}

body.theme-pure-white {
    background-color: var(--bg-pure);
    color: var(--text-primary);
    font-family: var(--font-sans);
    display: flex;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

input, textarea {
    user-select: text;
    font-family: inherit;
}

.hidden {
    display: none !important;
}

/* ==========================================================================
   1. KINETIC INTRO SPLASH OVERLAY
   ========================================================================== */
#intro-overlay {
    position: fixed;
    inset: 0;
    background-color: #ffffff;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.intro-content {
    position: relative;
    text-align: center;
}

.kinetic-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.92);
    font-family: var(--font-serif);
    font-size: 52px;
    font-weight: 500;
    color: #111111;
    letter-spacing: -0.5px;
    opacity: 0;
    transition: opacity 0.45s ease, transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
    white-space: nowrap;
}

.kinetic-text.active {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.kinetic-text.exit {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.08);
}

.highlight-free {
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 6px;
}

.boom-shockwave {
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: radial-gradient(circle, #111111 0%, rgba(17, 17, 17, 0.4) 40%, transparent 70%);
    opacity: 0;
    pointer-events: none;
}

.boom-shockwave.fire {
    animation: shockwaveBoom 0.75s cubic-bezier(0.1, 0.9, 0.2, 1) forwards;
}

@keyframes shockwaveBoom {
    0% { transform: scale(0.5); opacity: 1; }
    50% { opacity: 0.8; }
    100% { transform: scale(80); opacity: 0; }
}

/* ==========================================================================
   2. AUTHENTICATION VIEW
   ========================================================================== */
#auth-view {
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-pure);
}

.auth-card {
    width: 420px;
    background-color: var(--bg-pure);
    border: 1px solid var(--border-hairline);
    border-radius: var(--radius-lg);
    padding: 38px 32px;
    box-shadow: var(--shadow-dock);
}

.auth-brand {
    text-align: center;
    margin-bottom: 24px;
}

.auth-brand .logo-box {
    margin: 0 auto 12px;
    width: 72px;
    height: 72px;
}

.auth-brand h2 {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.4px;
    color: var(--text-primary);
}

.auth-tagline {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.auth-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-hairline);
    margin-bottom: 22px;
}

.tab-btn {
    flex: 1;
    padding: 9px;
    background: transparent;
    border: none;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: var(--transition-fast);
}

.tab-btn.active {
    color: var(--text-primary);
    border-bottom-color: var(--accent-pure);
}

.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-group input {
    width: 100%;
    background-color: var(--bg-subtle);
    border: 1px solid var(--border-hairline);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 13px;
    color: var(--text-primary);
    outline: none;
    transition: var(--transition-fast);
}

.form-group input:focus {
    border-color: var(--border-focus);
    background-color: #ffffff;
}

/* Captcha */
.captcha-container {
    background-color: var(--bg-subtle);
    border: 1px solid var(--border-hairline);
    border-radius: var(--radius-sm);
    padding: 12px;
    margin: 16px 0;
}

.captcha-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.captcha-badge {
    background: rgba(113, 113, 122, 0.1);
    color: var(--text-secondary);
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    transition: var(--transition-fast);
}

.captcha-badge.verified {
    background: #16a34a !important;
    color: #ffffff !important;
    font-weight: 700;
}

/* 1. Tryb Wpisywania Nazwy (Mobile / Responsive) */
.captcha-text-mode {
    display: none;
    background: #ffffff;
    border: 1px solid var(--border-hairline);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
}

.captcha-challenge-box {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.captcha-instruction-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.captcha-instruction {
    font-size: 11px;
    color: var(--text-muted);
}

.captcha-badge-container {
    display: flex;
    align-items: center;
    gap: 6px;
}

.captcha-code-badge {
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 1.5px;
    color: #111111;
    background: #f4f4f6;
    padding: 3px 9px;
    border-radius: 6px;
    border: 1px dashed #111111;
    user-select: none;
    transition: var(--transition-fast);
}

.captcha-code-badge.verified {
    border-color: #16a34a;
    background-color: rgba(22, 163, 74, 0.08);
    color: #16a34a;
}

.captcha-refresh-btn {
    background: transparent;
    border: 1px solid var(--border-hairline);
    border-radius: 4px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition-fast);
}

.captcha-refresh-btn:hover {
    color: var(--text-primary);
    border-color: var(--border-medium);
}

.captcha-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.captcha-input-wrap input {
    width: 100%;
    background-color: var(--bg-subtle);
    border: 1px solid var(--border-hairline);
    border-radius: var(--radius-sm);
    padding: 9px 34px 9px 12px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    outline: none;
    letter-spacing: 0.5px;
    transition: var(--transition-fast);
}

.captcha-input-wrap input:focus {
    border-color: var(--border-focus);
    background-color: #ffffff;
}

.captcha-input-wrap input.verified {
    border-color: #16a34a !important;
    background-color: rgba(22, 163, 74, 0.04);
}

.captcha-input-status-icon {
    position: absolute;
    right: 10px;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.captcha-slider-track {
    position: relative;
    height: 38px;
    background-color: #ffffff;
    border: 1px solid var(--border-hairline);
    border-radius: var(--radius-full);
    overflow: hidden;
    display: flex;
    align-items: center;
}

.captcha-progress {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0;
    background: rgba(22, 163, 74, 0.15);
}

.captcha-handle {
    position: absolute;
    left: 3px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #111111;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    z-index: 2;
}

.captcha-text {
    width: 100%;
    text-align: center;
    font-size: 11px;
    color: var(--text-muted);
    pointer-events: none;
}

.auth-footer button {
    width: 100%;
    padding: 11px;
    border-radius: var(--radius-sm);
    background-color: var(--accent-pure);
    color: var(--accent-contrast);
    font-size: 13px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: var(--transition-fast);
}

.auth-footer button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.auth-footnote {
    text-align: center;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 16px;
}

/* ==========================================================================
   3. POST-LOGIN WHITE TRANSITION
   ========================================================================== */
#beta-transition-overlay {
    position: fixed;
    inset: 0;
    background-color: #ffffff;
    z-index: 8000;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.beta-title-container {
    text-align: center;
    z-index: 8002;
}

.beta-main-title {
    font-size: 46px;
    font-weight: 800;
    color: #111111;
    letter-spacing: -1.5px;
}

.beta-sub-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 2px;
    margin-top: 6px;
}

.pixel-mosaic-grid {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-template-rows: repeat(8, 1fr);
    z-index: 8001;
}

.pixel-tile {
    background-color: #ffffff;
    border: 0.5px solid rgba(0, 0, 0, 0.03);
    transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.pixel-tile.dissolve {
    opacity: 0;
    transform: scale(0.6) rotate(6deg);
}

/* ==========================================================================
   4. GŁÓWNA APLIKACJA
   ========================================================================== */
#app-view {
    width: 100vw;
    height: 100vh;
    display: flex;
    background-color: var(--bg-pure);
}

/* SIDEBAR */
.sidebar {
    width: 250px;
    background-color: var(--bg-subtle);
    border-right: 1px solid var(--border-hairline);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: var(--transition-smooth);
    z-index: 100;
}

.sidebar.collapsed {
    margin-left: -250px;
}

.sidebar-top {
    padding: 16px 14px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: var(--radius-sm);
}

.brand-title {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.3px;
    color: var(--text-primary);
}

.new-chat-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 10px;
    background-color: #111111;
    color: #ffffff;
    border: none;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
}

.new-chat-btn:hover {
    opacity: 0.88;
}

.sidebar-search {
    margin: 4px 14px 8px;
}

.sidebar-search input {
    width: 100%;
    background-color: #ffffff;
    border: 1px solid var(--border-hairline);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    font-size: 12px;
    color: var(--text-primary);
    outline: none;
}

.sidebar-search input::placeholder {
    color: var(--text-muted);
}

.chat-history-section {
    flex: 1;
    overflow-y: auto;
    padding: 4px 10px;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px;
    color: var(--text-secondary);
    transition: var(--transition-fast);
}

.history-item:hover {
    background-color: #f0f0f3;
    color: var(--text-primary);
}

.history-item.active {
    background-color: #e8e8ed;
    color: var(--text-primary);
    font-weight: 500;
}

.history-item-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.history-item-del {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    opacity: 0;
    padding: 2px 4px;
    font-size: 14px;
}

.history-item:hover .history-item-del {
    opacity: 1;
}

.sidebar-bottom {
    padding: 12px 14px;
    border-top: 1px solid var(--border-hairline);
}

.user-card {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

.user-card:hover {
    background-color: #f0f0f3;
}

.user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: #111111;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
}

.user-meta {
    flex: 1;
    overflow: hidden;
}

.user-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-plan {
    font-size: 10px;
    color: var(--text-muted);
}

/* ==========================================================================
   5. OBSZAR ROBOCZY CZATU (WORKSPACE)
   ========================================================================== */
.chat-workspace {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: relative;
    overflow: hidden;
    background-color: var(--bg-pure);
}

.workspace-header {
    height: 48px;
    border-bottom: 1px solid var(--border-hairline);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    background-color: #ffffff;
    z-index: 10;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-toggle {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-title-box {
    display: flex;
    align-items: center;
    gap: 6px;
}

.header-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

.header-badge {
    font-size: 10px;
    background: #f0f0f3;
    color: var(--text-secondary);
    padding: 1px 5px;
    border-radius: 4px;
    font-weight: 600;
}

.training-status-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px;
    background-color: var(--bg-subtle);
    border: 1px solid var(--border-hairline);
    border-radius: var(--radius-full);
    font-size: 11px;
    color: var(--text-secondary);
}

.pulse-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #0284c7;
    box-shadow: 0 0 6px rgba(2, 132, 199, 0.6);
    animation: pulseDotAnim 2s infinite;
}

@keyframes pulseDotAnim {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
}

/* ==========================================================================
   6. DUSZEK HELIOX (LIVE EYE-TRACKING MASCOT)
   ========================================================================== */
.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 24px 20px 130px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
}

.chat-thread {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
}

.pure-hero {
    margin: 40px auto 20px;
    text-align: center;
    max-width: 660px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.mascot-stage {
    position: relative;
    width: 130px;
    height: 130px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
}

.heliox-live-mascot {
    display: block;
    overflow: visible;
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    animation: mascotIdleFloat 4.8s infinite ease-in-out;
}

@keyframes mascotIdleFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.mascot-body {
    fill: #111111;
}

.mascot-eyes {
    transform-origin: 80px 76px;
    transition: transform 0.12s cubic-bezier(0.1, 0.9, 0.2, 1);
}

.mascot-eye {
    fill: #ffffff;
    transform-origin: center;
    animation: mascotEyeBlink 4.4s infinite ease-in-out;
}

.mascot-eye.eye-right {
    animation-delay: 0.08s;
}

@keyframes mascotEyeBlink {
    0%, 93%, 100% { transform: scaleY(1); }
    96% { transform: scaleY(0.08); }
}

.mascot-shadow {
    position: absolute;
    bottom: 2px;
    width: 76px;
    height: 10px;
    background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.09) 0%, transparent 70%);
    border-radius: 50%;
    animation: mascotShadowScale 4.8s infinite ease-in-out;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

@keyframes mascotShadowScale {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(0.85); opacity: 0.6; }
}

/* ==========================================================================
   RĄCZKA Z LUPKĄ & REAKCJA NA PISANIE (INSPECTING MODE)
   ========================================================================== */
#mascot-magnifier-arm {
    transform-origin: 28px 120px;
    transform: translate(-30px, 45px) rotate(-45deg) scale(0.1);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.42s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.22s ease;
}

/* Stan zaglądania z lupką podczas pisania lub kliknięcia */
.heliox-live-mascot.inspecting {
    transform: translateY(9px) rotate(-4.5deg) scale(1.04) !important;
    animation: mascotInspectingFloat 2.4s infinite ease-in-out !important;
}

@keyframes mascotInspectingFloat {
    0%, 100% { transform: translateY(9px) rotate(-4.5deg) scale(1.04); }
    50% { transform: translateY(12px) rotate(-3.5deg) scale(1.05); }
}

/* Lupka wysuwa się płynnie i precyzyjnie przed lewe oko */
.heliox-live-mascot.inspecting #mascot-magnifier-arm {
    transform: translate(0px, 0px) rotate(0deg) scale(1);
    opacity: 1;
}

/* Lewe oko zagląda przez lupkę - soczewka powiększa je idealnie współosiowo, bez deformacji! */
.heliox-live-mascot.inspecting #eye-left {
    transform-box: fill-box;
    transform-origin: center;
    transform: scale(1.22) !important;
    transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
    filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.9));
}

/* Prawe oko mruży się ciekawie w detektywistycznym skupieniu wokół własnego środka */
.heliox-live-mascot.inspecting #eye-right {
    transform-box: fill-box;
    transform-origin: center;
    transform: scaleY(0.55) scaleX(0.88) !important;
    transition: transform 0.25s ease;
}

/* Mikro-podskok przy wciskaniu klawiszy (duszek reaguje na każde słowo) */
.heliox-live-mascot.keystroke-pulse {
    transform: translateY(6px) rotate(-5.5deg) scale(1.07) !important;
    transition: transform 0.08s ease-out !important;
}

.heliox-live-mascot.inspecting .mag-lens-glow {
    animation: lensGlowPulse 1.8s infinite ease-in-out;
}

@keyframes lensGlowPulse {
    0%, 100% { opacity: 0.45; }
    50% { opacity: 0.85; stroke-width: 5px; }
}

.heliox-live-mascot.inspecting ~ .mascot-shadow {
    transform: scale(1.12);
    opacity: 0.85;
}

/* Reakcje Duszka na myślenie */
.heliox-live-mascot.thinking {
    animation: mascotThinkingFloat 1.2s infinite alternate ease-in-out !important;
}

@keyframes mascotThinkingFloat {
    0% { transform: translateY(0) scale(1); }
    100% { transform: translateY(-7px) scale(1.03); }
}

.heliox-live-mascot.thinking #eye-left,
.heliox-live-mascot.thinking #eye-right {
    animation: mascotThinkingEyes 1.4s infinite ease-in-out;
}

@keyframes mascotThinkingEyes {
    0%, 100% { transform: translateY(-4px) scaleY(0.9); }
    50% { transform: translateY(-7px) scaleY(1.1); }
}

.hero-title {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -0.8px;
    color: #111111;
}

.hero-desc {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
    margin-bottom: 20px;
}

/* KARTA POSTĘPU TRENINGU (BEZ KARTY GRAFICZNEJ) */
.training-notice-card {
    width: 100%;
    background-color: var(--bg-subtle);
    border: 1px solid var(--border-hairline);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    text-align: left;
    margin-bottom: 24px;
}

.notice-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    margin-bottom: 8px;
}

.notice-card-title {
    font-weight: 600;
    color: var(--text-primary);
}

.notice-card-pct {
    font-family: var(--font-mono);
    font-weight: 600;
    color: #0284c7;
}

.notice-progress-bar {
    width: 100%;
    height: 4px;
    background-color: var(--border-hairline);
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 8px;
}

.notice-progress-fill {
    height: 100%;
    background-color: #111111;
    border-radius: 999px;
    transition: width 0.4s ease;
}

.notice-card-sub {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.4;
}

/* SUGESTIE PROMPTÓW */
.suggestions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.sugg-chip {
    padding: 7px 13px;
    background-color: #ffffff;
    border: 1px solid var(--border-hairline);
    border-radius: var(--radius-full);
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-fast);
}

.sugg-chip:hover {
    border-color: var(--border-medium);
    color: var(--text-primary);
    background-color: var(--bg-subtle);
}

/* ==========================================================================
   7. WIADOMOŚCI CZATU
   ========================================================================== */
.message-group {
    display: flex;
    gap: 12px;
    max-width: 100%;
}

.message-group.user {
    justify-content: flex-end;
}

.message-group.user .message-body {
    background-color: var(--bg-bubble-user);
    border-radius: 16px 16px 4px 16px;
    padding: 10px 16px;
    max-width: 78%;
    color: #111111;
    font-size: 14px;
    line-height: 1.5;
}

.message-group.ai {
    justify-content: flex-start;
}

.ai-avatar-box {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    margin-top: 2px;
}

.message-group.ai .message-body {
    flex: 1;
    max-width: calc(100% - 40px);
}

.message-author {
    font-size: 12px;
    font-weight: 700;
    color: #111111;
    margin-bottom: 4px;
}

.message-text {
    font-size: 14px;
    line-height: 1.65;
    color: var(--text-primary);
}

.message-text p {
    margin-bottom: 10px;
}

.message-text p:last-child {
    margin-bottom: 0;
}

/* Karta myślenia <think> */
.think-card {
    background-color: var(--bg-subtle);
    border: 1px solid var(--border-hairline);
    border-left: 2px solid #111111;
    border-radius: var(--radius-sm);
    margin: 8px 0 12px;
    overflow: hidden;
}

.think-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 12px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
}

.think-body {
    padding: 10px 14px;
    font-family: var(--font-mono);
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-muted);
    white-space: pre-wrap;
    background-color: #ffffff;
    border-top: 1px solid var(--border-hairline);
    max-height: 340px;
    overflow-y: auto;
}

.think-body.collapsed {
    display: none;
}

/* Bloki Kodu */
pre {
    background-color: #111111 !important;
    border-radius: var(--radius-sm);
    margin: 12px 0;
    overflow: hidden;
}

.code-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.05);
    font-size: 11px;
    font-family: var(--font-mono);
    color: #a1a1aa;
}

.code-header-bar span {
    font-weight: 600;
    text-transform: uppercase;
}

.copy-code-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    padding: 2px 7px;
    font-size: 10px;
    color: #ffffff;
    cursor: pointer;
}

pre code {
    display: block;
    padding: 12px;
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.5;
    color: #f4f4f5;
    overflow-x: auto;
}

/* Akcje wiadomości */
.message-actions-bar {
    display: flex;
    gap: 8px;
    margin-top: 6px;
}

.msg-action-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.msg-action-btn:hover {
    color: var(--text-primary);
    background-color: var(--bg-elevated);
}

/* ==========================================================================
   8. PŁYWAJĄCY DOCK WPISYWANIA (PURE WHITE MINIMALIST)
   ========================================================================== */
.floating-dock-container {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0 20px 14px;
    background: linear-gradient(to top, #ffffff 70%, transparent 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
}

.dock-wrapper {
    width: 100%;
    max-width: 760px;
    background-color: #ffffff;
    border: 1px solid var(--border-medium);
    border-radius: 20px;
    padding: 10px 14px 10px 16px;
    box-shadow: var(--shadow-dock);
    pointer-events: auto;
    display: flex;
    align-items: flex-end;
    gap: 8px;
    transition: var(--transition-fast);
}

.dock-wrapper:focus-within {
    border-color: #111111;
    box-shadow: 0 0 0 1px #111111, var(--shadow-dock);
}

#chat-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    font-size: 14px;
    color: #111111;
    resize: none;
    max-height: 180px;
    min-height: 24px;
    line-height: 1.5;
}

#chat-input::placeholder {
    color: var(--text-muted);
}

.dock-send-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #111111;
    color: #ffffff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: var(--transition-fast);
}

.dock-send-btn:hover:not(:disabled) {
    transform: scale(1.05);
}

.dock-send-btn:disabled {
    opacity: 0.2;
    cursor: not-allowed;
}

.dock-disclaimer {
    margin-top: 6px;
    font-size: 10px;
    color: var(--text-muted);
    text-align: center;
}

/* ==========================================================================
   9. MODALE
   ========================================================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.modal-card {
    width: 440px;
    background-color: #ffffff;
    border: 1px solid var(--border-hairline);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-dock);
    overflow: hidden;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-hairline);
}

.modal-header h3 {
    font-size: 15px;
    font-weight: 700;
    color: #111111;
}

.modal-close-btn {
    background: transparent;
    border: none;
    font-size: 20px;
    color: var(--text-muted);
    cursor: pointer;
}

.modal-body {
    padding: 20px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-hairline);
}

.settings-actions {
    margin-top: 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.btn-clean {
    padding: 8px 12px;
    background-color: var(--bg-subtle);
    border: 1px solid var(--border-hairline);
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    text-align: left;
}

.btn-clean.btn-danger {
    color: #ef4444;
}

/* ==========================================================================
   10. MOBILNA RESPONSYWNOŚĆ & PEŁNA BLOKADA PRZEWIJANIA W BOKI
   ========================================================================== */

/* Ścisłe zablokowanie ruchu horyzontalnego i przeciągania na boki */
html, body {
    overflow-x: hidden !important;
    position: fixed;
    width: 100%;
    max-width: 100%;
    height: 100%;
    height: 100dvh;
    touch-action: pan-y;
    overscroll-behavior-x: none;
    overscroll-behavior-y: contain;
}

#intro-overlay, #auth-view, #beta-transition-overlay, #app-view, 
.chat-workspace, .workspace-header, .messages-container, .chat-thread, 
.floating-dock-container {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden !important;
}

/* Wygaszanie tła dla menu bocznego na telefonach */
.sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(2px);
    z-index: 1999;
    opacity: 1;
    transition: opacity 0.25s ease;
}

.sidebar-backdrop.hidden {
    display: none !important;
    opacity: 0;
}

@media (max-width: 960px), (hover: none), (pointer: coarse) {
    /* 1. KINETIC INTRO */
    .kinetic-text {
        font-size: clamp(24px, 6.8vw, 36px);
        white-space: normal;
        text-align: center;
        padding: 0 16px;
        width: 100%;
    }

    /* 2. AUTH CARD & CAPTCHA */
    #auth-view {
        padding: 16px;
        align-items: center;
        justify-content: center;
        overflow-y: auto;
    }

    .auth-card {
        width: 100%;
        max-width: 390px;
        padding: 24px 18px;
        margin: auto;
    }

    /* Wymuszenie 16px font-size dla inputów na smartfonach (blokuje auto-zoom w iOS/Android) */
    .form-group input,
    .captcha-input-wrap input,
    #chat-input {
        font-size: 16px !important;
    }

    /* Całkowite ukrycie suwaka na urządzeniach mobilnych i dotykowych */
    .desktop-only,
    .captcha-slider-track {
        display: none !important;
        visibility: hidden !important;
        height: 0 !important;
        width: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }

    .captcha-text-mode {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    /* 3. TRANSITION OVERLAY */
    .beta-main-title {
        font-size: 32px;
    }

    .beta-sub-title {
        font-size: 9px;
    }

    /* 4. SIDEBAR JAKO MOBILNY DRAWER (OFF-CANVAS) */
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 280px;
        max-width: 82vw;
        height: 100%;
        height: 100dvh;
        z-index: 2000;
        background-color: #ffffff;
        border-right: 1px solid var(--border-hairline);
        box-shadow: 4px 0 28px rgba(0, 0, 0, 0.15);
        transform: translateX(-100%);
        transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
        margin-left: 0 !important;
    }

    .sidebar.mobile-open {
        transform: translateX(0) !important;
    }

    /* 5. GÓRNY HEADER */
    .workspace-header {
        height: 50px;
        padding: 0 12px;
    }

    .training-status-pill {
        max-width: 175px;
        padding: 4px 9px;
        font-size: 11px;
        gap: 6px;
    }

    #training-progress-text {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* 6. OBSZAR WIADOMOŚCI */
    .messages-container {
        padding: 14px 12px 125px;
        gap: 14px;
        width: 100%;
        max-width: 100%;
        overflow-x: hidden !important;
        touch-action: pan-y;
        -webkit-overflow-scrolling: touch;
    }

    .pure-hero {
        margin: 12px auto 10px;
        padding: 0 4px;
        width: 100%;
    }

    .mascot-stage {
        width: 105px;
        height: 105px;
        margin-bottom: 8px;
    }

    .heliox-live-mascot {
        width: 100px;
        height: 100px;
    }

    .hero-title {
        font-size: 26px;
        letter-spacing: -0.5px;
    }

    .hero-desc {
        font-size: 12px;
        margin-top: 2px;
        margin-bottom: 14px;
        padding: 0 8px;
    }

    .training-notice-card {
        padding: 10px 12px;
        margin-bottom: 14px;
    }

    .notice-card-header {
        font-size: 11px;
    }

    .notice-card-sub {
        font-size: 10px;
        line-height: 1.35;
    }

    .suggestions-row {
        gap: 6px;
        padding: 0 4px;
    }

    .sugg-chip {
        font-size: 11px;
        padding: 5px 10px;
    }

    /* 7. BĄBELKI WIADOMOŚCI */
    .message-group {
        gap: 8px;
    }

    .message-group.user .message-body {
        max-width: 88%;
        padding: 8px 13px;
        font-size: 13.5px;
        border-radius: 14px 14px 3px 14px;
    }

    .message-group.ai .message-body {
        max-width: calc(100% - 34px);
    }

    .message-text {
        font-size: 13.5px;
        line-height: 1.55;
        word-break: break-word;
    }

    pre {
        margin: 8px 0;
        max-width: 100%;
    }

    pre code {
        font-size: 12px;
        padding: 9px 10px;
    }

    /* 8. PŁYWAJĄCY DOCK */
    .floating-dock-container {
        padding: 6px 10px calc(8px + env(safe-area-inset-bottom, 8px));
        background: linear-gradient(to top, #ffffff 82%, rgba(255, 255, 255, 0.9) 92%, transparent 100%);
    }

    .dock-wrapper {
        border-radius: 20px;
        padding: 7px 10px 7px 14px;
        gap: 6px;
        width: 100%;
        max-width: 100%;
    }

    #chat-input {
        min-height: 22px;
        max-height: 120px;
        line-height: 1.4;
    }

    .dock-send-btn {
        width: 34px;
        height: 34px;
    }

    .dock-disclaimer {
        font-size: 9px;
        margin-top: 3px;
    }

    /* 9. MODALE */
    .modal-card {
        width: calc(100% - 24px);
        max-width: 380px;
        margin: 12px;
    }

    .modal-header {
        padding: 12px 16px;
    }

    .modal-body {
        padding: 16px;
    }
}
