/* --- CSS変数定義 --- */
:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f0f2f5;
    --bg-tertiary: #fdfdfd;
    --bg-tertiary-rgb: 253, 253, 253;
    --bg-input: #ffffff;
    --bg-user-message: #dcf8c6;
    --bg-model-message: #e5e5ea;
    --bg-system-message: #f0f8ff;
    --bg-error-message: #ffebee;
    --cryscroller-scroll-width: 30px;
    --bg-button: #4a90e2;
    --bg-button-rgb: 74, 144, 226;
    --bg-button-hover: #357abd;
    --bg-button-disabled: #a0c3e8;
    --bg-button-action: #777777;
    --bg-button-action-hover: #555555;
    --bg-button-delete: #e53935;
    --bg-button-delete-hover: #c62828;
    --bg-button-retry: #43a047;
    --bg-button-retry-hover: #2e7d32;
    --bg-button-edit: #ff9800;
    --bg-button-edit-hover: #f57c00;
    --bg-button-copy: #e91e63;
    --bg-button-copy-hover: #c2185b;
    --bg-button-paste: #00bcd4;
    --bg-button-paste-hover: #0097a7;
    --bg-button-duplicate: #546e7a;
    --bg-button-duplicate-hover: #37474f;
    --bg-button-export: #1e88e5;
    --bg-button-export-hover: #1565c0;
    --bg-button-save: #30d158;
    --bg-button-save-hover: #24a345;
    --bg-button-cancel: #f44336;
    --bg-button-cancel-hover: #d32f2f;
    --bg-button-update: #1976d2;
    --bg-button-update-hover: #115293;
    --bg-header: #4a90e2;
    --overlay-base-rgb: 255, 255, 255;
    --chat-overlay-alpha: 0.65;
    --bg-cascade-button: var(--bg-button-action);
    --bg-cascade-button-hover: var(--bg-button-action-hover);
    --bg-cascade-delete-button: var(--bg-button-delete);
    --bg-cascade-delete-button-hover: var(--bg-button-delete-hover);
    --text-cascade-indicator: var(--text-secondary);
    --bg-button-header-delete: #e53935;
    --bg-button-header-delete-hover: #c62828;
    --bg-button-header-copy: #e91e63;
    --bg-button-header-copy-hover: #c2185b;
    --bg-code-copy-button: var(--bg-button-action);
    --bg-code-copy-button-hover: var(--bg-button-action-hover);
    --text-code-copy-button: var(--text-light);

    --text-primary: #333333;
    --text-secondary: #777777;
    --text-light: #ffffff;
    --text-disabled: #e0e0e0;
    --text-error: #c62828;
    --text-link: #4a90e2;
    --text-placeholder: #999999;
    --text-system: #555;
    --text-memo: #000000;
    --bg-memo: #ffffff;

    --border-primary: #cccccc;
    --border-secondary: #dddddd;
    --border-tertiary: #eeeeee;
    --border-danger: #ffcdd2;
    --border-system: #add8e6;

    --shadow-primary: rgba(0, 0, 0, 0.1);
    --shadow-secondary: rgba(0, 0, 0, 0.1);

    --message-max-width: 85%;
    --font-family:
        -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --message-body-font-size: 14px;
    --code-block-font-size: 13px;
    --chat-background-image: none;
    --history-background-image: none;
    --settings-background-image: none;

    --bg-dialog-file-item: var(--bg-tertiary);

    --border-dialog-file-item: var(--border-secondary);
    --text-dialog-file-name: var(--text-primary);
    --text-dialog-file-size: var(--text-secondary);
    --bg-dialog-button-select: var(--bg-button-action);
    --bg-dialog-button-select-hover: var(--bg-button-action-hover);
    --bg-dialog-button-confirm: var(--bg-button-save);
    --bg-dialog-button-confirm-hover: var(--bg-button-save-hover);
    --bg-dialog-button-cancel: var(--bg-button-cancel);
    --bg-dialog-button-cancel-hover: var(--bg-button-cancel-hover);

    --bg-attachment-details: rgba(0, 0, 0, 0.03);
    --border-attachment-details: var(--border-tertiary);
    --text-attachment-summary: var(--text-secondary);
    --text-attachment-filename: var(--text-primary);

    --badge-color: #ffcc00;
    --badge-size: 12px;

    --memo-height: 300px;
    --clipboard-stack-height: 300px;
    --message-icon-size: 28px;
    --message-icon-offset-y: -10px;
    --icon-name-font-size: 10px;
    --icon-name-offset-y: -10px;

    --bg-toggle-button: var(--bg-button-action);
    --bg-toggle-button-hover: var(--bg-button-action-hover);
    --text-toggle-button: var(--text-light);

    --message-bubble-opacity: 1;
    --header-footer-opacity: 1;

    --bg-button-gold: #ffd700;
    --bg-button-gold-hover: #ffc700;
    --text-button-gold: #ffffff;
    --bg-button-purple: #800080;
    --bg-button-purple-hover: #6a006a;
    --text-button-purple: #ffffff;

    --message-toggle-button-top-width: 6px;
    --message-toggle-button-top-height: 40px;
    --message-toggle-button-top-font-size: 12px;
    --message-toggle-button-top-opacity: 0.6;
    --message-toggle-button-top-text-collapse: '-';
    --message-toggle-button-top-text-expand: '□';

    --message-toggle-button-bottom-font-size: 14px;
    --message-toggle-button-bottom-text-collapse: '非表示';
    --message-toggle-button-bottom-text-expand: '表示';

    --message-actions-base-rgb: 255, 255, 255;
    --message-actions-bg-opacity: 0.8;

    --user-name-bubble-bg: transparent;
    --ai-name-bubble-bg: transparent;
    --user-name-bubble-padding-y: 2px;
    --user-name-bubble-padding-x-ratio: 0.5;
    --user-name-bubble-border-radius: 5px;
    --ai-name-bubble-padding-y: 2px;
    --ai-name-bubble-padding-x-ratio: 0.5;
    --ai-name-bubble-border-radius: 5px;
    --default-user-name-bubble-custom-rgb: 255, 255, 255;
    --default-ai-name-bubble-custom-rgb: 255, 255, 255;

    --thought-summary-opacity: 0.85;
    --thought-summary-font-size: 13px;

    --elevation-shadow-1: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.1);
    --elevation-shadow-2: 0 3px 6px rgba(0, 0, 0, 0.12), 0 3px 6px rgba(0, 0, 0, 0.15);
    --elevation-shadow-3: 0 10px 20px rgba(0, 0, 0, 0.15), 0 6px 6px rgba(0, 0, 0, 0.18);
    --elevation-shadow-inset: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);

    --settings-ui-scale: 1;
    --history-ui-scale: 1;
    --chat-ui-scale: 1;
}

