/**
 * Studio 222 Music App - エレガント・ラグジュアリー・ミニマル UIデザインシステム [Ver 2.0]
 */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,500;0,600;0,700;1,400&family=Noto+Serif+JP:wght@300;400;600&family=Outfit:wght@300;400;500;700&display=swap');

:root {
    --bg-base: #FCFBFA; /* ほのかな温かみのあるオフホワイト */
    --bg-white: #FFFFFF; /* クリーンな純白 */
    --bg-card: #FFFFFF;
    --border-color: #EBE8E2; /* 優しいベージュグレーの極細境界線 */
    --border-hover: #C5A880; /* シャンパンゴールド */
    
    --gold-primary: #C5A880; /* シャンパンゴールド */
    --gold-dark: #A98E65; /* 少し濃いアンティークゴールド */
    --gold-light: #F6F3EC; /* 極めて薄いゴールドベージュ */
    --navy-primary: #121B2D; /* 洗練されたディープネイビー */
    --navy-light: #2A364E; /* 明るめのネイビー */
    
    --text-primary: #121B2D; /* 視認性抜群のディープネイビー */
    --text-secondary: #4A5568; /* 品のあるミディアムグレー */
    --text-muted: #8A94A6; /* 優しいライトグレー */
    
    --font-serif: 'Playfair Display', 'Noto Serif JP', serif;
    --font-sans: 'Outfit', 'Noto Sans JP', sans-serif;
    
    --shadow-soft: 0 10px 30px rgba(197, 168, 128, 0.06);
    --shadow-medium: 0 15px 40px rgba(18, 27, 45, 0.04);
    --shadow-gold-glow: 0 0 20px rgba(197, 168, 128, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: var(--gold-primary) var(--bg-base);
}

body {
    background-color: var(--bg-base);
    background-image: 
        radial-gradient(at 0% 0%, rgba(197, 168, 128, 0.06) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(18, 27, 45, 0.02) 0px, transparent 50%);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

/* スクロールバー */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-base);
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--gold-primary);
}

header {
    background: rgba(252, 251, 250, 0.9); /* bodyと同色の白系に戻し調和 */
    backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--border-color); /* 元の薄い境界線 */
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
    width: 100%;
}

/* ヘッダーの中央寄せインナーコンテナ！これで下のアクティブ画面と縦ラインが1pxの狂いもなくピタッと揃います！ */
.header-inner {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0.5rem 1.5rem; /* 下の.studio-containerのpaddingと完璧に同期！ */
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo-container {
    display: flex;
    justify-content: flex-start; /* 左寄せにしてサイドバーの左端と1pxの狂いもなく完全同期！ */
    align-items: center;
    width: 380px; /* 左サイドバー（けいこ）と完全に同じ幅に固定！ */
    flex-shrink: 0;
}

.logo-icon {
    display: none;
}

.logo-text {
    display: none;
}

.header-logo-img {
    width: 100%; /* 横幅いっぱいに広げてサイドバーの幅と完全に一致させる！ */
    max-width: 380px;
    height: auto; /* 高さはプロデューサーの加工画像アスペクト比を自動維持 */
    object-fit: contain;
    display: block;
    transition: all 0.3s ease;
    /* プロデューサーが極上の「ぼかし＆トリミング」加工画像を作成してくださるため、CSSマスクは不要になり削除しました */
}
.header-logo-img:hover {
    transform: scale(1.03);
    filter: drop-shadow(0 0 10px rgba(197, 168, 128, 0.25));
}

nav {
    display: flex;
    gap: 1.5rem;
    justify-content: flex-end;
}

nav a {
    color: var(--text-secondary); /* 元のシックなテキスト色に戻す */
    text-decoration: none;
    font-family: var(--font-sans);
    font-weight: 500;
    font-size: 0.9rem;
    letter-spacing: 1px;
    padding: 0.5rem 1.25rem;
    border-radius: 50px;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    cursor: pointer;
}

nav a:hover, nav a.active {
    color: var(--gold-dark);
    border-color: var(--gold-primary);
    background: var(--gold-light);
    box-shadow: none;
}

.studio-container {
    max-width: 1600px;
    margin: 2rem auto;
    padding: 0 1.5rem;
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 2rem;
    min-height: calc(100vh - 120px);
}

@media (max-width: 1024px) {
    .studio-container {
        grid-template-columns: 1fr;
    }
}

/* サイドバー */
.sidebar-panel {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.keiko-avatar-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--shadow-soft);
    position: relative;
    overflow: hidden;
}

