/* ========================================
   GO FORWARD - Common Styles
   ======================================== */

/* --- CSS Variables --- */
:root {
    --c-bg: #050505;
    --c-text: #ffffff;
    --c-text-muted: rgba(255, 255, 255, 0.9);
    --c-accent: #ffffff;
    --font-en: 'Plus Jakarta Sans', sans-serif;
    --font-jp: 'Noto Sans JP', sans-serif;
    --easing: cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- Reset --- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background-color: var(--c-bg);
    color: var(--c-text);
    font-family: var(--font-en), var(--font-jp);
    overflow-x: hidden;
    line-height: 1.8;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    cursor: none;
}

/* --- reCAPTCHA Badge Hide --- */
.grecaptcha-badge {
    visibility: hidden;
}

/* --- Loading Screen --- */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #080808;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}
.loading-logo {
    font-family: var(--font-en);
    font-size: clamp(2rem, 6vw, 4rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #fff;
    overflow: hidden;
    visibility: hidden;
}
.loading-logo .char {
    display: inline-block;
    opacity: 0;
    transform: translateY(100%);
}
.loading-bar {
    width: 120px;
    height: 2px;
    background: rgba(255, 255, 255, 0.1);
    margin-top: 2rem;
    position: relative;
    overflow: hidden;
}
.loading-bar-inner {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: #980003;
}

/* --- Page Transition --- */
.page-transition {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #050505;
    z-index: 9997;
    pointer-events: none;
    opacity: 1;
}

/* --- Custom Cursor --- */
#cursor {
    position: fixed;
    top: -10px; left: -10px; /* Offset by half width/height for centering */
    width: 20px; height: 20px;
    background-color: #ffffff;
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    /* transform is now set by JS with translate3d for GPU acceleration */
    transition: width 0.3s var(--easing), height 0.3s var(--easing), background-color 0.3s;
    mix-blend-mode: difference;
    will-change: transform;
}

#cursor.hover {
    width: 60px;
    height: 60px;
    background-color: #ffffff;
    top: -30px; left: -30px; /* Adjust for larger size */
}

/* --- WebGL Background --- */
#webgl-canvas {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    z-index: -1;
}

/* WebGL Fallback Background (when WebGL is disabled) */
body.webgl-disabled::before {
    content: '';
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    z-index: -1;
    background: radial-gradient(ellipse at 30% 20%, rgba(140, 0, 15, 0.3) 0%, transparent 50%),
                radial-gradient(ellipse at 70% 80%, rgba(10, 12, 40, 0.8) 0%, transparent 50%),
                radial-gradient(ellipse at 50% 50%, rgba(80, 0, 10, 0.2) 0%, transparent 60%),
                var(--c-bg);
}

/* --- Reduced Motion Preference --- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    #cursor {
        display: none;
    }

    body {
        cursor: auto;
    }

    #webgl-canvas {
        display: none;
    }

    body::before {
        content: '';
        position: fixed;
        top: 0; left: 0;
        width: 100vw; height: 100vh;
        z-index: -1;
        background: radial-gradient(ellipse at 30% 20%, rgba(140, 0, 15, 0.3) 0%, transparent 50%),
                    radial-gradient(ellipse at 70% 80%, rgba(10, 12, 40, 0.8) 0%, transparent 50%),
                    var(--c-bg);
    }
}

/* --- Layout --- */
.container { width: 90%; max-width: 1100px; margin: 0 auto; position: relative; }
.container-wide { width: 92%; max-width: 1400px; margin: 0 auto; position: relative; }

section {
    padding: 120px 0;
    position: relative;
}

/* --- Header --- */
.header {
    position: fixed;
    top: 0; left: 0; width: 100%;
    padding: 2rem 5%;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: padding 0.5s var(--easing), background-color 0.5s var(--easing);
    mix-blend-mode: difference;
}
.header.scrolled {
    padding: 1.2rem 5%;
}