/* --- テーマ別カラー定義 --- */
body.dark-mode {
    --bg-primary: #1a1a1a;
    --bg-secondary: #101010;
    --bg-tertiary: #252525;
    --bg-tertiary-rgb: 37, 37, 37;
    --bg-input: #303030;
    --bg-user-message: #056162;
    --bg-model-message: #3a3a3c;
    --bg-system-message: #2a3a4a;
    --bg-error-message: #5c1c1c;
    --bg-button: #007aff;
    --bg-button-rgb: 0, 122, 255;
    --bg-button-hover: #005ecb;
    --bg-button-disabled: #4a5a70;
    --bg-button-action: #666666;
    --bg-button-action-hover: #888888;
    --bg-button-delete: #ff3b30;
    --bg-button-delete-hover: #d12c23;
    --bg-button-retry: #34c759;
    --bg-button-retry-hover: #249a41;
    --bg-button-edit: #ff9500;
    --bg-button-edit-hover: #d17d00;
    --bg-button-copy: #f06292;
    --bg-button-copy-hover: #ec407a;
    --bg-button-paste: #4dd0e1;
    --bg-button-paste-hover: #26c6da;
    --bg-button-duplicate: #8e8e93;
    --bg-button-duplicate-hover: #6b6b70;
    --bg-button-export: #0a84ff;
    --bg-button-export-hover: #0069d1;
    --bg-button-save: #30d158;
    --bg-button-save-hover: #24a345;
    --bg-button-cancel: #ff453a;
    --bg-button-cancel-hover: #d1332b;
    --bg-button-update: #0a84ff;
    --bg-button-update-hover: #0069d1;
    --bg-header: #007aff;
    --overlay-base-rgb: 30, 30, 30;
    --bg-memo: #2c2c2e;
    --bg-cascade-button: var(--bg-button-action);
    --bg-cascade-button-hover: var(--bg-button-action-hover);
    --bg-cascade-delete-button: var(--bg-button-delete);
    --bg-cascade-delete-button-hover: var(--bg-button-delete-hover);
    --text-cascade-indicator: var(--text-secondary);
    --bg-button-header-delete: var(--bg-button-delete);
    --bg-button-header-delete-hover: var(--bg-button-delete-hover);
    --bg-button-header-copy: var(--bg-button-copy);
    --bg-button-header-copy-hover: var(--bg-button-copy-hover);
    --bg-code-copy-button: var(--bg-button-action);
    --bg-code-copy-button-hover: var(--bg-button-action-hover);
    --text-code-copy-button: var(--text-light);

    --text-primary: #e0e0e0;
    --text-secondary: #aaaaaa;
    --text-light: #ffffff;
    --text-disabled: #666666;
    --text-error: #ff8a80;
    --text-link: #00aaff;
    --text-placeholder: #777777;
    --text-system: #ccc;
    --text-memo: #e0e0e0;

    --border-primary: #444444;
    --border-secondary: #555555;
    --border-tertiary: #333333;
    --border-danger: #7a2e35;
    --border-system: #4682b4;

    --shadow-primary: rgba(255, 255, 255, 0.1);
    --shadow-secondary: rgba(0, 0, 0, 0.5);

    --bg-toggle-button: var(--bg-button-action);
    --bg-toggle-button-hover: var(--bg-button-action-hover);
    --text-toggle-button: var(--text-light);

    --bg-button-gold: #b8860b;
    --bg-button-gold-hover: #daa520;
    --text-button-gold: #ffffff;
    --bg-button-purple: #6a0dad;
    --bg-button-purple-hover: #8a2be2;
    --text-button-purple: #ffffff;

    --message-actions-base-rgb: 50, 50, 50;
    --default-user-name-bubble-custom-rgb: 50, 50, 50;
    --default-ai-name-bubble-custom-rgb: 50, 50, 50;

    --elevation-shadow-1: 0 1px 2px rgba(0, 0, 0, 0.3), 0 2px 4px rgba(0, 0, 0, 0.4);
    --elevation-shadow-2: 0 4px 8px rgba(0, 0, 0, 0.4), 0 4px 8px rgba(0, 0, 0, 0.5);
    --elevation-shadow-3: 0 12px 24px rgba(0, 0, 0, 0.5), 0 8px 8px rgba(0, 0, 0, 0.6);
    --elevation-shadow-inset: inset 0 2px 4px 0 rgba(0, 0, 0, 0.2);
}