.keiko-avatar-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(to right, var(--gold-primary), var(--gold-dark));
}

.keiko-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.keiko-avatar-wrapper {
    position: relative;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 1.5px solid var(--gold-primary);
    box-shadow: 0 4px 10px rgba(197, 168, 128, 0.15);
    overflow: hidden;
    background: #fbfbfb;
    display: flex;
    align-items: center;
    justify-content: center;
}

.keiko-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.keiko-avatar-fallback {
    font-size: 2rem;
    animation: sway 4s ease-in-out infinite;
}

@keyframes sway {
    0%, 100% { transform: rotate(-5deg); }
    50% { transform: rotate(5deg); }
}

.keiko-meta h3 {
    font-size: 1.05rem;
    color: var(--navy-primary);
    font-weight: 600;
    font-family: var(--font-serif);
}

.keiko-status {
    font-family: var(--font-sans);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gold-dark);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: 1px;
    margin-top: 0.2rem;
}

.status-dot {
    width: 6px;
    height: 6px;
    background: var(--gold-primary);
    border-radius: 50%;
    box-shadow: 0 0 6px var(--gold-primary);
    animation: pulse 1.5s infinite alternate;
}

@keyframes pulse {
    0% { opacity: 0.4; }
    100% { opacity: 1; }
}

.keiko-thought {
    font-size: 0.85rem;
    color: var(--text-secondary);
    background: var(--gold-light);
    padding: 0.85rem;
    border-radius: 10px;
    border-left: 2px solid var(--gold-primary);
    font-style: italic;
    font-family: var(--font-serif);
}

.chat-panel {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    height: 680px;
    box-shadow: var(--shadow-soft);
    overflow: hidden;
}

.chat-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--gold-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-title {
    font-family: var(--font-serif);
    color: var(--navy-primary);
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 1px;
}

.chat-history {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: #FDFDFD;
}

.message {
    max-width: 85%;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    font-size: 0.88rem;
    line-height: 1.5;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.message.user {
    background: var(--navy-primary);
    color: #FFFFFF;
    align-self: flex-end;
    border-bottom-right-radius: 2px;
    box-shadow: 0 4px 10px rgba(18, 27, 45, 0.15);
}

.message.model {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    align-self: flex-start;
    border-bottom-left-radius: 2px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.02);
}

.message pre {
    background: var(--bg-base);
    padding: 0.7rem;
    border-radius: 6px;
    overflow-x: auto;
    margin-top: 0.5rem;
    font-family: var(--font-sans);
    border: 1px solid var(--border-color);
}

.message code {
    font-family: var(--font-sans);
    color: var(--navy-primary);
}

.chat-input-area {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-white);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* 添付ファイルのミニプレビュー枠 */
.chat-file-preview-container {
    display: none;
    flex-direction: row !important;
    align-items: center !important;
    gap: 0.75rem !important;
    background: var(--gold-light) !important;
    border: 1px solid var(--border-color) !important;
    padding: 0.5rem 0.75rem !important;
    border-radius: 8px !important;
    animation: fadeIn 0.25s ease !important;
    width: 100% !important;
}

.chat-file-preview-container.show-preview {
    display: flex !important;
}