.logo {
    font-family: var(--font-en);
    font-weight: 800;
    font-size: 1.2rem;
    letter-spacing: -0.02em;
    color: #fff;
    text-decoration: none;
}

.nav-links { display: flex; gap: 2.5rem; }

.nav-link {
    font-family: var(--font-en);
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    position: relative;
    transition: color 0.3s ease;
}
.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px; left: 0; width: 0; height: 1px;
    background-color: #fff;
    transition: width 0.3s var(--easing);
}
.nav-link:hover { color: #fff; }
.nav-link:hover::after { width: 100%; }

/* --- Typography --- */
.section-header { margin-bottom: 4rem; }
.st-en {
    font-family: var(--font-en);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    color: #ffffff;
    display: block;
    margin-bottom: 1rem;
    text-transform: uppercase;
}
.st-jp {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.02em;
    overflow: hidden;
}
.st-jp span {
    display: block;
    transform: translateY(100%);
}

/* Animation helpers */
.split-line { overflow: hidden; display: block; }
.char { display: inline-block; transform-origin: center bottom; will-change: transform; }

/* Initial state for scroll reveal elements */
.fade-up-trigger {
    opacity: 0;
    transform: translateY(40px);
}
.st-jp span {
    opacity: 0;
    transform: translateY(100%);
    display: inline-block;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 2.5rem;
    border-radius: 50px;
    font-family: var(--font-en);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s var(--easing);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background-color: var(--c-text);
    color: var(--c-bg);
}
.btn-primary:hover {
    background-color: var(--c-accent);
    color: var(--c-bg);
    transform: translateY(-2px);
}

.btn-text {
    color: var(--c-text);
    padding: 0;
    border-radius: 0;
}
.btn-text::after {
    content: '→';
    margin-left: 0.5rem;
    transition: transform 0.3s var(--easing);
}
.btn-text:hover { color: var(--c-accent); }
.btn-text:hover::after { transform: translateX(5px); }

/* --- About Text (shared) --- */
.about-lead {
    font-size: 1.25rem;
    font-weight: 500;
    line-height: 1.8;
    margin-bottom: 2rem;
}
.about-desc {
    color: var(--c-text-muted);
    font-size: 0.95rem;
    margin-bottom: 2.5rem;
}

/* --- Footer --- */
.footer {
    padding: 6rem 0 3rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    background-color: #020202;
}
.footer-logo {
    font-family: var(--font-en);
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 4rem;
    display: inline-block;
    color: #fff;
    text-decoration: none;
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 4rem;
    margin-bottom: 6rem;
}
.footer-col h4 {
    font-family: var(--font-en);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    color: var(--c-text-muted);
    margin-bottom: 1.5rem;
}
.footer-links a {
    display: block;
    color: var(--c-text);
    text-decoration: none;
    font-size: 0.9rem;
    margin-bottom: 0.8rem;
    transition: color 0.3s ease;
}
.footer-links a:hover { color: var(--c-accent); }
.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.8rem;
    color: var(--c-text-muted);
}