body.pastel-pink-mode {
    --bg-primary: #fff5f8;
    --bg-secondary: #ffe6ea;
    --bg-tertiary: #fff0f3;
    --bg-tertiary-rgb: 255, 240, 243;
    --bg-input: #ffffff;
    --bg-user-message: #ffddee;
    --bg-model-message: #f3e8ff;
    --bg-system-message: #ffeef2;
    --bg-error-message: #ffccd5;
    --bg-button: #ff8fab;
    --bg-button-rgb: 255, 143, 171;
    --bg-button-hover: #ff7096;
    --bg-button-disabled: #fcc2d7;
    --bg-button-action: #ffb3c1;
    --bg-button-action-hover: #ffa8b9;
    --bg-button-delete: #ff6b6b;
    --bg-button-delete-hover: #f06060;
    --bg-button-retry: #a0eade;
    --bg-button-retry-hover: #88d8c0;
    --bg-button-edit: #ffc974;
    --bg-button-edit-hover: #ffbd59;
    --bg-button-copy: #e5a9f0;
    --bg-button-copy-hover: #d998e3;
    --bg-button-paste: #b2e0ff;
    --bg-button-paste-hover: #a1d5f7;
    --bg-button-duplicate: #ffdaab;
    --bg-button-duplicate-hover: #ffce96;
    --bg-button-export: #c8a2c8;
    --bg-button-export-hover: #b991b9;
    --bg-button-save: #90ee90;
    --bg-button-save-hover: #78dd78;
    --bg-button-cancel: #ff9aa2;
    --bg-button-cancel-hover: #ff868e;
    --bg-button-update: #ff9a8b;
    --bg-button-update-hover: #ff8773;
    --bg-header: #ff8fab;
    --overlay-base-rgb: 255, 245, 248;
    --bg-memo: #fffafb;
    --bg-cascade-button: var(--bg-button-action);
    --bg-cascade-button-hover: var(--bg-button-action-hover);
    --bg-cascade-delete-button: var(--bg-button-delete);
    --bg-cascade-delete-button-hover: var(--bg-button-delete-hover);
    --text-cascade-indicator: var(--text-secondary);
    --bg-button-header-delete: var(--bg-button-delete);
    --bg-button-header-delete-hover: var(--bg-button-delete-hover);
    --bg-button-header-copy: var(--bg-button-copy);
    --bg-button-header-copy-hover: var(--bg-button-copy-hover);
    --bg-code-copy-button: var(--bg-button-action);
    --bg-code-copy-button-hover: var(--bg-button-action-hover);
    --text-code-copy-button: var(--text-light);

    --text-primary: #5c3c45;
    --text-secondary: #8c6b74;
    --text-light: #ffffff;
    --text-disabled: #d8b8c0;
    --text-error: #c5002f;
    --text-link: #ff69b4;
    --text-placeholder: #b28a94;
    --text-system: #7d5a65;
    --text-memo: #5c3c45;

    --border-primary: #ffc2d7;
    --border-secondary: #ffe0e7;
    --border-tertiary: #fff0f3;
    --border-danger: #ffb3c1;
    --border-system: #ffd1dc;

    --shadow-primary: rgba(200, 150, 160, 0.1);
    --shadow-secondary: rgba(200, 150, 160, 0.1);

    --bg-dialog-file-item: var(--bg-tertiary);
    --border-dialog-file-item: var(--border-secondary);
    --text-dialog-file-name: var(--text-primary);
    --text-dialog-file-size: var(--text-secondary);
    --bg-dialog-button-select: var(--bg-button-action);
    --bg-dialog-button-select-hover: var(--bg-button-action-hover);
    --bg-dialog-button-confirm: var(--bg-button-save);
    --bg-dialog-button-confirm-hover: var(--bg-button-save-hover);
    --bg-dialog-button-cancel: var(--bg-button-cancel);
    --bg-dialog-button-cancel-hover: var(--bg-button-cancel-hover);

    --bg-attachment-details: rgba(255, 230, 234, 0.5);
    --border-attachment-details: var(--border-tertiary);
    --text-attachment-summary: var(--text-secondary);
    --text-attachment-filename: var(--text-primary);

    --bg-toggle-button: var(--bg-button-action);
    --bg-toggle-button-hover: var(--bg-button-action-hover);
    --text-toggle-button: var(--text-light);

    --bg-button-gold: #ffdd77;
    --bg-button-gold-hover: #ffcc55;
    --text-button-gold: #816200;
    --bg-button-purple: #d9a7e0;
    --bg-button-purple-hover: #c790d0;
    --text-button-purple: #ffffff;

    --message-actions-base-rgb: 255, 230, 234;

    --default-user-name-bubble-custom-rgb: 255, 230, 234;
    --default-ai-name-bubble-custom-rgb: 255, 230, 234;
}