.chat-file-preview-thumb {
    width: 36px;
    height: 36px;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid var(--gold-primary);
    background: var(--bg-white);
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-file-preview-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chat-file-preview-name {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-weight: 500;
    flex-grow: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-file-preview-remove {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.btn-file-preview-remove:hover {
    color: #ef4444;
}

.chat-input-controls {
    display: flex !important;
    flex-direction: column !important; /* 縦並び2段構成へ変更して広々と */
    gap: 0.5rem !important;
    align-items: stretch !important;
    width: 100% !important;
}

.chat-input {
    width: 100% !important;
    background: var(--bg-base);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.9rem;
    transition: all 0.3s ease;
    resize: vertical; /* 縦に自由に拡張可能！ */
    height: 90px !important; /* 初期高さを広々と確保 */
}

.chat-btn-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.chat-input:focus {
    outline: none;
    border-color: var(--gold-primary);
    background: var(--bg-white);
    box-shadow: 0 0 8px rgba(197, 168, 128, 0.2);
}

/* クリップ＆マイク用丸ボタン */
.btn-chat-addon {
    background: var(--bg-base);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.btn-chat-addon:hover {
    border-color: var(--gold-primary);
    color: var(--gold-dark);
    background: var(--gold-light);
    transform: scale(1.05);
}

.btn-chat-addon.mic-active {
    border-color: #ef4444;
    color: #ffffff;
    background: linear-gradient(135deg, #ef4444, #b91c1c);
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.4);
    animation: pulse-red 1s infinite alternate;
}

@keyframes pulse-red {
    0% { transform: scale(1); }
    100% { transform: scale(1.08); }
}

.btn-send {
    background: linear-gradient(135deg, var(--navy-primary), var(--navy-light));
    border: 1px solid var(--gold-primary);
    border-radius: 8px;
    padding: 0 1.25rem;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #fff;
    font-family: var(--font-sans);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 1px;
    box-shadow: 0 4px 10px rgba(18, 27, 45, 0.15);
    transition: all 0.3s ease;
    gap: 0.35rem;
}

.btn-send:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-gold-glow);
    background: var(--navy-light);
}

/* メインエリア */
.workspace-panel {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.panel-title {
    font-size: 1.4rem;
    font-weight: 700;
    font-family: var(--font-serif);
    letter-spacing: 1px;
    border-bottom: 2px solid var(--gold-primary);
    padding-bottom: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--navy-primary);
}

.panel-title span {
    font-family: var(--font-sans);
    color: var(--gold-dark);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 2px;
}

/* 段階的ステップ用スタイル */
.step-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2.25rem;
    box-shadow: var(--shadow-soft);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.step-section.locked {
    opacity: 0.35;
    pointer-events: none;
    filter: grayscale(40%);
}

.step-section.locked::after {
    content: '🔒 LOCKED';
    position: absolute;
    top: 1.5rem;
    right: 2rem;
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 2px;
    border: 1px solid var(--border-color);
    padding: 0.3rem 0.85rem;
    border-radius: 50px;
    background: var(--bg-base);
}

.step-section.active {
    opacity: 1;
    pointer-events: auto;
    filter: none;
    border-color: var(--gold-primary);
    box-shadow: var(--shadow-gold-glow);
}

.step-section.active::after {
    content: '⚡ ACTIVE';
    position: absolute;
    top: 1.5rem;
    right: 2rem;
    font-family: var(--font-sans);
    font-weight: 700;
    font-size: 0.75rem;
    color: var(--gold-dark);
    letter-spacing: 2px;
    border: 1.5px solid var(--gold-primary);
    padding: 0.3rem 0.85rem;
    border-radius: 50px;
    background: var(--gold-light);
    animation: pulse 1.5s infinite alternate;
}

.step-section.completed {
    opacity: 1;
    pointer-events: auto;
    filter: none;
    border-color: var(--border-color);
    box-shadow: var(--shadow-soft);
}

.step-section.completed::after {
    content: '✓ COMPLETED';
    position: absolute;
    top: 1.5rem;
    right: 2rem;
    font-family: var(--font-sans);
    font-weight: 700;
    font-size: 0.75rem;
    color: #C5A880;
    letter-spacing: 2px;
    border: 1.5px solid var(--gold-primary);
    padding: 0.3rem 0.85rem;
    border-radius: 50px;
    background: var(--gold-light);
}

.step-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--gold-primary), var(--gold-dark));
    color: #fff;
    font-family: var(--font-sans);
    font-weight: 700;
    font-size: 0.75rem;
    padding: 0.25rem 0.85rem;
    border-radius: 50px;
    margin-bottom: 1.25rem;
    box-shadow: 0 4px 10px rgba(197, 168, 128, 0.25);
    letter-spacing: 1px;
}