/* --- AI Diagnosis Tool --- */
.diagnosis-trigger {
    position: fixed;
    bottom: 3rem;
    right: 3rem;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50px;
    backdrop-filter: url(#frosted);
    -webkit-backdrop-filter: url(#frosted);
    box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.4s var(--easing);
}
.diagnosis-trigger:hover {
    background: rgba(255, 255, 255, 0.15);
    box-shadow: inset 0 0 25px rgba(255, 255, 255, 0.15);
}

/* AI Speech Bubble */
.diagnosis-bubble {
    position: fixed;
    bottom: 7.5rem;
    right: 3rem;
    z-index: 999;
    max-width: 280px;
    padding: 0.7rem 1.3rem;
    background: rgba(255, 255, 255, 1);
    color: #333;
    font-size: 0.85rem;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    overflow: visible;
    text-overflow: ellipsis;
    border-radius: 50px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transition: opacity 0.3s ease;
}
.diagnosis-bubble::after {
    content: '';
    position: absolute;
    bottom: -4px;
    right: 32px;
    width: 10px;
    height: 9px;
    background: rgba(255, 255, 255, 1);
    border-radius: 0 0 2px 0;
    transform: rotate(45deg);
}
.diagnosis-bubble.is-visible {
    opacity: 1;
}
.diagnosis-trigger-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.diagnosis-trigger-icon svg {
    width: 100%;
    height: 100%;
}

.diagnosis-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9998;
    display: none;
    opacity: 0;
}
.diagnosis-modal.active {
    display: flex;
}
.diagnosis-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 5, 5, 0.95);
    backdrop-filter: blur(20px);
}
.diagnosis-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem;
    overflow-y: auto;
}
.diagnosis-close {
    position: fixed;
    top: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s var(--easing);
    z-index: 10000;
}
.diagnosis-close:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(90deg);
}

.diagnosis-progress {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.1);
}
.diagnosis-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #980003, #0C1656);
    transition: width 0.6s var(--easing);
}

.diagnosis-step {
    max-width: 900px;
    width: 100%;
    text-align: center;
    display: none;
}
.diagnosis-step.active {
    display: block;
}
.diagnosis-back {
    position: absolute;
    top: 0;
    left: 0;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
    cursor: pointer;
    padding: 0.5rem 0;
    transition: color 0.3s ease;
}
.diagnosis-back:hover {
    color: #fff;
}
.diagnosis-step-num {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 1rem;
}
.diagnosis-question {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 3rem;
}
.diagnosis-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    max-width: 800px;
    margin: 0 auto;
}
.diagnosis-option {
    padding: 1.5rem 2rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0;
    color: #fff;
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s var(--easing);
}
.diagnosis-option:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-3px);
}
.diagnosis-option.selected {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}
.diagnosis-option-icon {
    font-size: 2rem;
    margin-bottom: 0.8rem;
    display: block;
}
.diagnosis-option-text {
    display: block;
}

.diagnosis-result-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    background: linear-gradient(135deg, #980003, #0C1656);
    border-radius: 50%;
}
.diagnosis-restart {
    display: inline-block;
    margin-top: 2rem;
    font-size: 0.85rem;
    color: var(--c-text-muted);
    cursor: pointer;
    transition: color 0.3s ease;
}
.diagnosis-restart:hover {
    color: #fff;
}

.diagnosis-form {
    display: none;
    max-width: 550px;
    width: 100%;
}
.diagnosis-form.active {
    display: block;
}
/* フォーム表示時は上部配置（小さい画面で「あと少しで完了です」が見切れないように） */
.diagnosis-form.active ~ .diagnosis-form,
.diagnosis-container:has(.diagnosis-form.active) {
    justify-content: flex-start;
    padding-top: 5rem;
}
.diagnosis-form-header {
    text-align: center;
    margin-bottom: 2rem;
}
.diagnosis-form-title {
    font-size: clamp(1.3rem, 4vw, 1.8rem);
    font-weight: 700;
    margin-bottom: 0.5rem;
}
.diagnosis-form-desc {
    color: var(--c-text-muted);
    font-size: 0.9rem;
}
.diagnosis-form-fields {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}
.diagnosis-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
.diagnosis-form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.diagnosis-form-group.full {
    grid-column: 1 / -1;
}
.diagnosis-form-group label {
    font-size: 0.8rem;
    color: #fff;
    font-weight: 500;
}
.diagnosis-form-group label .required {
    color: #ff6b6b;
    margin-left: 0.2rem;
}
.diagnosis-form-group input,
.diagnosis-form-group textarea {
    padding: 0.9rem 1rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 0;
    color: #fff;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}
.diagnosis-form-group input:focus,
.diagnosis-form-group textarea:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(0, 0, 0, 0.4);
}
.diagnosis-form-group input::placeholder,
.diagnosis-form-group textarea::placeholder {
    color: rgba(255, 255, 255, 0.35);
}
.diagnosis-privacy {
    grid-column: 1 / -1;
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
}
.diagnosis-privacy p {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
    margin-bottom: 0.5rem;
}
.diagnosis-privacy p:last-child {
    margin-bottom: 0;
}
.diagnosis-privacy a {
    color: #fff;
    text-decoration: underline;
}
.diagnosis-privacy-check {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}
.diagnosis-privacy-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #fff;
    cursor: pointer;
}
.diagnosis-privacy-check label {
    font-size: 0.85rem;
    color: #fff;
    cursor: pointer;
}
.diagnosis-submit {
    margin-top: 0.5rem;
    width: 100%;
    padding: 1rem 2rem;
}
.diagnosis-submit:hover {
    color: var(--c-bg);
}

