/**
 * team max デザインシミュレーター - フロント（顧客向け）画面スタイル
 * teammax-simulator/assets/css/simulator-front.css
 */

        #sim-root { font-family: -apple-system, sans-serif; color: #1d1d1f; background: #fbfbfd; height: 85vh; border: 1px solid #e5e5ea; border-radius: 12px; display: flex; flex-direction: column; overflow: hidden; position: relative; }
        #sim-root * { box-sizing: border-box; }
        /* 🌟 修正：ボタンや色選択などの操作パーツへのダブルタップズーム（画面拡大）を禁止する */
        #sim-root button, #sim-root .sim-tab-btn, #sim-root .color-circle, #sim-root .text-tab-item, #sim-root .ui-align-btn { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; touch-action: manipulation; }
        
        .sim-hdr { height: 60px; background: #fff; border-bottom: 1px solid #e5e5ea; display: flex; justify-content: space-between; align-items: center; padding: 0 24px; flex-shrink: 0; z-index: 10; }
        .hdr-tool-grp { display: flex; gap: 20px; color: #86868b; align-items: center; }
        .hdr-tool-grp i { cursor: pointer; font-size: 18px; transition: color 0.2s; }
        .hdr-tool-grp i:hover { color: #1d1d1f; }
        .hdr-tool-grp i.disabled { color: #d2d2d7 !important; cursor: not-allowed !important; }
        .hdr-sep { width: 1px; height: 16px; background: #e5e5ea; }
        
        .sim-body { display: flex; flex-grow: 1; height: calc(100% - 60px); overflow: hidden; position: relative; }
        .sim-tabs { width: 70px; border-right: 1px solid #e5e5ea; background: #fff; display: flex; flex-direction: column; align-items: center; padding-top: 16px; gap: 20px; flex-shrink: 0; z-index: 5; }
        .sim-tab-btn { color: #86868b; cursor: pointer; font-size: 10px; display: flex; flex-direction: column; align-items: center; gap: 4px; width: 100%; padding: 8px 0; transition: all 0.2s; }
        .sim-tab-btn.active { color: #1d1d1f; border-left: 3px solid #1d1d1f; font-weight: 600; }

        /* 🌟 修正：PC表示時の操作パネルの横幅を 360px から 420px に広げて見切れを防止 */
        .sim-panel { width: 420px; border-right: 1px solid #e5e5ea; background: #fff; display: flex; flex-direction: column; position: relative; z-index: 5; }
        .sim-panel-scroll { flex-grow: 1; overflow-y: auto; padding: 24px; padding-bottom: 90px; }
        
        .sim-workspace { flex-grow: 1; background: #f5f5f7; display: flex; justify-content: center; align-items: center; position: relative; overflow: hidden; }
        .canvas-wrap { background: #fff; box-shadow: 0 10px 40px rgba(0,0,0,0.04); border: 1px solid #e5e5ea; }
        
        .view-section { display: none; }
        .view-section.active { display: block; }
        
        .p-title-row { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
        .btn-back { cursor: pointer; color: #86868b; font-size: 16px; transition: color 0.2s; }
        .btn-back:hover { color: #1d1d1f; }
        .p-title { font-size: 16px; font-weight: 700; margin: 0; }
        
        /* 🌟 修正：overflow: hidden; を削除し、ドロップダウンが枠外へ飛び出せるようにする */
        .acco { border: 1px solid #e5e5ea; border-radius: 8px; margin-bottom: 12px; background: #fff; }
        /* 🌟 修正：はみ出し許可に伴い、トリガー（見出し）自体の背景の角を丸める */
        .acco-trigger { display: flex; justify-content: space-between; padding: 12px 14px; font-size: 13px; font-weight: 700; cursor: pointer; color: #1d1d1f; background: #f8fafc; align-items: center; border-radius: 7px; }
        .acco.open .acco-trigger { border-radius: 7px 7px 0 0; }.acco-trigger i { transition: transform 0.2s; color: #86868b; }
        .acco.open .acco-trigger i { transform: rotate(180deg); }
        .acco-content { display: none; padding: 16px 14px; border-top: 1px solid #e5e5ea; }
        .acco.open .acco-content { display: block; }

        .p-label { font-size: 11px; font-weight: 600; color: #475569; margin-bottom: 6px; display: block; }
        .ui-text { width: 100%; min-height: 70px; border: 1px solid #d2d2d7; border-radius: 8px; padding: 10px; font-size: 13px; margin-bottom: 12px; font-family: inherit; }
        
        .ui-slider-grp { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
        .ui-slider-grp input[type="range"] { flex-grow: 1; accent-color: #1d1d1f; }
        .ui-slider-grp input[type="number"] { width: 54px; border: 1px solid #d2d2d7; border-radius: 6px; text-align: center; font-size: 11px; padding: 4px; }
        
        .ui-align-grp { display: flex; border: 1px solid #d2d2d7; border-radius: 8px; overflow: hidden; margin-bottom: 12px; }
        .ui-align-btn { flex: 1; padding: 8px; background: #fff; border: none; border-right: 1px solid #d2d2d7; cursor: pointer; color: #86868b; }
        .ui-align-btn.active { background: #f5f5f7; color: #1d1d1f; }
        
        .btn-black { background: #1d1d1f; color: #fff; border: none; padding: 10px 16px; border-radius: 8px; font-weight: 600; cursor: pointer; font-size: 13px; display: inline-flex; align-items: center; gap: 6px; justify-content: center; width: 100%; transition: background 0.2s; }
        .btn-black:hover { background: #333; }
        .btn-black:disabled { opacity: 0.5; cursor: not-allowed; background: #86868b; }

        .stamp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 12px; }
        .stamp-thumb { border: 1px solid #e5e5ea; border-radius: 8px; padding: 8px; cursor: pointer; text-align: center; background: #fbfbfd; transition: all 0.2s; height: 80px; display: flex; align-items: center; justify-content: center; }
        .stamp-thumb:hover { border-color: #1d1d1f; background: #f5f5f7; }
        .stamp-thumb svg { width: 100%; height: 100%; max-height: 60px; }

        .added-item-list { margin-top: 16px; }
        .added-item { display: flex; align-items: center; justify-content: space-between; padding: 12px; border: 1px solid #e5e5ea; border-radius: 8px; margin-bottom: 8px; cursor: pointer; transition: background 0.1s; }
        .added-item:hover { background: #f8fafc; border-color: #d2d2d7; }

        .custom-font-select { position: relative; margin-bottom: 12px; width: 100%; }
        .c-select-trigger { padding: 10px 12px; border: 1px solid #d2d2d7; border-radius: 8px; font-size: 13px; cursor: pointer; background: #fff; display: flex; justify-content: space-between; align-items: center; }
        .c-select-options { position: absolute; top: 100%; left: 0; right: 0; background: #fff; border: 1px solid #d2d2d7; border-radius: 8px; margin-top: 4px; z-index: 99; max-height: 200px; overflow-y: auto; box-shadow: 0 4px 12px rgba(0,0,0,0.1); display: none; }
        .custom-font-select.open .c-select-options { display: block; }
        .c-option-item { padding: 12px; cursor: pointer; border-bottom: 1px solid #f5f5f7; transition: background 0.2s; }
        .c-option-item:hover { background: #f5f5f7; }

        .template-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 20px; }
        .template-item { border: 1px solid #e5e5ea; border-radius: 8px; overflow: hidden; cursor: pointer; transition: all 0.2s; background: #fbfbfd; text-align: center; }
        .template-item:hover { border-color: #1d1d1f; box-shadow: 0 4px 12px rgba(0,0,0,0.05); }
        /* 🌟 追加：現在選択中のテクスチャサムネイルをハイライトするスタイル */
        .template-item.active { border: 2px solid #00a0ff !important; box-shadow: 0 0 0 1px #fff inset; }
        .template-thumb { height: 100px; background: #e5e5ea; display: flex; justify-content: center; align-items: center; color: #86868b; font-size: 24px; }
        .template-name { padding: 8px; font-size: 12px; font-weight: 600; color: #1d1d1f; border-top: 1px solid #e5e5ea; }

        .layer-list { margin-top: 12px; }
        .layer-item { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; margin-bottom: 4px; border-radius: 6px; cursor: pointer; font-size: 13px; border: 1px solid transparent; transition: all 0.1s; background: #f8fafc; }
        .layer-item:hover { border-color: #d2d2d7; }
        .layer-item.active { background: #e0f0ff; border-color: #00a0ff; font-weight: 600; }
        .layer-info { display: flex; align-items: center; gap: 8px; flex-grow: 1; overflow: hidden; }
        .layer-check { cursor: pointer; accent-color: #1d1d1f; }
        .layer-icon { width: 24px; height: 24px; background: #fff; border-radius: 4px; display: flex; justify-content: center; align-items: center; color: #86868b; flex-shrink: 0; }
        .layer-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .layer-actions { display: flex; gap: 8px; color: #86868b; font-size: 14px; }
        .layer-actions i { cursor: pointer; transition: color 0.2s; }
        .layer-actions i:hover { color: #1d1d1f; }
        
        .layer-item.dragging { opacity: 0.5; background: #e2e8f0; }
        .layer-item.drag-over-top { border-top: 2px solid #00a0ff; }
        .layer-item.drag-over-bottom { border-bottom: 2px solid #00a0ff; }
        .layer-item.drag-over-inside { background: #e0f0ff; border: 2px solid #00a0ff; }
        
        /* 🌟 修正：ロック時の打消し線を削除し、テキストの色変化とアイコンの半透明化のみにする */
        .layer-item.locked { opacity: 0.6; background: #f1f5f9; }
        .layer-item.locked .layer-name { color: #86868b; }
        .layer-item.locked .layer-icon { opacity: 0.5; }
        .layer-drag-handle { width: 34px; display: flex; align-items: center; justify-content: center; cursor: grab; color: #a1a1a6; font-size: 16px; flex-shrink: 0; touch-action: none; border-left: 1px dashed #e5e5ea; margin-left: 8px; margin-right: -4px; transition: color 0.2s; }
        .layer-drag-handle:hover, .layer-drag-handle:active { color: #1d1d1f; }

        .color-setting-row { display: flex; align-items: center; margin-bottom: 14px; }
        .color-setting-label { font-size: 13px; font-weight: 600; width: 55px; flex-shrink: 0; color: #1d1d1f; }
        .color-circles { display: flex; gap: 8px; flex-grow: 1; align-items: center; margin-left: 10px; }
        .color-circle { width: 28px; height: 28px; border-radius: 50%; border: 1px solid #d2d2d7; cursor: pointer; position: relative; background: #fff; transition: all 0.1s; }
        .color-circle.active { border: 2px solid #00a0ff; box-shadow: 0 0 0 2px #fff inset; }
        .color-circle.none { position: relative; }
        /* 🌟 修正：カラー丸の「なし」を赤いアイコンに変更 */
        .color-circle.none::after { content: '\f05e'; font-family: "Font Awesome 6 Free"; font-weight: 900; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 22px; color: #d63638; }
        .thickness-control { display: flex; align-items: center; gap: 6px; }
        .thickness-control span { font-size: 11px; color: #86868b; }
        .thickness-control input { width: 44px; text-align: center; border: 1px solid #d2d2d7; border-radius: 4px; font-size: 13px; padding: 4px; outline: none; }
        /* 🌟 修正：9列グリッドと、3タブ表示＆展開エリアのスタイル */
        .palette-grid { display: grid; grid-template-columns: repeat(9, 1fr); gap: 6px; margin-bottom: 16px; padding-bottom: 16px; border-bottom: 1px solid #e5e5ea; }
        .palette-swatch { width: 100%; aspect-ratio: 1; border-radius: 50%; cursor: pointer; border: 1px solid rgba(0,0,0,0.1); transition: transform 0.1s; }
        
        /* 🌟 修正：スマホでタップした瞬間に黒フチが残る現象を防ぐため、PC(マウス環境)の時だけ有効にする */
        @media (hover: hover) {
            .palette-swatch:hover { transform: scale(1.15); border-color: #1d1d1f; box-shadow: 0 2px 6px rgba(0,0,0,0.15); z-index: 2; position: relative; }
        }
        
        .palette-swatch.none { background: #fff; position: relative; border: 1px solid #d2d2d7; }
        /* 🌟 修正：パレットの「なし」を赤いアイコンに変更 */
        .palette-swatch.none::after { content: '\f05e'; font-family: "Font Awesome 6 Free"; font-weight: 900; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 16px; color: #d63638; }
        
        /* 🌟 追加：現在選択中のカラーチップをハイライトするスタイル */
        .palette-swatch.active { border: 2px solid #00a0ff !important; box-shadow: 0 0 0 2px #fff inset; transform: scale(1.15); z-index: 2; position: relative; }
        
        .palette-tab-row { display: flex; gap: 6px; margin-bottom: 10px; }
        .palette-tab-btn { flex: 1; height: 36px; border-radius: 8px; border: 1px solid #d2d2d7; background: #fff; font-size: 12px; font-weight: 600; color: #1d1d1f; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 4px; transition: all 0.2s; }
        .palette-tab-btn:hover { background: #f5f5f7; }
        .palette-tab-btn.active { background: #1d1d1f; color: #fff; border-color: #1d1d1f; }
        
        /* 🌟 追加：「なし」ボタン選択時は黒反転させず、他カラー同様に青いフチをつける */
        .palette-tab-btn#p-tab-none.active { background: #fff !important; color: #1d1d1f !important; border: 2px solid #00a0ff !important; }
        /* 🌟 修正：ホバー時の拡大や影が見切れないよう、スクロール枠の内側に上下左右8pxの安全な余白を持たせる */
        .palette-sub-area { display: none; padding: 2px 4px; background: #f8fafc; border: 1px solid #e5e5ea; border-radius: 8px; margin-bottom: 12px; }
        .palette-sub-scroll { display: flex; gap: 8px; overflow-x: auto; padding: 8px; scrollbar-width: none; align-items: center; }
        
        .palette-sub-scroll::-webkit-scrollbar { display: none; }
        
        /* 🌟 修正：テクスチャ一覧のレスポンシブ表示（PCは3列で等分に広がるGrid、スマホは固定サイズの横スクロール） */
        .texture-grid-container { margin-bottom: 15px; }
        @media (min-width: 769px) {
            .texture-grid-container { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding-bottom: 0; }
            .texture-item-responsive { width: 100%; aspect-ratio: 1 / 1; }
        }
        @media (max-width: 768px) {
            .texture-grid-container { display: flex; gap: 10px; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 10px; scrollbar-width: none; }
            .texture-grid-container::-webkit-scrollbar { display: none; }
            .texture-item-responsive { flex: 0 0 90px; width: 90px; height: 90px; }
        }

        /* 🌟 追加：PC環境ではパネルの拡大縮小ボタンを非表示にする */
        .panel-resize-btn { display: none; }
        /* 🌟 追加：エクスポート用モーダルウィンドウのスタイル */
        .sim-modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.6); z-index: 9999; display: none; justify-content: center; align-items: center; backdrop-filter: blur(4px); }
        .sim-modal { background: #fff; border-radius: 12px; width: 90%; max-width: 600px; max-height: 90vh; overflow-y: auto; box-shadow: 0 20px 40px rgba(0,0,0,0.2); padding: 30px; position: relative; font-family: -apple-system, sans-serif; color: #1d1d1f; }
        .sim-modal-close { position: absolute; top: 15px; right: 15px; font-size: 24px; cursor: pointer; color: #86868b; transition: color 0.2s; }
        .sim-modal-close:hover { color: #1d1d1f; }
        .sim-modal h2 { margin-top: 0; margin-bottom: 20px; font-size: 20px; border-bottom: 1px solid #e5e5ea; padding-bottom: 10px; }
        .export-actions { display: flex; flex-direction: column; gap: 15px; }
        .export-btn { padding: 12px 20px; border-radius: 8px; font-weight: 600; font-size: 14px; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; transition: all 0.2s; border: none; }
        .export-btn-dl { background: #1d1d1f; color: #fff; }
        .export-btn-dl:hover { background: #333; }
        .export-btn-inquiry { background: #00a0d2; color: #fff; }
        .export-btn-inquiry:hover { background: #008cb8; }
        .sns-share-note { font-size: 12px; color: #86868b; text-align: center; margin-top: 5px; background: #f5f5f7; padding: 10px; border-radius: 6px; }
        /* 🌟 追加：市松模様背景（テクスチャ透過表示用） */
        .sim-checkerboard { background: repeating-conic-gradient(#f0f0f0 0% 25%, transparent 0% 50%) 50% / 14px 14px; }
        
        /* 🌟 追加：キャンバスの自動縮小フィット用 */
        .canvas-wrap { transition: transform 0.1s; transform-origin: center center; }

        /* 🌟 修正：ドロップダウンが枠に隠れないよう fixed(画面固定配置) に変更 */
        .text-tab-item { position: relative; }
        .tm-dropdown-menu { position: fixed; background: #fff; border: 1px solid #d2d2d7; border-radius: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.15); z-index: 999999; display: none; flex-direction: column; min-width: 130px; padding: 4px 0; }
        .tm-dropdown-menu.open { display: flex; }
        .tm-dropdown-item { padding: 10px 16px; font-size: 13px; font-weight: 600; color: #1d1d1f; cursor: pointer; text-align: left; white-space: nowrap; border-bottom: 1px solid #f5f5f7; transition: background 0.2s; }
        .tm-dropdown-item:last-child { border-bottom: none; }
        .tm-dropdown-item:hover { background: #f5f5f7; }
        .tm-dropdown-item.active { color: #00a0d2; background: #f0f8ff; }

        .sub-menu-bar { display: flex; gap: 10px; border-bottom: 1px solid #e5e5ea; padding-bottom: 10px; margin-bottom: 15px; overflow-x: auto; white-space: nowrap; }
        
        .sub-tab-btn { padding: 6px 14px; background: #f5f5f7; color: #86868b; border-radius: 20px; font-size: 12px; font-weight: bold; cursor: pointer; border: 1px solid transparent; transition: all 0.2s; }
        .sub-tab-btn.active { background: #1d1d1f; color: #fff; }
        .sub-content { display: none; }
        .sub-content.active { display: block; }

        .text-menu-tabs { display: flex; gap: 10px; border-bottom: 1px solid #e5e5ea; padding-bottom: 10px; margin-bottom: 15px; overflow-x: auto; white-space: nowrap; align-items: center; min-height: 40px; box-sizing: border-box; }
        
        /* 🌟 追加：ヘルプ用アイコンボタンのスタイル */
        .panel-help-btn { cursor: pointer; color: #86868b; font-size: 14px; transition: all 0.2s; display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; background: #f5f5f7; border: 1px solid #d2d2d7; flex-shrink: 0; }
        .panel-help-btn:hover { color: #00a0d2; border-color: #00a0d2; background: #e0f0ff; }

        /* 🌟 追加：PC表示時は極細の美しいスクロールバーを表示する */
        .sub-menu-bar::-webkit-scrollbar, .text-menu-tabs::-webkit-scrollbar, #dynamic-texture-grid::-webkit-scrollbar { height: 6px; }
        .sub-menu-bar::-webkit-scrollbar-track, .text-menu-tabs::-webkit-scrollbar-track, #dynamic-texture-grid::-webkit-scrollbar-track { background: transparent; }
        .sub-menu-bar::-webkit-scrollbar-thumb, .text-menu-tabs::-webkit-scrollbar-thumb, #dynamic-texture-grid::-webkit-scrollbar-thumb { background: #d2d2d7; border-radius: 4px; }
        .sub-menu-bar::-webkit-scrollbar-thumb:hover, .text-menu-tabs::-webkit-scrollbar-thumb:hover, #dynamic-texture-grid::-webkit-scrollbar-thumb:hover { background: #86868b; }
        .text-tab-item { padding: 0 14px; height: 28px; box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; background: #f5f5f7; color: #86868b; border-radius: 20px; font-size: 12px; font-weight: bold; cursor: pointer; border: 1px solid transparent; transition: all 0.2s; }
        .text-tab-item.active { background: #1d1d1f; color: #fff; }

        /* 🌟 追加：グループ化ボタンを下部メニューにピッタリ張り付ける「帯」のスタイル */
        .layer-group-sticky { position: sticky; bottom: -90px; margin: 20px -24px -90px -24px; padding: 15px 24px; background: rgba(251,251,253,0.9); backdrop-filter: blur(8px); border-top: 1px solid #e5e5ea; z-index: 99; }

        /* 🌟 追加：全画面オーバーレイ風パネルヘッダースタイル */
        .panel-header-bar {
            height: 50px;
            padding: 0 15px;
            border-bottom: 1px solid #e5e5ea;
            background: #f8fafc;
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin: -24px -24px 15px -24px;
            flex-shrink: 0;
        }
        @media (max-width: 768px) {
            .panel-header-bar {
                margin: -12px -12px 15px -12px;
            }
        }

        /* 🌟 修正：重複を排除し、純粋なスマホ専用レイアウトだけをメディアクエリ内に格納 */
        @media (max-width: 768px) {
            /* 🌟 追加：スマホ時のグループ化ボタン張り付き余白を精密に調整 */
            .layer-group-sticky { bottom: -20px; margin: 10px -12px -20px -12px; padding: 12px 12px; }

            /* 🌟 追加：スマホ時は指でスワイプするためスクロールバーを完全に隠す */
            .sub-menu-bar::-webkit-scrollbar, .text-menu-tabs::-webkit-scrollbar, #dynamic-texture-grid::-webkit-scrollbar { display: none; }
            .sub-menu-bar, .text-menu-tabs, #dynamic-texture-grid { scrollbar-width: none; }

            /* スマホ時はシミュレーターを画面全体に「完全固定」し、ブラウザの押し上げスクロールを防止 */
            #sim-root { position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 99999; height: 100vh; height: 100dvh; border-radius: 0; border: none; background: #fbfbfd; }
            
            /* 🌟 修正：スマホヘッダーの要素が綺麗に一直線に並ぶよう、余白とサイズを極限までコンパクトに調整 */
            .sim-hdr { padding: 0 8px; gap: 4px; }
            .hdr-logo-img { height: 24px !important; } /* スマホの時はロゴ画像を少し小さくしてスペース確保 */
            
            .hdr-tool-grp { display: flex !important; gap: 0px; align-items: center; } 
            .hdr-sep, #zoom-txt { display: none !important; } 
            
            /* 🌟 修正：空いたスペースを利用してアイコンを 20px に拡大し、左右のタップ余白を 12px まで限界拡張 */
            .hdr-tool-grp i { font-size: 20px; padding: 12px 12px; margin: 0; display: inline-block; -webkit-tap-highlight-color: rgba(0,0,0,0.05); }
            
            .sim-hdr .btn-black { padding: 6px 12px; font-size: 12px; } /* 通常の保存ボタンも少し押しやすく */
            
            /* ボタン内のテキストをスマホの時だけ切り替える */
            .txt-save-pc { display: none !important; }
            .txt-save-sp { display: inline !important; }
            
            /* 🌟 追加：管理者専用テンプレボタンを極限まで小さくする専用クラス */
            .txt-tpl-sp { display: inline !important; font-weight: bold; }
            .icon-tpl-pc { display: none !important; } /* アイコンを消去 */
            .btn-tpl-sp { padding: 6px 8px !important; min-width: auto !important; font-size: 11px !important; }
            
            .sim-body { flex-direction: column; }
            
            /* 🌟 修正：キャンバスを画面の空きスペース全体に最大限広げる */
            .sim-workspace { order: 1; flex-grow: 1; height: auto; min-height: 0; padding: 0; background: #fbfbfd; }
            .canvas-wrap { border: none; box-shadow: none; border-radius: 0; }
            
            /* 🌟 修正：操作パネルの高さを25vhに調整し、キャンバスを大きく表示する */
            .sim-panel { order: 2; flex: 0 0 25vh; height: 25vh; width: 100%; border-right: none; border-top: 1px solid #e5e5ea; overflow-y: auto; box-shadow: 0 -4px 15px rgba(0,0,0,0.05); z-index: 10; transition: flex 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), height 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); }
            
            /* 🌟 追加：パネル拡大時のスタイルと、手動ボタンのデザイン */
            .sim-panel.expanded { flex: 0 0 55vh !important; height: 55vh !important; }
            .panel-resize-btn { display: flex !important; position: absolute; bottom: 15px; right: 15px; width: 44px; height: 44px; background: rgba(29, 29, 31, 0.85); color: #fff; border-radius: 50%; justify-content: center; align-items: center; box-shadow: 0 4px 12px rgba(0,0,0,0.2); z-index: 99; cursor: pointer; transition: transform 0.3s ease; backdrop-filter: blur(4px); border: 1px solid rgba(255,255,255,0.2); }
            .panel-resize-btn.expanded i { transform: rotate(180deg); }
            
            .sim-panel-scroll { padding: 12px; padding-bottom: 20px; }
            
            /* 🌟 修正：メインメニュー（一番下に固定）も少し細くしてスペースを確保 */
            .sim-tabs { order: 3; flex: 0 0 55px; height: 55px; width: 100%; flex-direction: row; padding: 0; border-right: none; border-top: 1px solid #e5e5ea; justify-content: space-around; overflow-x: auto; background: #fff; z-index: 20; }
            .sim-tab-btn { flex: 1; min-width: 55px; padding: 8px 0; border-left: none; border-top: 3px solid transparent; }
            .sim-tab-btn.active { border-left: none; border-top: 3px solid #1d1d1f; }
            .sim-tab-btn i { font-size: 16px; }
            .sim-tab-btn span { font-size: 9px; margin-top: 4px; }
            /* 🌟 追加：スマホ時はドロップダウンメニューを横1行のスクロールバーに変更 */
            .tm-dropdown-menu {
                flex-direction: row !important;
                overflow-x: auto;
                padding: 0 !important;
                -ms-overflow-style: none; /* IE, Edge用スクロールバー非表示 */
                scrollbar-width: none;    /* Firefox用スクロールバー非表示 */
            }
            .tm-dropdown-menu::-webkit-scrollbar {
                display: none; /* Chrome, Safari用スクロールバー非表示 */
            }
            .tm-dropdown-item {
                border-bottom: none !important;
                border-right: 1px solid #f5f5f7;
                padding: 10px 14px !important;
                flex-shrink: 0; /* 項目の文字が潰れないようにする */
            }
            .tm-dropdown-item:last-child {
                border-right: none !important;
            }
        }
        /* 🌟 追加：PC表示時にサブメニューを縦に全展開し、見出しを表示するスタイル */
        @media (min-width: 769px) {
            /* 🌟 追加：PC表示時はパーツ選択タブを横スクロールではなく折り返し（改行）表示にする */
            .sub-menu-bar {
                flex-wrap: wrap;
                white-space: normal;
                overflow-x: visible;
                padding-bottom: 4px; /* 改行時の下部余白を調整 */
            }

            #view-text-edit .text-sub-content,
            #view-stamp-edit .stamp-sub-content {
                display: block !important;
                margin-bottom: 20px;
                padding-bottom: 15px;
                border-bottom: 1px dashed #e5e5ea;
            }
            #view-text-edit .text-sub-content:last-of-type,
            #view-stamp-edit .stamp-sub-content:last-of-type {
                border-bottom: none;
                margin-bottom: 10px;
                padding-bottom: 0;
            }
            .pc-sub-header {
                display: flex;
                align-items: center;
                font-size: 12px;
                font-weight: 700;
                color: #1d1d1f;
                margin-bottom: 10px;
                padding-bottom: 4px;
                border-bottom: 1px solid #f5f5f7;
            }
            .pc-only { display: block !important; }
            .sp-only { display: none !important; } /* 🌟 追加：PC時はスマホ用を隠す */
            /* 🌟 追加：PC表示時にはスマホ専用のドロップダウン関連要素を非表示にする */
            .sp-only-drop { display: none !important; }
        }
        @media (max-width: 768px) {
            .pc-sub-header { display: none !important; }
            .pc-only { display: none !important; }
            .sp-only { display: block !important; } /* 🌟 追加：スマホ時はスマホ用を出す */
        }
        /* 🌟 追加：ヘルプアコーディオン＆ヘルプモーダル内のWordPressテーマCSSを打ち消す強力なリセット */

        /* 🌟 追加：ヘルプ画面用の共通スタイル（WordPressテーマの干渉を排除） */
        .help-section-title { font-size: 14px !important; color: #1d1d1f !important; margin: 0 0 15px 0 !important; border: none !important; border-bottom: 1px solid #e5e5ea !important; padding: 0 0 10px 0 !important; display: flex !important; align-items: center !important; min-height: 40px !important; box-sizing: border-box !important; font-weight: bold !important; background: transparent !important; }
        .help-desc-text { font-size: 12px !important; color: #475569 !important; line-height: 1.6 !important; margin: 0 0 24px 0 !important; padding: 0 !important; }

        /* 親要素からの pre-wrap 継承を完全にブロック */
        .acco-content, .acco-content div, .acco-content p, .acco-content ul, .acco-content li,
        #help-modal-content, #help-modal-content div, #help-modal-content p, #help-modal-content ul, #help-modal-content li {
            white-space: normal !important; 
        }

        .acco-content h4, #help-modal-content h4 {
            font-size: 14px; /* 🌟 自由なサイズ変更を許可 */
            font-weight: bold !important;
            color: #1d1d1f; /* 🌟 自由な色変更を許可 */
            margin: 0 0 10px 0 !important;
            padding: 0 !important;
            border: none !important;
            background: transparent !important;
            line-height: 1.4 !important;
        }
        .acco-content h5, #help-modal-content h5 {
            font-size: 13px; /* 🌟 自由なサイズ変更を許可 */
            font-weight: bold !important;
            color: #1d1d1f; /* 🌟 自由な色変更を許可 */
            margin: 14px 0 8px 0 !important;
            padding: 0 !important;
            border: none !important;
            background: transparent !important;
            line-height: 1.4 !important;
        }
        .acco-content p, #help-modal-content p {
            font-size: 12px; /* 🌟 自由なサイズ変更を許可 */
            margin: 0 0 10px 0 !important;
            padding: 0 !important;
            line-height: 1.6 !important;
            color: #475569; /* 🌟 自由な色変更を許可 */
        }
        .acco-content ul, #help-modal-content ul {
            margin: 8px 0 12px 0 !important;
            padding: 0 !important;
            list-style: none !important; 
        }
        .acco-content li, #help-modal-content li {
            font-size: 12px; /* 🌟 自由なサイズ変更を許可 */
            margin: 0 0 8px 0 !important;
            padding: 0 !important;
            list-style: none !important; 
            line-height: 1.5 !important;
            color: #475569; /* 🌟 自由な色変更を許可 */
        }
        
        /* 🌟 追加：WordPressテーマが独自に作っている「黒丸」や「アイコン」を完全に消し去る */
        .acco-content li::before, .acco-content li::after,
        #help-modal-content li::before, #help-modal-content li::after {
            content: none !important;
            display: none !important;
        }
        
        /* 最後の要素の下マージンを消す */
        .acco-content > div > *:last-child,
        #help-modal-content > *:last-child {
            margin-bottom: 0 !important;
        }
        /* 🌟 追加：アコーディオン開閉時に、左側のアイコンが巻き添えで回転してしまうのを防ぐ */
        .acco.open .acco-trigger span i {
            transform: none !important;
        }
        /* 🌟 追加：ヘルプモーダルをPCでは広く、スマホではコンパクトに表示する */
        .sim-help-modal { width: 320px; }
        @media (min-width: 769px) { .sim-help-modal { width: 600px; } }

        /* 🌟 新規UIレイアウト用（2段構成） */
        .panel-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; margin-bottom: 12px; width: 100%; }
        .panel-row:last-child { margin-bottom: 0; }
        .control-group { display: flex; flex-direction: column; flex: 1; min-width: 0; }
        .control-group label { font-size: 10px; color: #86868b; margin-bottom: 4px; font-weight: bold; text-align: center; }
        .stepper { display: flex; align-items: center; justify-content: space-between; width: 100%; background: #fff; border: 1px solid #d2d2d7; border-radius: 6px; padding: 0; height: 34px; overflow: hidden; }
        .stepper button { height: 100%; padding: 0 10px; background: #f8fafc; border: none; cursor: pointer; color: #1d1d1f; transition: background 0.1s; }
        .stepper button:first-child { border-right: 1px solid #d2d2d7; }
        .stepper button:last-child { border-left: 1px solid #d2d2d7; }
        .stepper button:hover { background: #e2e8f0; }
        .stepper span { flex-grow: 1; text-align: center; font-size: 12px; font-weight: bold; white-space: nowrap; color: #1d1d1f; }
        /* 🌟 追加：キャンペーン告知バナーのパルスアニメーション */
        @keyframes camp-pulse {
            0%, 100% { box-shadow: 0 2px 6px rgba(255,149,0,0.5); transform: scale(1); }
            50% { box-shadow: 0 2px 12px rgba(255,149,0,0.8); transform: scale(1.06); }
        }