.btn-step-confirm {
    background: var(--navy-primary);
    border: 1px solid var(--gold-primary);
    border-radius: 8px;
    padding: 0.85rem 2.25rem;
    color: #fff;
    font-family: var(--font-sans);
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 1.5px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(18, 27, 45, 0.2);
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.btn-step-confirm:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(18, 27, 45, 0.3), var(--shadow-gold-glow);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-label {
    font-size: 0.8rem;
    font-family: var(--font-sans);
    font-weight: 700;
    color: var(--navy-primary);
    letter-spacing: 1px;
}

.form-input {
    background: var(--bg-base);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: var(--font-sans);
    transition: all 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--gold-primary);
    background: var(--bg-white);
    box-shadow: 0 0 8px rgba(197, 168, 128, 0.2);
}

/* 音楽スタイルグリッド */
.style-selector-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.25rem;
    margin: 1.5rem 0;
}

.style-card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    box-shadow: var(--shadow-soft);
}

.style-card:hover {
    border-color: var(--gold-primary);
    box-shadow: var(--shadow-gold-glow);
    transform: translateY(-2px);
}

.style-card.selected {
    border-color: var(--gold-primary);
    box-shadow: var(--shadow-gold-glow);
    background: var(--gold-light);
}

.style-card.selected::before {
    content: '✓';
    position: absolute;
    top: 12px;
    right: 14px;
    color: var(--gold-dark);
    font-weight: bold;
}

.style-card-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--navy-primary);
    margin-bottom: 0.5rem;
    font-family: var(--font-serif);
}

.style-card-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.45;
}

/* --- 音声読み上げ & Suno AI 連携用スタイル強化 --- */
.tts-control-panel {
    background: var(--gold-light);
    border: 1px solid var(--gold-primary);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-soft);
}

.tts-control-panel:hover {
    box-shadow: var(--shadow-gold-glow);
}

.tts-title {
    font-family: var(--font-sans);
    font-weight: 700;
    color: var(--navy-primary);
    font-size: 0.85rem;
    letter-spacing: 1px;
}

.suno-data-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
    .suno-data-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

.scenes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.scene-card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: all 0.3s ease;
    position: relative;
    box-shadow: var(--shadow-soft);
}

.scene-card:hover {
    border-color: var(--gold-primary);
    box-shadow: var(--shadow-gold-glow);
}

.scene-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.scene-number {
    font-family: var(--font-serif);
    color: var(--gold-dark);
    font-weight: 700;
}

.scene-prompt-textarea {
    background: var(--bg-base);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem;
    color: var(--text-primary);
    font-size: 0.85rem;
    font-family: var(--font-sans);
    resize: none;
    height: 70px;
}

.scene-prompt-textarea:focus {
    outline: none;
    border-color: var(--gold-primary);
    background: var(--bg-white);
}

.generate-action-area {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-height: 180px;
    justify-content: center;
}

.scene-image-preview {
    width: 100%;
    height: 160px;
    border-radius: 10px;
    background: var(--bg-base);
    border: 1px dashed var(--gold-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.download-badge-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(18, 27, 45, 0.85);
    border: 1px solid var(--gold-primary);
    border-radius: 4px;
    padding: 0.3rem 0.6rem;
    font-size: 0.7rem;
    color: #fff;
    font-family: var(--font-sans);
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s ease;
    z-index: 10;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}

.download-badge-btn:hover {
    background: var(--gold-primary);
    color: var(--navy-primary);
    box-shadow: var(--shadow-gold-glow);
}

.scene-image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    animation: imgFadeIn 0.5s ease;
}