.history-content a{
	color: #fff;
    text-decoration: none;
}

/* --- Mobile Hamburger Menu --- */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    width: 30px;
    height: 30px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1001;
    padding: 0;
}

/* Hamburger inside mobile actions container */
.header-mobile-actions .hamburger {
    display: flex;
}
.hamburger-line {
    width: 100%;
    height: 2px;
    background: #fff;
    transition: transform 0.4s var(--easing), opacity 0.4s var(--easing);
    transform-origin: center;
}
.hamburger.is-active .hamburger-line:first-child {
    transform: translateY(4px) rotate(45deg);
}
.hamburger.is-active .hamburger-line:last-child {
    transform: translateY(-4px) rotate(-45deg);
}

/* Mobile Menu Overlay */
.mobile-menu {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.98);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s var(--easing), visibility 0.5s var(--easing);
}
.mobile-menu.is-open {
    opacity: 1;
    visibility: visible;
}
.mobile-menu-inner {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1.5rem;
    padding: 0 10%;
    width: 100%;
}
.mobile-menu-link {
    font-family: var(--font-en);
    font-size: clamp(2rem, 8vw, 3rem);
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    opacity: 0;
    transform: translateY(30px);
    transition: color 0.3s ease;
}
.mobile-menu-link:hover {
    color: rgba(255, 255, 255, 0.7);
}
.mobile-menu-contact {
    margin-top: 1rem;
    padding: 1rem 0;
    width: 100%;
    text-align: center;
    background: #fff;
    color: #000;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    transition: opacity 0.3s ease;
}
.mobile-menu-contact:hover {
    color: #000;
    opacity: 0.9;
}

/* AI Assistant button in mobile menu */
.mobile-menu-ai-assistant {
    margin-top: 2rem;
    padding: 1rem 2rem;
    width: 100%;
    text-align: center;
    background: linear-gradient(135deg, rgba(152, 0, 3, 0.8), rgba(200, 50, 50, 0.6));
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50px;
    font-family: var(--font-en);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(30px);
}
.mobile-menu-ai-assistant:hover {
    background: linear-gradient(135deg, rgba(152, 0, 3, 1), rgba(200, 50, 50, 0.8));
    border-color: rgba(255, 255, 255, 0.4);
}

/* Close button for mobile menu */
.mobile-menu-close {
    position: absolute;
    top: 2rem;
    right: 5%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}
.mobile-menu-close:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
}
.mobile-menu-close::before,
.mobile-menu-close::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 2px;
    background: #fff;
}
.mobile-menu-close::before {
    transform: rotate(45deg);
}
.mobile-menu-close::after {
    transform: rotate(-45deg);
}

/* Hide diagnosis when mobile menu is open */
body.mobile-menu-open .diagnosis-trigger,
body.mobile-menu-open .diagnosis-bubble {
    opacity: 0 !important;
    pointer-events: none !important;
}

/* --- Responsive (Common) --- */
@media (max-width: 900px) {
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 3rem; }
}