body.pastel-blue-mode {
    --bg-primary: #f0f8ff;
    --bg-secondary: #e0f0ff;
    --bg-tertiary: #eaf5ff;
    --bg-tertiary-rgb: 234, 245, 255;
    --bg-input: #ffffff;
    --bg-user-message: #cff1ef;
    --bg-model-message: #e0e8ff;
    --bg-system-message: #e6f2ff;
    --bg-error-message: #d1e9ff;
    --bg-button: #87cefa;
    --bg-button-rgb: 135, 206, 250;
    --bg-button-hover: #70b8e8;
    --bg-button-disabled: #b0dfff;
    --bg-button-action: #add8e6;
    --bg-button-action-hover: #9ccce0;
    --bg-button-delete: #ff7f7f;
    --bg-button-delete-hover: #ff6a6a;
    --bg-button-retry: #98fb98;
    --bg-button-retry-hover: #82f082;
    --bg-button-edit: #ffe082;
    --bg-button-edit-hover: #ffda6b;
    --bg-button-copy: #bca0dc;
    --bg-button-copy-hover: #ae8fcf;
    --bg-button-paste: #a0cfd8;
    --bg-button-paste-hover: #8ebfc9;
    --bg-button-duplicate: #c1e1c1;
    --bg-button-duplicate-hover: #add6ad;
    --bg-button-export: #b0c4de;
    --bg-button-export-hover: #a0b7d3;
    --bg-button-save: #90ee90;
    --bg-button-save-hover: #78dd78;
    --bg-button-cancel: #ff94a0;
    --bg-button-cancel-hover: #ff808c;
    --bg-button-update: #89cff0;
    --bg-button-update-hover: #70c0e0;
    --bg-header: #87cefa;
    --overlay-base-rgb: 240, 248, 255;
    --bg-memo: #f5faff;
    --bg-cascade-button: var(--bg-button-action);
    --bg-cascade-button-hover: var(--bg-button-action-hover);
    --bg-cascade-delete-button: var(--bg-button-delete);
    --bg-cascade-delete-button-hover: var(--bg-button-delete-hover);
    --text-cascade-indicator: var(--text-secondary);
    --bg-button-header-delete: var(--bg-button-delete);
    --bg-button-header-delete-hover: var(--bg-button-delete-hover);
    --bg-button-header-copy: var(--bg-button-copy);
    --bg-button-header-copy-hover: var(--bg-button-copy-hover);
    --bg-code-copy-button: var(--bg-button-action);
    --bg-code-copy-button-hover: var(--bg-button-action-hover);
    --text-code-copy-button: var(--text-light);

    --text-primary: #3a5679;
    --text-secondary: #6b87a9;
    --text-light: #ffffff;
    --text-disabled: #aec8e1;
    --text-error: #a52a2a;
    --text-link: #5f9ea0;
    --text-placeholder: #9ab0c9;
    --text-system: #5a7698;
    --text-memo: #3a5679;

    --border-primary: #b0dfff;
    --border-secondary: #d5eaff;
    --border-tertiary: #eaf5ff;
    --border-danger: #add8e6;
    --border-system: #c1d8e8;

    --shadow-primary: rgba(150, 180, 200, 0.1);
    --shadow-secondary: rgba(150, 180, 200, 0.1);

    --bg-dialog-file-item: var(--bg-tertiary);
    --border-dialog-file-item: var(--border-secondary);
    --text-dialog-file-name: var(--text-primary);
    --text-dialog-file-size: var(--text-secondary);
    --bg-dialog-button-select: var(--bg-button-action);
    --bg-dialog-button-select-hover: var(--bg-button-action-hover);
    --bg-dialog-button-confirm: var(--bg-button-save);
    --bg-dialog-button-confirm-hover: var(--bg-button-save-hover);
    --bg-dialog-button-cancel: var(--bg-button-cancel);
    --bg-dialog-button-cancel-hover: var(--bg-button-cancel-hover);

    --bg-attachment-details: rgba(224, 240, 255, 0.5);
    --border-attachment-details: var(--border-tertiary);
    --text-attachment-summary: var(--text-secondary);
    --text-attachment-filename: var(--text-primary);

    --bg-toggle-button: var(--bg-button-action);
    --bg-toggle-button-hover: var(--bg-button-action-hover);
    --text-toggle-button: var(--text-light);

    --bg-button-gold: #ffe48c;
    --bg-button-gold-hover: #ffda70;
    --text-button-gold: #7a6200;
    --bg-button-purple: #c1b2d7;
    --bg-button-purple-hover: #b0a0cb;
    --text-button-purple: #ffffff;

    --message-actions-base-rgb: 224, 240, 255;

    --default-user-name-bubble-custom-rgb: 224, 240, 255;
    --default-ai-name-bubble-custom-rgb: 224, 240, 255;
}