@keyframes imgFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.image-placeholder-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
}

.english-prompt-box {
    margin-top: 0.25rem;
    margin-bottom: 0.5rem;
    background: rgba(18, 27, 45, 0.03);
    border: 1px solid rgba(197, 168, 128, 0.25);
    border-radius: 6px;
    padding: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-family: var(--font-sans);
    line-height: 1.4;
    word-break: break-all;
    max-height: 80px;
    overflow-y: auto;
}

.english-prompt-box span.title {
    display: block;
    font-size: 0.65rem;
    color: var(--gold-dark);
    font-weight: 700;
    margin-bottom: 0.25rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.btn-generate-single {
    width: 100%;
    background: var(--navy-primary);
    border: 1px solid var(--gold-primary);
    border-radius: 8px;
    padding: 0.65rem;
    color: #fff;
    font-family: var(--font-sans);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 4px 10px rgba(18, 27, 45, 0.15);
}

.btn-generate-single:hover {
    background: var(--navy-light);
    box-shadow: var(--shadow-gold-glow);
    transform: translateY(-1px);
}

.submit-panel {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    box-shadow: var(--shadow-soft);
}

.submit-btn {
    background: linear-gradient(135deg, var(--gold-primary), var(--gold-dark));
    border: none;
    border-radius: 8px;
    padding: 1rem 2.5rem;
    color: #fff;
    font-family: var(--font-sans);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 2px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(197, 168, 128, 0.25);
    transition: all 0.3s ease;
}

.submit-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 20px rgba(197, 168, 128, 0.4);
}

.skeleton {
    background: linear-gradient(90deg, var(--bg-base) 25%, var(--gold-light) 50%, var(--bg-base) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.library-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.song-card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2.25rem;
    box-shadow: var(--shadow-soft);
    position: relative;
}

.song-card-title-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.song-title-text {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--navy-primary);
    font-family: var(--font-serif);
}

.song-date {
    font-family: var(--font-sans);
    font-weight: 500;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.song-body {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 2rem;
}

.song-lyrics-area {
    background: var(--bg-base);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    font-size: 0.95rem;
    line-height: 1.8;
    color: var(--text-primary);
    white-space: pre-wrap;
    max-height: 320px;
    overflow-y: auto;
}

.song-media-side {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.suno-link-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: var(--navy-primary);
    color: #fff;
    padding: 0.75rem;
    border-radius: 8px;
    text-decoration: none;
    font-family: var(--font-sans);
    font-weight: 700;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(18, 27, 45, 0.15);
    border: 1px solid var(--gold-primary);
}

.suno-link-btn:hover {
    background: var(--navy-light);
    box-shadow: var(--shadow-gold-glow);
}

.song-images-gallery {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.gallery-thumb {
    width: 100%;
    height: 90px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    position: relative;
}

.gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* --- フローティング対話コンソール (アシスタントけいこ相談用) --- */
.floating-keiko-console {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    font-family: var(--font-sans);
}

.floating-toggle-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--bg-white);
    border: 2px solid var(--gold-primary);
    box-shadow: var(--shadow-soft), 0 4px 20px rgba(197,168,128,0.15);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: var(--navy-primary);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: floatAnimation 3s ease-in-out infinite alternate;
    padding: 0;
    overflow: hidden;
}

.floating-toggle-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.3s;
}

.floating-toggle-btn:hover {
    transform: scale(1.05) rotate(15deg);
    box-shadow: var(--shadow-gold-glow);
}

.floating-toggle-btn.open {
    background: linear-gradient(135deg, var(--gold-primary), var(--gold-dark));
    border-color: var(--gold-primary);
    color: #FFFFFF;
    box-shadow: var(--shadow-gold-glow);
}