@media (max-width: 768px) {
    body { cursor: auto; }
    #cursor { display: none; }
    .header { padding: 1.5rem 5%; }
    .nav-links { display: none; }
    .header .btn-primary { display: none; }
    .hamburger { display: flex; }
    .footer-grid { grid-template-columns: 1fr; }
    .footer-bottom { flex-direction: column; gap: 1rem; }
    .diagnosis-trigger {
        bottom: 1.5rem;
        right: 1.5rem;
        padding: 0.8rem 1.2rem;
    }
    .diagnosis-bubble {
        bottom: 6rem;
        right: 1.5rem;
        max-width: 200px;
        font-size: 0.75rem;
        padding: 0.6rem 1rem;
    }
    .diagnosis-container {
        padding: 5rem 1.5rem 2rem;
        justify-content: flex-start;
    }
    .diagnosis-options { grid-template-columns: 1fr 1fr; gap: 0.8rem; }
    .diagnosis-option { padding: 1.2rem 1rem; }
    .diagnosis-option-icon { font-size: 1.5rem; }
    .diagnosis-form-header { padding-top: 2rem; }
}

@media (max-width: 600px) {
    .diagnosis-form-row { grid-template-columns: 1fr; }
    .diagnosis-form-fields { padding: 1.2rem; }
}

/* ========================================
   AI Chat
   ======================================== */

/* Mobile header actions (AI Assistant + hamburger) */
.header-mobile-actions {
    display: none;
    align-items: center;
    gap: 1rem;
}

@media (max-width: 768px) {
    .header-mobile-actions {
        display: flex;
    }
}

.chat-trigger-mobile {
    background: none;
    border: none;
    color: var(--c-text);
    font-family: var(--font-en);
    font-size: 0.75rem;
    cursor: pointer;
    padding: 0;
}

/* Chat Modal */
.chat-modal {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 9999;
    display: none;
    opacity: 0;
}
.chat-modal.active {
    display: block;
}
.chat-overlay {
    display: none;
}


/* Chat Container - Frosted Glass (Dark) */
.chat-container {
    position: relative;
    width: 380px;
    max-width: calc(100vw - 2rem);
    height: 500px;
    max-height: calc(100vh - 6rem);
    background: rgba(10, 10, 10, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    cursor: auto;
}


/* Chat Header */
.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
}
.chat-header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.chat-avatar-small {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}
.chat-avatar-small svg {
    width: 14px;
    height: 14px;
}
.chat-title {
    font-size: 0.95rem;
    font-weight: 600;
    font-family: var(--font-en);
    letter-spacing: 0.02em;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.7) 0%,
        rgba(180, 220, 255, 1) 25%,
        rgba(255, 255, 255, 1) 50%,
        rgba(200, 180, 255, 1) 75%,
        rgba(255, 255, 255, 0.7) 100%
    );
    background-size: 200% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: aiShineLoop 3s linear infinite;
}

@keyframes aiShineLoop {
    0% {
        background-position: 100% 50%;
    }
    100% {
        background-position: -100% 50%;
    }
}

/* グローバルナビ AI Assistant */
.nav-ai-assistant {
    background: none;
    border: none;
    padding: 0;
    font-family: var(--font-en);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    cursor: pointer;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.7) 0%,
        rgba(100, 170, 255, 1) 25%,
        rgba(255, 255, 255, 1) 50%,
        rgba(170, 120, 255, 1) 75%,
        rgba(255, 255, 255, 0.7) 100%
    );
    background-size: 200% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: aiShineLoop 3s linear infinite;
}
.nav-ai-assistant:hover {
    animation-duration: 1.5s;
}

/* モバイルメニュー AI Assistant */
.mobile-ai-assistant {
    background: none;
    border: none;
    text-align: left;
    width: 100%;
    cursor: pointer;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.7) 0%,
        rgba(100, 170, 255, 1) 25%,
        rgba(255, 255, 255, 1) 50%,
        rgba(170, 120, 255, 1) 75%,
        rgba(255, 255, 255, 0.7) 100%
    );
    background-size: 200% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: aiShineLoop 3s linear infinite;
}
.chat-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: all 0.3s var(--easing);
}
.chat-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.chat-messages::-webkit-scrollbar {
    width: 6px;
}
.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}
.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