body.pastel-yellow-mode {
    --bg-primary: #fffefa;
    --bg-secondary: #fffacd;
    --bg-tertiary: #fff8dc;
    --bg-tertiary-rgb: 255, 248, 220;
    --bg-input: #ffffff;
    --bg-user-message: #fff5ba;
    --bg-model-message: #ffe4b5;
    --bg-system-message: #fffbea;
    --bg-error-message: #ffebcd;
    --bg-button: #ffd700;
    --bg-button-rgb: 255, 215, 0;
    --bg-button-hover: #ffc700;
    --bg-button-disabled: #fff0b3;
    --bg-button-action: #ffec8b;
    --bg-button-action-hover: #ffdf60;
    --bg-button-delete: #ffa07a;
    --bg-button-delete-hover: #ff8c69;
    --bg-button-retry: #b0e57c;
    --bg-button-retry-hover: #9acd32;
    --bg-button-edit: #ffa500;
    --bg-button-edit-hover: #ff8c00;
    --bg-button-copy: #ffb6c1;
    --bg-button-copy-hover: #ffaab5;
    --bg-button-paste: #add8e6;
    --bg-button-paste-hover: #9ccce0;
    --bg-button-duplicate: #f0e68c;
    --bg-button-duplicate-hover: #eadc67;
    --bg-button-export: #fff0b3;
    --bg-button-export-hover: #ffe78a;
    --bg-button-save: #98fb98;
    --bg-button-save-hover: #82f082;
    --bg-button-cancel: #ffdab9;
    --bg-button-cancel-hover: #ffceaa;
    --bg-button-update: #ffcc5c;
    --bg-button-update-hover: #ffbf40;
    --bg-header: #ffd700;
    --overlay-base-rgb: 255, 254, 250;
    --bg-memo: #fffef0;
    --bg-cascade-button: var(--bg-button-action);
    --bg-cascade-button-hover: var(--bg-button-action-hover);
    --bg-cascade-delete-button: var(--bg-button-delete);
    --bg-cascade-delete-button-hover: var(--bg-button-delete-hover);
    --text-cascade-indicator: var(--text-secondary);
    --bg-button-header-delete: var(--bg-button-delete);
    --bg-button-header-delete-hover: var(--bg-button-delete-hover);
    --bg-button-header-copy: var(--bg-button-copy);
    --bg-button-header-copy-hover: var(--bg-button-copy-hover);
    --bg-code-copy-button: var(--bg-button-action);
    --bg-code-copy-button-hover: var(--bg-button-action-hover);
    --text-code-copy-button: var(--text-light);

    --text-primary: #5d4037;
    --text-secondary: #8d6e63;
    --text-light: #424242;
    --text-disabled: #bcaaa4;
    --text-error: #b71c1c;
    --text-link: #ff8f00;
    --text-placeholder: #a1887f;
    --text-system: #795548;
    --text-memo: #5d4037;

    --border-primary: #fff0b3;
    --border-secondary: #fff5ba;
    --border-tertiary: #fffacd;
    --border-danger: #ffcc80;
    --border-system: #fff9c4;

    --shadow-primary: rgba(200, 180, 130, 0.1);
    --shadow-secondary: rgba(200, 180, 130, 0.1);

    --bg-toggle-button: var(--bg-button-action);
    --bg-toggle-button-hover: var(--bg-button-action-hover);
    --text-toggle-button: var(--text-light);

    --bg-button-gold: var(--bg-button);
    --bg-button-gold-hover: var(--bg-button-hover);
    --text-button-gold: var(--text-light);
    --bg-button-purple: #e6e6fa;
    --bg-button-purple-hover: #d8bfd8;
    --text-button-purple: #4b0082;

    --message-actions-base-rgb: 255, 250, 205;

    --default-user-name-bubble-custom-rgb: 255, 250, 205;
    --default-ai-name-bubble-custom-rgb: 255, 250, 205;
}