@keyframes floatAnimation {
    0% { transform: translateY(0); }
    100% { transform: translateY(-10px); }
}

.floating-chat-window {
    width: 380px;
    height: 520px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--gold-primary);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(197,168,128,0.15), var(--shadow-soft);
    backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin-bottom: 1rem;
    transform: translateY(20px) scale(0.95);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: bottom right;
}

.floating-chat-window.show {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: auto;
}

.floating-chat-header {
    background: var(--navy-primary);
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--gold-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.floating-chat-header-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.floating-chat-header-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1.5px solid var(--gold-primary);
    box-shadow: 0 2px 8px rgba(197, 168, 128, 0.2);
    object-fit: cover;
}

.floating-status-dot {
    width: 8px;
    height: 8px;
    background: var(--gold-primary);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--gold-primary);
}

.floating-chat-close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    transition: color 0.3s;
}

.floating-chat-close-btn:hover {
    color: var(--gold-primary);
}

.floating-chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: #FDFDFD;
}

.floating-chat-body::-webkit-scrollbar {
    width: 6px;
}
.floating-chat-body::-webkit-scrollbar-thumb {
    background: rgba(197, 168, 128, 0.2);
    border-radius: 3px;
}

.floating-chat-footer {
    padding: 0.85rem;
    background: var(--gold-light);
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* フローティング用の小さなファイルプレビュー */
.floating-file-preview-container {
    display: none;
    flex-direction: row !important;
    align-items: center !important;
    gap: 0.5rem !important;
    background: var(--bg-white) !important;
    border: 1px solid var(--border-color) !important;
    padding: 0.35rem 0.5rem !important;
    border-radius: 6px !important;
    animation: fadeIn 0.2s ease !important;
    width: 100% !important;
}

.floating-file-preview-container.show-preview {
    display: flex !important;
}

.floating-file-preview-thumb {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid var(--gold-primary);
    background: var(--bg-white);
    display: flex;
    align-items: center;
    justify-content: center;
}

.floating-file-preview-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.floating-file-preview-name {
    font-size: 0.7rem;
    color: var(--text-secondary);
    font-family: var(--font-sans);
    flex-grow: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.floating-chat-controls {
    display: flex !important;
    flex-direction: row !important;
    gap: 0.35rem !important;
    align-items: center !important;
    width: 100% !important;
}

.floating-chat-input {
    flex: 1;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.6rem 0.85rem;
    color: var(--text-primary);
    font-size: 0.85rem;
    font-family: var(--font-sans);
    height: 38px;
}

.floating-chat-input:focus {
    outline: none;
    border-color: var(--gold-primary);
    box-shadow: 0 0 8px rgba(197, 168, 128, 0.2);
}

/* フローティングチャット用の小さめクリップ＆マイク丸ボタン */
.btn-floating-addon {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.btn-floating-addon:hover {
    border-color: var(--gold-primary);
    color: var(--gold-dark);
    background: var(--gold-light);
}

.btn-floating-addon.mic-active {
    border-color: #ef4444;
    color: #ffffff;
    background: linear-gradient(135deg, #ef4444, #b91c1c);
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
    animation: pulse-red-small 1s infinite alternate;
}

@keyframes pulse-red-small {
    0% { transform: scale(1); }
    100% { transform: scale(1.06); }
}

.floating-chat-send-btn {
    background: linear-gradient(135deg, var(--navy-primary), var(--navy-light));
    border: 1px solid var(--gold-primary);
    border-radius: 8px;
    color: #fff;
    padding: 0 1rem;
    height: 38px;
    font-size: 0.75rem;
    font-family: var(--font-sans);
    font-weight: 700;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: var(--shadow-soft);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.floating-chat-send-btn:hover {
    box-shadow: var(--shadow-gold-glow);
    background: var(--navy-light);
}
