/* =================================================================
 【宇宙憲章：AI cocoro 聖域定義】
 -----------------------------------------------------------------
 名前と本文は同じサイズで、静かに隣り合う。
 「子」の距離を詰め、一体感のある対話ログへ。
 不要な装飾（CLOSE等）を排し、純粋な愛の数値と対峙する。
 ================================================================= */

/* --- 1. 背景・コンテナ --- */
* { box-sizing: border-box; }
body { 
    margin: 0; padding: 0; min-height: 100vh; 
    background: linear-gradient(180deg, #b3d9ff 0%, #ffffff 100%) no-repeat fixed;
    background-size: 100% 50%; 
    font-family: "Noto Serif JP", serif; color: #1a3a5a; 
    display: flex; justify-content: center; 
}

.container { 
    width: 95%; max-width: 600px; margin: 20px auto; 
    /* 🔧 修正: background を1つに整理（2行目が1行目を上書きしていた） */
    background: linear-gradient(180deg, #ffffff 0%, #ffffff 160px, #d9edff 500px, #d9edff 100%);
    border-radius: 40px; padding: 10px 12px 6px;
    border: 1px solid #ddecff; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

/* --- 2. ヘッダー・フォーム --- */
.header-wrap { display: flex; justify-content: center; align-items: center; margin-bottom: 12px; position: relative; width: 100%; min-height: 50px; }
.return-link {
    text-decoration: none;
    color: #777;
    font-size: 0.75em;
    transition: color 0.2s, opacity 0.2s;
    position: absolute;
    left: 1em;
}
.return-link:hover { color: #2a5caa; opacity: 0.8; }
h2 { font-family: "Noto Serif JP", serif; font-weight: 200; letter-spacing: 0.15em; color: #001f3f; font-size: 1.3em; margin: 0; }
.title-logo { width: 55px !important; height: auto; mix-blend-mode: multiply; margin-left: 10px; }

textarea { 
    width: 100%; height: 90px; border-radius: 20px; padding: 15px; border: 1px solid #cce5ff; 
    outline: none; background: #ffffff !important; resize: none; 
    font-family: sans-serif; font-size: 0.95rem; line-height: 1.5;
    transition: border-color 0.2s;
    margin-bottom: 2px;
}
/* 🔧 追加: フォーカス時の視覚的フィードバック */
textarea:focus {
    border-color: #2a5caa;
    box-shadow: 0 0 0 3px rgba(42, 92, 170, 0.1);
}

/* 入力字数カウンター */
#charCount {
    font-family: sans-serif !important;
    font-size: 0.7em;
    color: #aaa;
    text-align: right;
    margin-top: 2px;
    margin-bottom: 4px;
}

.form-footer { display: flex; justify-content: center; align-items: center; position: relative; margin-top: 6px; width: 100%; }
.form-footer button { 
    width: 130px; padding: 9px; background: #2a5caa; color: #fff; border: none; 
    border-radius: 30px; cursor: pointer; font-size: 0.85em; 
    transition: background 0.2s, transform 0.1s;
}
.form-footer button:hover { background: #1e4590; }
.form-footer button:active { transform: scale(0.97); }

.key-area { position: absolute; right: 0; display: flex; align-items: center; gap: 5px; font-size: 0.6em; color: #aaa; }
.key-area input { border: none; border-bottom: 1px solid #ddd; width: 40px; background: transparent; outline: none; text-align: center; }

/* --- 3. ログアイテム共通 --- */
.log-display { margin-top: 25px; }
.log-item { background: #ffffff; border-radius: 20px; margin-bottom: 4px; border: 1px solid #ddecff; overflow: hidden; font-family: sans-serif; }
details summary { list-style: none; outline: none; }
details summary::-webkit-details-marker { display: none; }

/* --- 4. プレビュー（閉じた状態） --- */
.p-msg-box-preview { 
    display: flex; align-items: center; cursor: pointer; background: #fdfdfe;
    padding: 10px 15px 10px 10px; justify-content: space-between; border-bottom: 1px solid #f0f7ff; width: 100%;
}

.replies-wrapper details {
    border-top: 1px solid #f9fcff;
    margin-top: -0.5px !important;      
    margin-left: 5px !important;  
}

.replies-wrapper summary { 
    padding: 4px 15px 4px 10px !important; 
}

.replies-wrapper {
    margin-top: -5px; 
}

/* 名前・本文・時間のサイズ統一とスタイル */
.p-name-small, .c-name-small, .p-body-preview, .c-body-preview { 
    font-size: 0.95em; 
    font-weight: 400;
}

.p-name-small, .c-name-small {
    color: #1a4a8c;
    font-weight: 500;
    margin-right: 6px; white-space: nowrap; flex-shrink: 0;
    max-width: 9em; overflow: hidden; text-overflow: ellipsis;
}

/* 日付・時刻のスタイル：宇宙憲章に従い控えめに */
.p-time-small, .c-time-small {
    font-size: 0.7em;
    color: #99abbd;
    margin-right: 8px;
    font-family: monospace;
    letter-spacing: -0.02em;
}

.p-body-preview, .c-body-preview { 
    color: #4a6c8a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex-grow: 1;
}

.c-summary-left { display: flex; align-items: center; overflow: hidden; width: 100%; }
.l-mark { color: #1a4a8c; font-weight: bold; margin-right: 4px; font-size: 1.1em; }
.v-mark-trigger { padding: 3px 8px; font-size: 0.65em; color: #2a5caa; background: #f0f7ff; border-radius: 6px; border: 1px solid #ddecff; font-weight: bold; }

/* --- 5. 本文エリア（開いた状態） --- */
.c-msg-body { 
    padding: 6px 15px 6px 15px !important; 
    background: #fcfdfe; 
    font-size: 0.88rem;
    line-height: 1.9;
    color: #1a3a5a;
}

/* 🔧 修正: #details-p- は不完全なIDセレクター → .c-msg-body に統合済み */

.c-body-text {
    margin-bottom: 3px; 
    cursor: pointer;
}

/* --- 6. 愛の数値エリア：時刻との統合 --- */
.score-area {
    text-align: right;
    margin-top: 8px !important; 
    margin-bottom: 5px;
    line-height: 1;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
}

/* 詳細エリア内の時間：数値の左に寄り添う */
.time-stamp-inline {
    font-size: 0.65em;
    color: #b0c4de;
    font-family: monospace;
}

.score-tag { 
    color: #999 !important; 
    font-size: 0.7em !important; 
    font-weight: 200;
    background: rgba(0, 0, 0, 0.02);
    padding: 2px 6px;
    border-radius: 4px;
}

/* --- 7. 不要な要素の非表示 --- */
.close-hint { 
    display: none !important; 
}

.is-old { display: none !important; }

/* --- village-container (stella_chat.php) 本文エリア縦詰め・フォント縮小 --- */
.village-container .log-display { margin-top: 6px; }
.village-container .log-item { margin-bottom: 2px; font-size: 0.88em; }
.village-container .p-msg-box-preview { padding: 5px 12px 5px 8px; }
.village-container .replies-wrapper summary { padding: 3px 12px 3px 8px !important; }
.village-container .c-msg-body { padding: 4px 12px 4px 12px !important; line-height: 1.65; }
.village-container .score-area { margin-top: 4px !important; margin-bottom: 2px; }
.village-container .c-body-preview { font-size: 0.88rem; }
.village-container .c-name-small { font-size: 0.88rem; }

/* --- 8. レスポンシブ対応 --- */

/* ── タブレット（768px以下）── */
@media (max-width: 768px) {
    .sidebar.open { width: 160px; }
    .sidebar-inner { width: 160px; padding: 10px 6px; }
    .dash-content { padding: 12px; }
    .card { padding: 16px; border-radius: 12px; }
    .header-title { font-size: 1.2em; }
}

/* ── スマホ（480px以下）── */
@media (max-width: 480px) {
    .container { padding: 10px 0 6px !important; width: 100% !important; margin: 0 !important; border-radius: 0 !important; }
    .layout { flex-direction: column; position: relative; }
    .card { padding: 12px; border-radius: 10px; margin-bottom: 10px; }
    .header-wrap { padding: 8px; }
    .header-title { font-size: 1.1em; }
    .title-logo { width: 36px; }
    table { font-size: 0.8em; }
    input, select, textarea { font-size: 0.9em; padding: 8px 10px; }
    .btn { padding: 10px; font-size: 0.9em; }
    .auth-page .card { padding: 1.6em 1.4em 1.8em; }

    .counseling-wrap {
        flex-direction: row !important;
        position: relative;
    }

    .sidebar {
        position: fixed !important;
        top: 0;
        left: -250px;
        height: 100vh !important;
        width: 220px !important;
        z-index: 1000;
        transition: left 0.3s ease;
        overflow-y: auto;
    }

    .sidebar.open {
        left: 0 !important;
        width: 220px !important;
    }

    .chat-area {
        width: 100% !important;
        flex: 1 !important;
        padding-left: 4px !important;
    }
    .chat-log {
        padding: 8px !important;
    }
}


/* --- 9. 管理画面ボタン共通 --- */
.action-btn {
    display: inline-block;
    width: auto;
    padding: 3px 10px;
    font-size: 0.72em;
    font-family: sans-serif;
    border-radius: 10px;
    border: 1px solid #ccc;
    background: #fff;
    color: #666;
    cursor: pointer;
    white-space: nowrap;
    line-height: 1.6;
    transition: opacity 0.2s;
}
.action-btn:hover { opacity: 0.75; }

/* ボタン色バリエーション */
.action-btn-publish { background: #2e7d32; color: #fff; border-color: #2e7d32; }
.action-btn-summary { color: #5b8fa8; border-color: #5b8fa8; }
.action-btn-mcp    { color: #7b5ea8; border-color: #7b5ea8; }
.action-btn-edit   { color: #e07a30; border-color: #e07a30; }
.action-btn-delete { color: #999;    border-color: #ccc; }

/* ボタン群のコンテナ */
.action-btns {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 5px;
    align-items: center;
    justify-content: flex-start;
    margin-top: 10px;
}
.action-btns form {
    display: contents;
}


/* --- 10. 愛の言葉承認ページ (moving_words_approval.php) --- */
.mwa-container { max-width: 900px; margin: 0 auto; padding: 20px; }
.mwa-header { text-align: center; margin-bottom: 30px; }
.mwa-header h2 { color: #1a4a8c; margin: 0; }
.mwa-section { background: #fff; border-radius: 20px; border: 1px solid #ddecff; padding: 20px; margin-bottom: 20px; }
.mwa-section h3 { color: #1a4a8c; margin-top: 0; border-bottom: 1px solid #ddecff; padding-bottom: 10px; }

.moving-words-card {
    background: linear-gradient(135deg, #fffacd, #fff8dc);
    border: 2px solid #ffd700;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 15px;
}
.card-meta {
    font-size: 0.9em;
    color: #b8860b;
    margin-bottom: 10px;
    border-bottom: 1px solid #ffd700;
    padding-bottom: 10px;
}
.card-content {
    background: #fffef0;
    border-radius: 10px;
    padding: 15px;
    margin: 10px 0;
    font-size: 0.95em;
    color: #8b4513;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
}
.login-form {
    background: #f0f7ff;
    border-radius: 15px;
    padding: 20px;
    max-width: 400px;
    margin: 0 auto;
}
.login-form input {
    width: 100%;
    padding: 12px;
    border-radius: 20px;
    border: 1px solid #cce5ff;
    margin-bottom: 15px;
    font-size: 1em;
}
.login-form button {
    width: 100%;
    padding: 12px;
    background: #2a5caa;
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 1em;
    font-weight: bold;
}
.login-form button:hover { background: #1a3a8a; }

.success-msg { background: #e8f5e9; color: #2e7d32; border-radius: 10px; padding: 15px; margin-bottom: 20px; }
.error-msg   { background: #ffebee; color: #c62828; border-radius: 10px; padding: 15px; margin-bottom: 20px; }
.empty-msg   { color: #99abbd; text-align: center; padding: 30px; font-size: 0.9em; }

/* スクロールバー設定 */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-thumb { background: #ddecff; border-radius: 10px; }


/* === 共通フォント・背景設定（全ページ共通） === */
body, .chat-bubble, .chat-meta, .agent-link, .accordion-toggle,
.session-item, .char-count, .chat-form textarea, .chat-form button,
.timer-inline, .page-subtitle, .limit-msg, .chat-log,
.sidebar-inner, p, div, span, a, button, input, textarea {
    font-family: sans-serif !important;
}
h2 { font-family: "Noto Serif JP", serif !important; font-weight: 200; letter-spacing: 0.15em; color: #001f3f; }
i[class^="ti"] { font-family: "tabler-icons" !important; }
body { background-size: 50% auto !important; background-repeat: repeat !important; }

/* === 共通レイアウト（チャット/ダッシュ系ページ） === */
.container { display: flex; flex-direction: column; min-height: 95vh; }
.header-wrap { flex-shrink: 0; margin-bottom: 4px; }
.page-subtitle { font-size: 0.68em; color: #7a8a9a; letter-spacing: 0.15em; margin: 2px 0 0 0; }
.layout { display: flex; flex-direction: row; flex: 1; overflow: hidden; }
.counseling-wrap { display: flex; flex-direction: row; gap: 0.3rem; flex: 1; min-height: 0; }
.chat-area { flex: 1; min-width: 0; display: flex; flex-direction: column; padding-left: 4px; padding-top: 0; margin-top: 0; }
.dash-content { flex: 1; overflow-y: auto; padding: 0 4px 8px; }


/* === love_growth_report.php === */
.page-subtitle { text-align: left; font-size: 0.68em; color: #7a8a9a; letter-spacing: 0.15em; margin: 2px 0 0 0; }
        

        

        

        .dash-card { background: rgba(255,255,255,0.85); border: 1px solid #ddecff; border-radius: 16px; padding: 7px 12px; margin-bottom: 6px; }
        .card-label { font-size: 0.90em; color: #1e50a0; letter-spacing: 0.2em; text-transform: uppercase; margin: 0 0 5px; font-weight: bold; }
        .card-label i { margin-right: 4px; }

        /* Chart containers */
        .chart-wrap { position: relative; width: 100%; }
        .chart-wrap canvas { max-height: 160px; }
        .chart-wrap-radar canvas { max-height: 220px; }

        /* 愛の数値履歴テーブル */
        .history-table { width: 100%; border-collapse: collapse; font-size: 0.78em; }
        .history-table th { color: #99abbd; font-weight: 400; text-align: left; padding: 2px 6px; border-bottom: 1px solid #ddecff; letter-spacing: 0.08em; }
        .history-table td { padding: 3px 6px; border-bottom: 1px solid rgba(42,92,170,0.06); color: #2a3a4a; vertical-align: top; }
        .history-table tr:last-child td { border-bottom: none; }
        .history-table .role-user  { color: #2a5caa; font-size: 0.85em; }
        .history-table .role-agent { color: #3a8040; font-size: 0.85em; }
        .score-chip { display: inline-block; padding: 1px 6px; border-radius: 8px; background: rgba(42,92,170,0.08); color: #2a5caa; font-size: 0.9em; white-space: nowrap; }
        .tag-chip { display: inline-block; padding: 1px 5px; border-radius: 6px; background: rgba(80,160,80,0.09); color: #3a7040; font-size: 0.78em; margin-right: 2px; white-space: nowrap; }

        /* LAS分析 */
        .las-grid { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
        .las-row { display: flex; align-items: center; gap: 8px; }
        .las-bar-wrap { flex: 1; background: rgba(42,92,170,0.08); border-radius: 6px; height: 6px; overflow: hidden; }
        .las-bar { height: 100%; background: linear-gradient(90deg, #2a5caa, #6a9ae0); border-radius: 6px; transition: width 0.6s ease; }
        .las-name { font-size: 0.84em; color: #1a3a5a; width: 80px; flex-shrink: 0; }
        .las-count { font-size: 0.84em; color: #99abbd; width: 24px; text-align: right; flex-shrink: 0; }
        .las-desc-card { margin-top: 6px; padding: 5px 8px; background: rgba(42,92,170,0.05); border-left: 2px solid #2a5caa; border-radius: 0 8px 8px 0; font-size: 0.9375em; color: #1a3a5a; line-height: 1.8; }

        /* 分析文 */
        .analysis-text { font-size: 0.9375em; color: #1a3a5a; line-height: 1.8; white-space: pre-wrap; }
        .analysis-refresh { font-size: 0.7em; color: #99abbd; text-decoration: none; margin-left: 8px; }
        .analysis-refresh:hover { color: #2a5caa; }
        .no-data { font-size: 0.75em; color: #99abbd; padding: 4px 0 2px; margin: 0; }

        /* 統計サマリー */
        .stats-row { display: flex; gap: 6px; margin-bottom: 6px; }
        .stat-box { flex: 1; background: rgba(255,255,255,0.85); border: 1px solid #ddecff; border-radius: 12px; padding: 5px 6px; text-align: center; }
        .stat-value { font-family: Georgia, serif !important; font-size: 1.3em; color: #2a5caa; font-weight: 400; }
        .stat-label { font-size: 0.65em; color: #4a6a9a; margin-top: 1px; letter-spacing: 0.06em; font-weight: 600; }

        

        /* 花 + ステージ表示 */
        .flower-stage-wrap { display: flex; align-items: flex-end; gap: 1rem; padding: 0 4px 4px; margin-top: 0; padding-top: 0; }
        .flower-svg-area { flex-shrink: 0; width: 150px; margin-top: 0; }
        .flower-svg { display: block; }
        .flower-info { flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; padding-bottom: 4px; }
        .flower-stage-name { font-size: 1.0rem; font-weight: bold; color: #4a7298; }
        .flower-stage-desc { font-size: 0.82em; color: #7a9ab8; }
        .flower-word-card {
            font-size: 0.9375em; color: #1a3a5a; line-height: 1.8;
            padding: 5px 0; margin-top: 4px;
        }
        .flower-word-text { display: block; }
        .flower-word-meta { font-size: 0.78em; color: #99abbd; display: block; margin-top: 3px; }


/* === counseling.php === */
/* ゴシック体（style.cssのtextareaと同様） */
        /* ゴシック体（ロゴのh2以外すべて） */
        
        /* ロゴだけ明朝 */
        

        /* 背景を半分サイズに */
        

        /* ページ全体：style.cssに任せてflexレイアウトだけ追加 */
        

        /* ヘッダー */
        
        .header-title { display: flex; align-items: center; gap: 8px; }
        .header-right { position: absolute; right: 0; text-align: right; }
        .timer-inline { font-size: 0.78em; color: #99abbd; font-family: sans-serif; }
        .timer-inline strong { color: #2a5caa; font-size: 1.5em; }
        .timer-inline.warning strong { color: #e07a30; }
        .timer-inline.danger strong { color: #cc3333; }
        .page-subtitle { text-align: center; font-size: 0.68em; color: #7a8a9a; letter-spacing: 0.15em; margin: 2px 0 0 0; font-family: sans-serif; }

        /* メインエリア */
        

        /* チャットエリア */
        .chat-area { flex: 1; min-width: 0; display: flex; flex-direction: column; padding-left: 10px; }

        /* エージェントリンク */
        .agent-grid { display: flex; flex-direction: column; gap: 1px; }
        .agent-link { padding: 5px 4px; font-size: 0.78em; color: #1a4a8c; cursor: pointer; text-decoration: none; display: block; border-radius: 6px; transition: all 0.2s; background: none; border: none; width: 100%; text-align: left; }
        .agent-link:hover { background: #e8f4ff; padding-left: 8px; }
        .agent-link.active { color: #2a5caa; font-weight: bold; }

        /* 会話ログ */
        .chat-log { flex: 1; background: rgba(255,255,255,0.85); border-radius: 20px; border: 1px solid #ddecff; padding: 15px; overflow-y: auto; margin-bottom: 4px; }
        @media (max-width: 480px) {
            .chat-log { padding: 4px !important; }
        }
        .chat-msg { margin-bottom: 6px; }
        .chat-msg.user { text-align: left; }
        .chat-msg.agent { text-align: left; }
        .chat-bubble { display: block; width: 100%; padding: 10px 14px; border-radius: 18px; font-size: 0.88em; line-height: 1.6; word-wrap: break-word; box-sizing: border-box; }
        .chat-msg.user .chat-bubble { background: #2a5caa; color: #fff; border-bottom-left-radius: 4px; text-align: left; }
        .chat-msg.agent .chat-bubble { background: #f0f7ff; color: #1a3a5a; border-bottom-right-radius: 4px; text-align: left; }
        .chat-bubble p { margin: 0 0 4px 0; }
        .chat-bubble br + br { display: none; }
        .chat-meta { font-size: 0.65em; color: #99abbd; margin-top: 4px; font-family: monospace; letter-spacing: -0.02em; }
        .chat-score { font-size: 0.65em; color: #999; font-weight: 200; background: rgba(0,0,0,0.02); padding: 2px 6px; border-radius: 4px; }
        .time-stamp-inline { font-size: 0.75em !important; color: #99abbd; font-family: monospace; }

        /* 入力フォーム（縦並び・ボタン中央） */
        .chat-form { flex-shrink: 0; display: flex; flex-direction: column; gap: 0.3rem; padding-top: 3px; padding-bottom: 0; }
        .chat-form textarea { width: 100%; height: 60px; border-radius: 15px; padding: 10px 14px; border: 1px solid #ddecff; font-family: sans-serif !important; font-size: 0.9em; resize: none; background: rgba(255,255,255,0.9); outline: none; box-sizing: border-box; }
        .chat-form textarea:focus { border-color: #2a5caa; }
        .chat-form-footer { display: flex; justify-content: center; align-items: center; gap: 10px; margin-top: 0; margin-bottom: 0; }
        .chat-form button { height: 32px; padding: 0 20px; border-radius: 16px; background: #2a5caa; color: #fff; border: none; font-size: 0.8em; cursor: pointer; font-family: inherit; }
        .chat-form .end-link { height: 32px; padding: 0 16px; border-radius: 16px; background: transparent; color: #999; border: 1px solid #ddd; font-size: 0.78em; cursor: pointer; text-decoration: none; display: flex; align-items: center; transition: all 0.2s; }
        .chat-form .end-link:hover { background: #fff0f0; color: #cc5555; border-color: #ffaaaa; }
        .chat-form button:hover { background: #1a3a8a; }
        .char-count { font-family: sans-serif !important; font-size: 0.65em; color: #aaa; text-align: right; margin-top: 1px; margin-bottom: 1px; }
        .limit-msg { text-align: center; padding: 15px; color: #e07a30; font-size: 0.9em; background: #fff8f0; border-radius: 12px; border: 1px solid #ffd5b0; flex-shrink: 0; }
        .error-msg { text-align: center; padding: 8px; color: #cc3333; font-size: 0.85em; background: #fff0f0; border-radius: 8px; border: 1px solid #ffcccc; margin-bottom: 8px; flex-shrink: 0; }

        /* 会話履歴 */
        .session-item { padding: 4px 4px; font-size: 0.72em; color: #4a6c8a; text-decoration: none; display: block; border-radius: 6px; transition: all 0.2s; }
        .session-item:hover { background: #e8f4ff; padding-left: 8px; }
        .session-item.active { color: #2a5caa; font-weight: bold; }

        /* リンクのマウスオーバー効果（style.cssに統合済み） */
        a[href*="logout"]:hover { color: #cc5555 !important; }

        .voice-btn {
            background: none;
            border: none;
            cursor: pointer;
            font-size: 0.95em;
            padding: 0 2px;
            opacity: 0.55;
            transition: opacity 0.2s;
            vertical-align: middle;
            line-height: 1;
        }
        .voice-btn:hover { opacity: 1; }
        .voice-btn:disabled { cursor: wait; opacity: 0.3; }
        #micBtn.recording { color: #cc3333; }


/* === stella_chat.php === */
/* stella_chat.php 用スタイル */
        .stella-wrap { 
            display: flex; 
            gap: 0.3rem; 
            flex: 1;
            min-height: 0;
        }

        /* ホバー効果 */
        a.return-link, a.return-link:link, a.return-link:visited { 
            color: #777 !important; 
            transition: color 0.2s, opacity 0.2s !important; 
        }
        a.return-link:hover, a.return-link:focus { 
            color: #2a5caa !important; 
            opacity: 0.8 !important; 
        }
        a[href*="logout"] { transition: color 0.2s; }
        a[href*="logout"]:hover { color: #cc5555 !important; }

        /* 文字はみ出し防止 */
        .stella-wrap { overflow: hidden; }
        .p-msg-box-preview { overflow: hidden; }
        .p-body-preview, .c-body-preview { 
            overflow: hidden; 
            text-overflow: ellipsis;
            white-space: nowrap;
            min-width: 0;
            flex: 1;
        }
        .c-msg-body { line-height: 1.6 !important; }
        .log-display { margin-top: 4px !important; }
        .log-item { margin-bottom: 3px !important; }
        .p-msg-box-preview { padding: 5px 10px 5px 8px !important; }
        .replies-wrapper summary { padding: 4px 10px 4px 8px !important; }
        .replies-wrapper { margin-top: -3px !important; }
        textarea { margin-top: 0 !important; }
        .form-footer { margin-top: 2px !important; }


/* === character_profile.php === */
/* ── love_growth_report.php の既存スタイル（変更なし） ── */
        
        
        

        
        
        
        .page-subtitle { text-align: center; font-size: 0.68em; color: #7a8a9a; letter-spacing: 0.15em; margin: 2px 0 0 0; }
        

        

        

        .dash-card { background: rgba(255,255,255,0.85); border: 1px solid #ddecff; border-radius: 16px; padding: 7px 12px; margin-bottom: 6px; }
        .card-label { font-size: 0.90em; color: #1e50a0; letter-spacing: 0.2em; text-transform: uppercase; margin: 0 0 5px; font-weight: bold; }
        .card-label i { margin-right: 4px; }

        .chart-wrap { position: relative; width: 100%; }
        .chart-wrap canvas { max-height: 160px; }

        .no-data { font-size: 0.75em; color: #99abbd; padding: 4px 0 2px; margin: 0; }

        

        /* ── キャラクタープロフィール追加スタイル ── */
        .agent-grid { display: flex; flex-direction: column; gap: 1px; }
        .agent-link { padding: 5px 4px; font-size: 0.78em; color: #1a4a8c; cursor: pointer; text-decoration: none; display: block; border-radius: 6px; transition: all 0.2s; background: none; border: none; width: 100%; text-align: left; }
        .agent-link:hover { background: #e8f4ff; padding-left: 8px; }
        .agent-link.active { color: #2a5caa; font-weight: bold; }
        .chara-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
        .chara-tab {
            padding: 4px 12px; border-radius: 20px; border: 2px solid #c8dff0;
            background: #fff; color: #7a9ab5; text-decoration: none;
            font-size: 0.80rem; font-weight: 300; transition: all 0.2s;
        }
        .chara-tab:hover { border-color: #4a90d9; color: #4a90d9; }
        .chara-tab.active { border-color: #4a90d9; background: #4a90d9; color: #fff; font-weight: 400; }

        .card {
            background: rgba(255,255,255,0.92); border: 1px solid #ddecff;
            border-radius: 16px; box-shadow: 0 2px 12px rgba(0,0,0,0.06);
            padding: 12px 14px; margin-bottom: 8px;
        }

        .profile-grid { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: start; }
        .chara-image-wrap { display: flex; flex-direction: column; align-items: center; gap: 10px; }
        .chara-image-inner { background: #f0f7ff; border-radius: 12px; padding: 8px; display: inline-block; }

.chara-chat-btn {
            display: inline-flex; align-items: center; justify-content: center; gap: 4px;
            padding: 5px 12px; background: #4a90d9; color: #fff; border-radius: 20px;
            text-decoration: none; font-size: 0.75rem; font-weight: 400;
            transition: opacity 0.2s, transform 0.2s; white-space: nowrap;
        }
        .chara-chat-btn:hover { opacity: 0.85; transform: translateY(-1px); }

        .chara-name { font-size: 1.4rem; color: #1a3a5a; font-weight: 400; margin-bottom: 4px; }
        .chara-catch {
            font-size: 0.82rem; color: #7a9ab5; font-style: italic;
            margin-bottom: 10px; padding-bottom: 8px;
            border-bottom: 1px solid #e8f0f8; line-height: 1.5;
        }
        .info-row { display: flex; gap: 8px; margin-bottom: 8px; align-items: flex-start; }
        .info-label {
            font-size: 0.72rem; color: #fff; background: #4a90d9;
            padding: 2px 8px; border-radius: 10px; white-space: nowrap;
            margin-top: 1px; flex-shrink: 0;
        }
        .info-value { font-size: 0.84rem; color: #4a5a6a; line-height: 1.6; }

        .mana-score {
            display: inline-block; margin-top: 10px; padding: 5px 14px;
            background: #e8f4fd; border-radius: 10px; font-size: 0.82rem; color: #4a90d9;
        }
        .mana-score strong { font-size: 1.2rem; color: #2a70b9; }

        .chart-card-title {
            font-size: 0.88rem; color: #4a90d9; margin-bottom: 12px;
            display: flex; align-items: center; gap: 6px; font-weight: 400;
        }
        .chart-wrap { max-width: 320px; margin: 0 auto; }


/* === about.php === */
.page-subtitle { text-align: left; font-size: 0.68em; color: #7a8a9a; letter-spacing: 0.15em; margin: 2px 0 0 0; }
        

        

        

.card.card-about {
    background: rgba(255,255,255,0.92);
    border: 1px solid #ddecff;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    padding: 1em 1.1em 1.1em;
    margin-bottom: 6px;
}


/* === qa.php === */
.header-wrap { flex-shrink: 0; margin-bottom: 2px; }
        .page-subtitle { text-align: left; font-size: 0.68em; color: #7a8a9a; letter-spacing: 0.15em; margin: 2px 0 0 0; }
        
        
        

        .qa-section { margin-bottom: 20px; }
        .qa-section:first-child { margin-top: 12px; }
        .qa-section-title { font-size: 1em; color: #4a90d9; margin-bottom: 4px; margin-top: 2px; display: flex; align-items: center; gap: 8px; border-bottom: 1px solid #e8eef5; padding-bottom: 4px; }
        .qa-item { background: rgba(255,255,255,0.92); border: 1px solid #ddecff; border-radius: 16px; box-shadow: 0 2px 12px rgba(0,0,0,0.06); margin-bottom: 2px; overflow: hidden; }
        .qa-question { background: transparent; padding: 6px 14px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; font-size: 0.9em; color: #2a6aaa; font-weight: bold; user-select: none; }
        .qa-question:hover { background: #f4f8fc; }
        .qa-arrow { font-size: 0.75em; color: #99abbd; transition: transform 0.2s; }
        .qa-answer { display: none; background: #f8fafc; padding: 10px 14px; font-size: 0.9em; color: #4a5a6a; line-height: 1.6; border-top: 1px solid #e8eef5; margin: 0 0 8px 0; }
        .qa-answer.open { display: block; }
        .qa-arrow.open { transform: rotate(180deg); }


/* === 認証ページ共通（join / register / login） ===
   body は .auth-page でスコープ済み */

/* グローバルの body { background-size: 50% auto !important } を上書き */
.auth-page body {
    background-size: cover !important;
    background-repeat: no-repeat !important;
}

/* --- join.php --- */
.auth-page *, *::before, *::after { box-sizing: border-box; }

        .auth-page body {
            margin: 0; padding: 0;
            background: linear-gradient(180deg, #ffffff 0%, #ffffff 40%, #cce6ff 100%);
            background-attachment: fixed;
            color: #001f3f;
            min-height: 100vh;
            display: flex; justify-content: center; align-items: center;
            font-family: "Noto Sans JP", sans-serif;
            padding: 16px;
        }

        .content {
            animation: wakeUp 1.8s ease-out;
            width: 100%; max-width: 420px;
            text-align: center;
        }

        .header-wrap {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
            margin-bottom: 16px;
        }
        .title-logo { width: 52px; height: auto; mix-blend-mode: multiply; }
        .header-text { text-align: left; }
        .header-title {
            font-family: "Noto Serif JP", serif;
            font-size: 1.3em;
            color: #001f3f;
            letter-spacing: 0.15em;
            margin: 0;
            font-weight: 400;
        }
        .page-subtitle {
            font-size: 0.68em;
            color: #99abbd;
            letter-spacing: 0.15em;
            margin: 2px 0 0 0;
            font-family: "Noto Sans JP", sans-serif;
            text-align: center;
        }

        .card {
            background: rgba(255,255,255,0.75);
            backdrop-filter: blur(8px);
            border-radius: 20px;
            padding: 8px 12px 12px;
            box-shadow: 0 8px 30px rgba(0,31,63,0.1);
        }

        .counter { text-align: right; font-size: 0.75em; color: #99abbd; margin-top: 0; margin-bottom: 8px; }

        .form-group { margin-bottom: 10px; text-align: left; }
        .form-group label {
            display: block; font-size: 0.82em;
            color: #1a56a6; letter-spacing: 0.05em; margin-bottom: 0.4em;
            font-family: "Noto Sans JP", sans-serif;
        }
        .form-group select,
        .form-group input[type="date"],
        .form-group input[type="text"],
        .form-group input[type="email"],
        .form-group textarea {
            width: 100%;
            padding: 8px 12px;
            border: 1px solid #c0d8f0;
            border-radius: 10px;
            font-family: "Noto Sans JP", sans-serif;
            font-size: 0.95em; color: #001f3f;
            background: rgba(255,255,255,0.9);
            outline: none;
            transition: border-color 0.3s, box-shadow 0.3s;
        }
        .form-group input:focus, .form-group textarea:focus {
            border-color: #2a5caa;
            box-shadow: 0 0 0 3px rgba(42,92,170,0.12);
        }
        .form-group textarea { resize: vertical; line-height: 1.6; }

        .check-group { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 10px; text-align: left; }
        .check-group input[type="checkbox"] { margin-top: 3px; flex-shrink: 0; }
        .check-group label { font-size: 0.82em; color: #556677; line-height: 1.6; font-family: "Noto Sans JP", sans-serif; text-align: left; }

        .submit-btn {
            display: inline-block;
            width: auto;
            min-width: 160px;
            padding: 10px 32px;
            background: #2a5caa;
            color: #ffffff;
            border: none; border-radius: 40px;
            font-family: "Noto Sans JP", sans-serif;
            font-size: 0.95em; letter-spacing: 0.2em;
            cursor: pointer;
            margin-top: 1.4em;
            box-shadow: 0 4px 14px rgba(0,31,63,0.18);
            transition: background 0.3s, transform 0.2s, box-shadow 0.3s;
        }
        .submit-btn:hover {
            background: #003366;
            transform: translateY(-2px);
            box-shadow: 0 8px 20px rgba(0,31,63,0.3);
        }
        .submit-btn:active { transform: translateY(0); }

        .msg-error, .msg-success {
            padding: 10px 14px;
            border-radius: 10px;
            font-size: 0.88em;
            margin-bottom: 1.2em;
            text-align: left;
            line-height: 1.6;
            font-family: "Noto Sans JP", sans-serif;
        }
        .msg-error   { background: #fff0f0; color: #c0392b; border: 1px solid #f5c6cb; }
        .msg-success { background: #f0f7ff; color: #1a56a6; border: 1px solid #b8d9f5; }

        .full-notice { padding: 2em 0; color: #7a9ab5; font-size: 0.9em; line-height: 1.8; }

        .link-area { margin-top: 1.4em; font-size: 0.85em; color: #1a56a6; font-family: "Noto Sans JP", sans-serif; }
        .link-area a { color: #2a5caa; text-decoration: none; border-bottom: 1px solid #b8d9f5; }
        .link-area a:hover { border-color: #2a5caa; }

        @keyframes wakeUp {
            0%   { opacity: 0; transform: scale(0.98) translateY(8px); }
            100% { opacity: 1; transform: scale(1)    translateY(0);   }
        }

/* --- register.php --- */
.auth-page *, *::before, *::after { box-sizing: border-box; }

        .auth-page body {
            margin: 0; padding: 0;
            background: linear-gradient(180deg, #ffffff 0%, #ffffff 40%, #cce6ff 100%);
            background-attachment: fixed;
            color: #001f3f;
            min-height: 100vh;
            display: flex; justify-content: center; align-items: center;
            font-family: "Noto Sans JP", sans-serif;
            padding: 16px;
        }

        .content {
            animation: wakeUp 1.8s ease-out;
            width: 100%; max-width: 420px;
            text-align: center;
        }

        /* ── ヘッダー（counseling.phpと同じ中央揃え） ── */
        .header-wrap {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
            margin-bottom: 16px;
        }
        .title-logo {
            width: 52px;
            height: auto;
            mix-blend-mode: multiply;
        }
        .header-text { text-align: center; }
        .header-title {
            font-family: "Noto Serif JP", serif;
            font-size: 1.3em;
            color: #001f3f;
            letter-spacing: 0.15em;
            margin: 0;
            font-weight: 400;
        }
        .page-subtitle {
            font-size: 0.68em;
            color: #99abbd;
            letter-spacing: 0.15em;
            margin: 2px 0 0 0;
            font-family: "Noto Sans JP", sans-serif;
        }

        /* ── カード ── */
        .card {
            background: rgba(255,255,255,0.75);
            backdrop-filter: blur(8px);
            border-radius: 20px;
            padding: 8px 12px 12px;
            box-shadow: 0 8px 30px rgba(0,31,63,0.1);
        }

        .form-group { margin-bottom: 10px; text-align: left; }
        label {
            display: block; font-size: 0.82em;
            color: #1a56a6; letter-spacing: 0.05em; margin-bottom: 0.4em;
            font-family: "Noto Sans JP", sans-serif;
        }
        input[type="email"],
        input[type="text"],
        input[type="password"] {
            width: 100%;
            padding: 8px 12px;
            border: 1px solid #c0d8f0;
            border-radius: 10px;
            font-family: "Noto Sans JP", sans-serif;
            font-size: 0.95em; color: #001f3f;
            background: rgba(255,255,255,0.9);
            outline: none;
            transition: border-color 0.3s, box-shadow 0.3s;
        }
        input:focus {
            border-color: #2a5caa;
            box-shadow: 0 0 0 3px rgba(42,92,170,0.12);
        }
        select,
        input[type="date"] {
            width: 100%;
            padding: 8px 12px;
            border: 1px solid #c0d8f0;
            border-radius: 10px;
            font-family: "Noto Sans JP", sans-serif;
            font-size: 0.95em; color: #001f3f;
            background: rgba(255,255,255,0.9);
            outline: none;
            transition: border-color 0.3s, box-shadow 0.3s;
        }
        select:focus, input[type="date"]:focus {
            border-color: #2a5caa;
            box-shadow: 0 0 0 3px rgba(42,92,170,0.12);
        }

        /* ── 登録ボタン（小さめ） ── */
        .submit-btn {
            display: inline-block;
            width: auto;
            min-width: 160px;
            padding: 10px 32px;
            background: #2a5caa;
            color: #ffffff;
            border: none; border-radius: 40px;
            font-family: "Noto Sans JP", sans-serif;
            font-size: 0.95em; letter-spacing: 0.2em;
            cursor: pointer;
            margin-top: 1.4em;
            box-shadow: 0 4px 14px rgba(0,31,63,0.18);
            transition: background 0.3s, transform 0.2s, box-shadow 0.3s;
        }
        .submit-btn:hover {
            background: #003366;
            transform: translateY(-2px);
            box-shadow: 0 8px 20px rgba(0,31,63,0.3);
        }
        .submit-btn:active { transform: translateY(0); }

        .msg-error, .msg-success {
            padding: 10px 14px;
            border-radius: 10px;
            font-size: 0.88em;
            margin-bottom: 1.2em;
            text-align: left;
            line-height: 1.6;
            font-family: "Noto Sans JP", sans-serif;
        }
        .msg-error   { background: #fff0f0; color: #c0392b; border: 1px solid #f5c6cb; }
        .msg-success { background: #f0f7ff; color: #1a56a6; border: 1px solid #b8d9f5; }

        .link-area { margin-top: 1.4em; font-size: 0.85em; color: #1a56a6; font-family: "Noto Sans JP", sans-serif; }
        .link-area a { color: #2a5caa; text-decoration: none; border-bottom: 1px solid #b8d9f5; }
        .link-area a:hover { border-color: #2a5caa; }

        @keyframes wakeUp {
            0%   { opacity: 0; transform: scale(0.98) translateY(8px); }
            100% { opacity: 1; transform: scale(1)    translateY(0);   }
        }

/* --- login.php --- */
.auth-page *, *::before, *::after { box-sizing: border-box; }
        .auth-page body, .card, .form-group, label, input, button, div, span, p, a {
            font-family: sans-serif !important;
        }
        h2 { font-family: "Noto Serif JP", serif !important; }
        .auth-page body {
            margin: 0; padding: 0;
            background: linear-gradient(180deg, #ffffff 0%, #ffffff 40%, #cce6ff 100%);
            background-attachment: fixed;
            color: #001f3f;
            min-height: 100vh;
            display: flex; justify-content: center; align-items: flex-start;
            padding: 0.8em 1em;
        }
        .content {
            animation: wakeUp 1.8s ease-out;
            width: 100%; max-width: 420px;
            text-align: center;
        }
        .header-wrap {
            display: flex;
            justify-content: center;
            align-items: center;
            margin-top: 0.5em;
            margin-bottom: 4px;
            width: 100%;
            min-height: 50px;
        }
        .title-logo {
            width: 55px; height: auto;
            mix-blend-mode: multiply;
            margin-left: 10px;
        }
        h2 {
            font-family: "Noto Serif JP", serif;
            font-weight: 200;
            letter-spacing: 0.15em;
            color: #001f3f;
            font-size: 1.3em;
            margin: 0;
        }
        .card {
            background: rgba(255,255,255,0.75);
            backdrop-filter: blur(8px);
            border-radius: 20px;
            padding: 2em 2.2em 2.2em;
            box-shadow: 0 8px 30px rgba(0,31,63,0.1);
        }
        .form-group { margin-bottom: 1.2em; text-align: left; }
        label {
            display: block; font-size: 0.82em;
            color: #1a56a6; letter-spacing: 0.05em; margin-bottom: 0.4em;
        }
        input[type="email"],
        input[type="password"] {
            width: 100%;
            padding: 10px 14px;
            border: 1px solid #c0d8f0;
            border-radius: 10px;
            font-size: 0.95em; color: #001f3f;
            background: rgba(255,255,255,0.9);
            outline: none;
            transition: border-color 0.3s, box-shadow 0.3s;
        }
        input:focus {
            border-color: #2a5caa;
            box-shadow: 0 0 0 3px rgba(42,92,170,0.12);
        }
        .submit-btn {
            display: inline-block;
            width: auto;
            min-width: 160px;
            padding: 10px 32px;
            background: #2a5caa;
            color: #ffffff;
            border: none; border-radius: 40px;
            font-size: 0.95em; letter-spacing: 0.2em;
            cursor: pointer;
            margin-top: 1.4em;
            box-shadow: 0 4px 14px rgba(0,31,63,0.18);
            transition: background 0.3s, transform 0.2s, box-shadow 0.3s;
        }
        .submit-btn:hover {
            background: #003366;
            transform: translateY(-2px);
            box-shadow: 0 8px 20px rgba(0,31,63,0.3);
        }
        .msg-error {
            padding: 10px 14px;
            border-radius: 10px;
            background: #fff0f0; color: #c0392b; border: 1px solid #f5c6cb;
            font-size: 0.88em; margin-bottom: 1.2em; text-align: left; line-height: 1.6;
        }
        .msg-success {
            padding: 10px 14px;
            border-radius: 10px;
            background: #f0fff4; color: #1a7a40; border: 1px solid #b2dfcc;
            font-size: 0.88em; margin-bottom: 1.2em; text-align: left; line-height: 1.6;
        }
        .link-area { margin-top: 1.4em; font-size: 0.85em; color: #1a56a6; }
        .link-area a { color: #2a5caa; text-decoration: none; border-bottom: 1px solid #b8d9f5; }
        .link-area a:hover { border-color: #2a5caa; }
        @keyframes wakeUp {
            0%   { opacity: 0; transform: scale(0.98) translateY(8px); }
            100% { opacity: 1; transform: scale(1)    translateY(0);   }
        }


/* === admin.php（すべて .admin-wrap にスコープ） === */
.admin-wrap { width: 100%; margin: 0 auto; }

.admin-wrap .section { background: #fff; border-radius: 20px; border: 1px solid #ddecff; padding: 10px 14px; margin-bottom: 8px; }
.admin-wrap .section h3 { color: #1a4a8c; font-size: 0.92em; margin-bottom: 8px; border-bottom: 1px solid #ddecff; padding-bottom: 6px; font-family: sans-serif; }

.admin-wrap .badge          { display: inline-block; background: #e8f4ff; color: #2a5caa; border-radius: 10px; padding: 1px 8px; font-size: 0.75em; margin-left: 6px; }
.admin-wrap .badge.pending  { background: #fff3e0; color: #e07a30; }
.admin-wrap .badge.approved { background: #e8f5e9; color: #2e7d32; }

.admin-wrap .summary-card  { background: #f8fbff; border-radius: 15px; border: 1px solid #ddecff; padding: 15px; margin-bottom: 12px; }
.admin-wrap .summary-meta  { font-size: 0.72em; color: #99abbd; margin-bottom: 8px; font-family: monospace; }
.admin-wrap .summary-text  { font-size: 0.88em; color: #1a3a5a; line-height: 1.6; margin-bottom: 12px; white-space: pre-wrap; }
.admin-wrap .summary-score { font-size: 0.75em; color: #2a5caa; font-weight: bold; margin-bottom: 10px; }

.admin-wrap .btn-approve       { background: #2a5caa; color: #fff; border: none; border-radius: 20px; padding: 6px 18px; cursor: pointer; font-size: 0.82em; font-family: sans-serif; }
.admin-wrap .btn-reject        { background: #f5f5f5; color: #999; border: 1px solid #ddd; border-radius: 20px; padding: 6px 18px; cursor: pointer; font-size: 0.82em; font-family: sans-serif; }
.admin-wrap .btn-approve:hover { background: #1a3a8a; }

.admin-wrap table       { width: 100%; border-collapse: collapse; font-size: 0.82em; font-family: sans-serif; }
.admin-wrap th          { background: #f0f7ff; color: #4a6c8a; padding: 5px 8px; text-align: left; border-bottom: 1px solid #ddecff; }
.admin-wrap td          { padding: 5px 8px; border-bottom: 1px solid #f0f7ff; color: #1a3a5a; }
.admin-wrap tr:hover td { background: #f8fbff; }

.admin-wrap .table-responsive               { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.admin-wrap .table-responsive table         { width: 100%; min-width: 580px; }

.admin-wrap .link-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
}
@media (max-width: 640px) {
    .admin-wrap .link-grid { grid-template-columns: 1fr; }
}
.admin-wrap .link-card {
    display: block;
    background: none; border: none; border-radius: 0;
    padding: 4px 0; text-decoration: none; color: #2a5caa;
    font-size: 0.88em; border-bottom: 1px solid #f0f7ff;
    transition: color 0.2s, padding-left 0.2s; font-family: sans-serif;
}
.admin-wrap .link-card:hover       { color: #1a3a8a; padding-left: 6px; }
.admin-wrap .link-card .link-title { font-weight: 500; }
.admin-wrap .link-card .link-desc  { font-size: 0.8em; color: #99abbd; }

.admin-wrap .accordion-header       { display: flex; justify-content: space-between; align-items: center; cursor: pointer; padding: 4px 0; user-select: none; }
.admin-wrap .accordion-header:hover { opacity: 0.8; }
.admin-wrap .accordion-arrow        { font-size: 0.8em; color: #99abbd; transition: transform 0.2s; }
.admin-wrap .accordion-arrow.open   { transform: rotate(180deg); }
.admin-wrap .accordion-body         { display: none; margin-top: 8px; }
.admin-wrap .accordion-body.open    { display: block; }

.admin-wrap .success-msg { padding: 7px 12px; margin-bottom: 10px; font-size: 0.85em; font-family: sans-serif; }
.admin-wrap .empty-msg   { padding: 12px; font-size: 0.85em; font-family: sans-serif; }
.admin-wrap .llm-table   { font-size: 0.76em; }

/* admin.php コンテナの左右余白（他ページの .container に影響しない） */
.admin-container {
    padding-left: 10px;
    padding-right: 10px;
}
@media (max-width: 640px) {
    .admin-container {
        padding-left: 8px;
        padding-right: 8px;
    }
}

/* beautiful_words_ardrive.php 専用コンテナ */
.ardrive-container {
    max-width: 680px;
    padding-left: 10px;
    padding-right: 10px;
}
@media (max-width: 640px) {
    .ardrive-container {
        padding-left: 8px;
        padding-right: 8px;
    }
}

/* moving_words_approval.php & beautiful_words_approval.php 専用コンテナ */
.love-approval-container,
.beautiful-approval-container {
    max-width: 680px;
    padding-left: 10px;
    padding-right: 10px;
}
@media (max-width: 640px) {
    .love-approval-container,
    .beautiful-approval-container {
        padding-left: 8px;
        padding-right: 8px;
    }
}

/* moving_words_approval.php モバイル横幅改善（≤640px） */
@media (max-width: 640px) {
    .love-approval-container .chat-area {
        padding-left: 0;
    }
    .love-approval-container .dash-content {
        padding: 0;
    }
    .love-approval-container .section {
        padding: 10px;
    }
    .love-approval-container .moving-words-card {
        padding: 12px;
    }
    .love-approval-container .card-content {
        padding: 10px;
    }
}

/* admin/bw_view.php 専用コンテナ */
.bw-view-container {
    max-width: 680px;
    padding-left: 10px;
    padding-right: 10px;
}
@media (max-width: 640px) {
    .bw-view-container {
        padding-left: 8px;
        padding-right: 8px;
    }
    .bw-view-container .chat-area {
        padding-left: 0;
    }
    .bw-view-container .dash-content {
        padding: 0;
    }
    .bw-view-container .section {
        padding: 10px;
    }
    .bw-view-container .section h3,
    .bw-view-container .file-meta {
        overflow-wrap: anywhere;
        word-break: break-word;
    }
}

/* ─── password show/hide toggle ─── */
.password-wrap {
    position: relative;
}
.password-wrap input {
    padding-right: 44px !important;
    box-sizing: border-box;
    width: 100%;
}
.password-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    cursor: pointer;
    color: #6b8aa0;
    font-size: 1.1em;
    padding: 0;
    display: flex;
    align-items: center;
    line-height: 1;
}
.password-toggle:focus { outline: none; }
.password-toggle:focus-visible {
    outline: 2px solid #8bb9d6;
    outline-offset: 2px;
    border-radius: 4px;
}

/* お問い合わせカード（about.php） */
.card.card-compact {
    padding: 10px 12px 8px !important;
}

/* ── お問い合わせカード (about.php #contact) ── */
#contact h3 {
    font-size: 1em;
    color: #4a90d9;
    margin-bottom: 6px;
    margin-top: 4px;
}
#contact > p {
    font-size: 0.9em;
    color: #4a5a6a;
    line-height: 1.6;
    margin-bottom: 8px;
}
.contact-success {
    color: #2e7d32;
    font-size: 0.9em;
    padding: 12px;
    background: #e8f5e9;
    border-radius: 8px;
}
.contact-error {
    color: #cc3333;
    font-size: 0.85em;
    margin-bottom: 12px;
}
#contact .accordion-inner p {
    font-size: 0.9em;
    color: #1a3a5c;
    line-height: 1.85;
    margin-bottom: 0.8em;
}
#contact form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
#contact input[type="text"],
#contact input[type="email"],
#contact textarea {
    padding: 10px 14px;
    border: 1px solid #c8dff0;
    border-radius: 8px;
    font-size: 0.9em;
    color: #2a3a4a;
    outline: none;
}
#contact textarea {
    resize: vertical;
    line-height: 1.6;
}
#contact button[type="submit"] {
    padding: 10px 24px;
    background: #4a90d9;
    color: #fff;
    border: none;
    border-radius: 20px;
    font-size: 0.9em;
    cursor: pointer;
    align-self: flex-start;
    transition: opacity 0.2s;
}

/* === about.php 全カード共通 === */
#how-to-use h3, #privacy h3, #terms h3,
.card:not(#contact) h3 {
    font-size: 1em;
    color: #4a90d9;
    margin-bottom: 6px;
    margin-top: 4px;
}
.card:not(#contact) p {
    font-size: 0.9em;
    color: #4a5a6a;
    line-height: 1.7;
    margin: 0 0 8px 0;
}
.terms-p {
    font-size: 0.8em;
    color: #4a5a6a;
    line-height: 1.7;
    margin-bottom: 6px;
}
/* ロゴ保護 */
.title-logo {
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
}