body.pastel-purple-mode {
    --bg-primary: #f3e5f5;
    --bg-secondary: #e1bee7;
    --bg-tertiary: #ede7f6;
    --bg-tertiary-rgb: 237, 231, 246;
    --bg-input: #ffffff;
    --bg-user-message: #d1c4e9;
    --bg-model-message: #c5cae9;
    --bg-system-message: #f3e8fd;
    --bg-error-message: #f8bbd0;
    --bg-button: #ab47bc;
    --bg-button-rgb: 171, 71, 188;
    --bg-button-hover: #9c27b0;
    --bg-button-disabled: #ce93d8;
    --bg-button-action: #ba68c8;
    --bg-button-action-hover: #a54eb4;
    --bg-button-delete: #ec407a;
    --bg-button-delete-hover: #d81b60;
    --bg-button-retry: #81c784;
    --bg-button-retry-hover: #66bb6a;
    --bg-button-edit: #ffb74d;
    --bg-button-edit-hover: #ffa726;
    --bg-button-copy: #7e57c2;
    --bg-button-copy-hover: #673ab7;
    --bg-button-paste: #64b5f6;
    --bg-button-paste-hover: #42a5f5;
    --bg-button-duplicate: #9575cd;
    --bg-button-duplicate-hover: #7e57c2;
    --bg-button-export: #b39ddb;
    --bg-button-export-hover: #9d80cf;
    --bg-button-save: #a5d6a7;
    --bg-button-save-hover: #81c784;
    --bg-button-cancel: #ef9a9a;
    --bg-button-cancel-hover: #e57373;
    --bg-button-update: #7986cb;
    --bg-button-update-hover: #5c6bc0;
    --bg-header: #ab47bc;
    --overlay-base-rgb: 243, 229, 245;
    --bg-memo: #fbfaff;
    --bg-cascade-button: var(--bg-button-action);
    --bg-cascade-button-hover: var(--bg-button-action-hover);
    --bg-cascade-delete-button: var(--bg-button-delete);
    --bg-cascade-delete-button-hover: var(--bg-button-delete-hover);
    --text-cascade-indicator: var(--text-secondary);
    --bg-button-header-delete: var(--bg-button-delete);
    --bg-button-header-delete-hover: var(--bg-button-delete-hover);
    --bg-button-header-copy: var(--bg-button-copy);
    --bg-button-header-copy-hover: var(--bg-button-copy-hover);
    --bg-code-copy-button: var(--bg-button-action);
    --bg-code-copy-button-hover: var(--bg-button-action-hover);
    --text-code-copy-button: var(--text-light);

    --text-primary: #4a148c;
    --text-secondary: #6a1b9a;
    --text-light: #ffffff;
    --text-disabled: #b39ddb;
    --text-error: #c2185b;
    --text-link: #7b1fa2;
    --text-placeholder: #9078a0;
    --text-system: #6a1b9a;
    --text-memo: #4a148c;

    --border-primary: #ce93d8;
    --border-secondary: #e1bee7;
    --border-tertiary: #f3e5f5;
    --border-danger: #f48fb1;
    --border-system: #d1c4e9;

    --shadow-primary: rgba(170, 150, 200, 0.1);
    --shadow-secondary: rgba(170, 150, 200, 0.1);

    --bg-toggle-button: var(--bg-button-action);
    --bg-toggle-button-hover: var(--bg-button-action-hover);
    --text-toggle-button: var(--text-light);

    --bg-button-gold: #ffee58;
    --bg-button-gold-hover: #fdd835;
    --text-button-gold: #424242;
    --bg-button-purple: var(--bg-button);
    --bg-button-purple-hover: var(--bg-button-hover);
    --text-button-purple: var(--text-light);

    --message-actions-base-rgb: 225, 190, 231;

    --default-user-name-bubble-custom-rgb: 225, 190, 231;
    --default-ai-name-bubble-custom-rgb: 225, 190, 231;
}