/* Chat Message */
.chat-message {
    display: flex;
    flex-direction: column;
    max-width: 85%;
}
.chat-message.ai {
    align-self: flex-start;
}
.chat-message.user {
    align-self: flex-end;
}
.chat-bubble {
    padding: 0.875rem 1rem;
    border-radius: 16px;
    font-size: 0.9rem;
    line-height: 1.6;
}
.chat-message.ai .chat-bubble {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
    border-bottom-left-radius: 4px;
}
.chat-message.user .chat-bubble {
    background: rgba(255, 255, 255, 0.9);
    color: #050505;
    border-bottom-right-radius: 4px;
}
.chat-bubble p {
    margin: 0;
}
.chat-bubble p + p {
    margin-top: 0.5rem;
}

/* Typing Indicator */
.chat-typing {
    display: flex;
    gap: 4px;
    padding: 0.875rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    align-self: flex-start;
}
.chat-typing span {
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    animation: chatTyping 1.4s infinite;
}
.chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.chat-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes chatTyping {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-4px); opacity: 1; }
}

/* Chat Input */
.chat-input-area {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
}
.chat-input {
    flex: 1;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    color: #fff;
    font-size: 0.9rem;
    outline: none;
    transition: all 0.3s var(--easing);
}
.chat-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}
.chat-input:focus {
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.12);
}
.chat-send {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: #fff;
    border: none;
    border-radius: 50%;
    color: #050505;
    cursor: pointer;
    transition: all 0.3s var(--easing);
}
.chat-send:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.2);
}
.chat-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}
.chat-send svg {
    width: 18px;
    height: 18px;
}

/* Chat Error */
.chat-error {
    padding: 0.75rem 1rem;
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid rgba(255, 107, 107, 0.3);
    border-radius: 8px;
    color: #ff6b6b;
    font-size: 0.85rem;
    text-align: center;
}

/* Chat Ended State */
.chat-input-area.chat-ended {
    justify-content: center;
    padding: 1rem;
}
.chat-input-area.chat-ended .chat-input {
    display: none;
}
.chat-ended-message {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
    text-align: center;
    padding: 0.5rem 0;
}

/* Quick Action Buttons */
.chat-quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0 1.25rem 1rem;
}
.chat-quick-btn {
    padding: 0.5rem 0.875rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s var(--easing);
    white-space: nowrap;
}
.chat-quick-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.3);
    color: #fff;
    transform: translateY(-1px);
}
.chat-quick-btn:active {
    transform: translateY(0);
}

/* Action Buttons (Navigate + Suggestions - unified style) */
.chat-action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.5rem 1rem 0.75rem;
}

.chat-action-btn {
    padding: 0.5rem 0.875rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s var(--easing);
    white-space: nowrap;
}

.chat-action-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.3);
    color: #fff;
    transform: translateY(-1px);
}

.chat-action-btn:active {
    transform: translateY(0);
}

/* Streaming Cursor */
.chat-bubble.streaming p:last-child::after {
    content: '▊';
    display: inline-block;
    margin-left: 2px;
    animation: cursorBlink 0.8s step-end infinite;
    color: rgba(255, 255, 255, 0.7);
}

@keyframes cursorBlink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* Chat Mobile */
@media (max-width: 768px) {
    .chat-modal {
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
    }
    .chat-container {
        width: 100%;
        height: 500px;
        max-height: 70vh;
        border-radius: 12px;
    }
    .chat-header {
        padding: 0.875rem 1rem;
    }
    .chat-messages {
        padding: 1rem;
    }
    .chat-input-area {
        padding: 0.75rem 1rem;
    }
}