body.pastel-rainbow-mode {
    --bg-primary: #fdfdfd;
    --bg-secondary: #f5f5f5;
    --bg-tertiary: #fafafa;
    --bg-tertiary-rgb: 250, 250, 250;
    --bg-input: #ffffff;
    --bg-user-message: #e0fff0;
    --bg-model-message: #e0f0ff;
    --bg-system-message: #fff0f8;
    --bg-error-message: #fff8e0;
    --bg-button: #ff80c0;
    --bg-button-rgb: 255, 128, 192;
    --bg-button-hover: #ff60a0;
    --bg-button-disabled: #ffc0e0;
    --bg-button-action: #80d0ff;
    --bg-button-action-hover: #60b0e0;
    --bg-button-delete: #ff8080;
    --bg-button-delete-hover: #ff6060;
    --bg-button-retry: #80ff80;
    --bg-button-retry-hover: #60e060;
    --bg-button-edit: #ffc080;
    --bg-button-edit-hover: #ffa060;
    --bg-button-copy: #c080ff;
    --bg-button-copy-hover: #a060e0;
    --bg-button-paste: #ffff80;
    --bg-button-paste-hover: #e0e060;
    --bg-button-duplicate: #80ffff;
    --bg-button-duplicate-hover: #60e0e0;
    --bg-button-export: #ff80ff;
    --bg-button-export-hover: #e060e0;
    --bg-button-save: #c0ff80;
    --bg-button-save-hover: #a0e060;
    --bg-button-cancel: #ffc0c0;
    --bg-button-cancel-hover: #ffa0a0;
    --bg-button-update: #80c0ff;
    --bg-button-update-hover: #60a0e0;
    --bg-header: linear-gradient(
        to right,
        #ffadad,
        #ffd6a5,
        #fdffb6,
        #caffbf,
        #9bf6ff,
        #a0c4ff,
        #bdb2ff,
        #ffc6ff,
        #ffadad
    );
    --overlay-base-rgb: 253, 253, 253;
    --bg-memo: #f0fff0;
    --bg-code-copy-button: var(--bg-button-action);
    --bg-code-copy-button-hover: var(--bg-button-action-hover);
    --text-code-copy-button: var(--text-light);

    --text-primary: #333;
    --text-secondary: #555;
    --text-light: #fff;
    --text-disabled: #aaa;
    --text-error: #c00;
    --text-link: #007bff;
    --text-placeholder: #888;
    --text-system: #444;
    --text-memo: #333;

    --border-primary: #e0e0e0;
    --border-secondary: #f0f0f0;
    --border-tertiary: #fafafa;
    --border-danger: #ffdddd;
    --border-system: #e0e8f0;

    --bg-button-gold: #ffcc00;
    --text-button-gold: #333;
    --bg-button-purple: #cc99ff;
    --text-button-purple: #fff;

    --bg-cascade-button: var(--bg-button-action);
    --bg-cascade-button-hover: var(--bg-button-action-hover);
    --bg-cascade-delete-button: var(--bg-button-delete);
    --bg-cascade-delete-button-hover: var(--bg-button-delete-hover);
    --text-cascade-indicator: var(--text-secondary);
    --bg-button-header-delete: var(--bg-button-delete);
    --bg-button-header-delete-hover: var(--bg-button-delete-hover);
    --bg-button-header-copy: var(--bg-button-copy);
    --bg-button-header-copy-hover: var(--bg-button-copy-hover);

    --bg-dialog-file-item: var(--bg-tertiary);
    --border-dialog-file-item: var(--border-secondary);
    --text-dialog-file-name: var(--text-primary);
    --text-dialog-file-size: var(--text-secondary);
    --bg-dialog-button-select: var(--bg-button-action);
    --bg-dialog-button-select-hover: var(--bg-button-action-hover);
    --bg-dialog-button-confirm: var(--bg-button-save);
    --bg-dialog-button-confirm-hover: var(--bg-button-save-hover);
    --bg-dialog-button-cancel: var(--bg-button-cancel);
    --bg-dialog-button-cancel-hover: var(--bg-button-cancel-hover);

    --bg-attachment-details: rgba(240, 240, 240, 0.5);
    --border-attachment-details: var(--border-tertiary);
    --text-attachment-summary: var(--text-secondary);
    --text-attachment-filename: var(--text-primary);

    --bg-toggle-button: var(--bg-button-action);
    --bg-toggle-button-hover: var(--bg-button-action-hover);
    --text-toggle-button: var(--text-light);

    --message-actions-base-rgb: 245, 245, 245;

    --default-user-name-bubble-custom-rgb: 245, 245, 245;
    --default-ai-name-bubble-custom-rgb: 245, 245, 245;
}

body.turf-mode {
    --dazzle-scale: 3;
    --dazzle-dark: 0.1;
    --dazzle-size: 340%;
    --dazzle-light: 0.06;
    --border-alpha: 0.28;

    /* --- 色設定（細分化・ホバー色なしバージョン） --- */

    /* [1] 基本色 */
    --bg-primary: #f6f4f9;
    --bg-secondary: #f6f4f9;
    --bg-tertiary: #f6f4f9;
    --bg-user-message: #ffffff;
    --bg-model-message: #ffffff;
    --text-primary: #7a4114;
    --text-secondary: #7a4114;
    --text-link: #388e3c;

    /* [2] ヘッダーと主要ボタン（送信など） */
    --bg-header: #4caf50;
    --bg-header-hover: #4caf50;
    --bg-button: #4caf50;
    --bg-button-hover: #4caf50;
    --bg-button-rgb: 76, 175, 80;

    /* [3] アクションボタン（汎用：Cascade, 汎用アクションなど） */
    --bg-button-action: #9ccc65;
    --bg-button-action-hover: #9ccc65;

    /* [4] 編集ボタン */
    --bg-button-edit: #f9b218;
    --bg-button-edit-hover: #f9b218;

    /* [5] 危険・キャンセル系ボタン */
    --bg-button-delete: #f25560;
    --bg-button-delete-hover: #f25560;
    --bg-button-cancel: #f25560;
    --bg-button-cancel-hover: #f25560;
    --bg-button-header-delete: #f25560;
    --bg-button-header-delete-hover: #f25560;

    /* [6] 肯定・実行系ボタン */
    --bg-button-save: #2d7fd4;
    --bg-button-save-hover: #2d7fd4;
    --bg-button-update: #2d7fd4;
    --bg-button-update-hover: #2d7fd4;
    --bg-button-retry: #2d7fd4;
    --bg-button-retry-hover: #2d7fd4;

    /* [7] データ操作系ボタン */
    --bg-button-copy: #f5488a;
    --bg-button-copy-hover: #f5488a;
    --bg-button-paste: #9ccc65;
    --bg-button-paste-hover: #9ccc65;
    --bg-button-duplicate: #aed581;
    --bg-button-duplicate-hover: #aed581;
    --bg-button-export: #dce775;
    --bg-button-export-hover: #dce775;
    --bg-button-header-copy: #f5488a;
    --bg-button-header-copy-hover: #f5488a;

    /* [8] チャットバブル開閉ボタン */
    --bg-toggle-button: #9e9e9e;
    --bg-toggle-button-hover: #9e9e9e;
    --text-toggle-button: #ffffff;

    /* [9] その他 */
    --border-system: #a5d6a7;
}

@media (prefers-color-scheme: dark) {
    body:not(.light-mode-forced):not(.pastel-pink-mode):not(.pastel-blue-mode):not(
            .pastel-yellow-mode
        ):not(.pastel-purple-mode):not(.pastel-rainbow-mode):not(.turf-mode) {
        --bg-primary: #1a1a1a;
        --text-primary: #e0e0e0;
    }
}
