/* ==========================================================================
   assets/css/style.css
   Welcart Design Editor 用スタイル (WordPress用スコープ版)
   ========================================================================== */

/* エディタ専用のフォント読み込み */
@import url('https://fonts.googleapis.com/css2?family=DotGothic16&family=Hina+Mincho&family=Kaisei+Opti&family=Klee+One&family=M+PLUS+1p&family=Noto+Sans+JP:wght@400;700&family=Noto+Serif+JP:wght@400;700&family=Potta+One&family=Reggae+One&family=Sawarabi+Mincho&family=Shippori+Mincho&family=Yuji+Boku&family=Yuji+Mai&family=Yuji+Syuku&family=Zen+Kaku+Gothic+New&family=Zen+Kurenaido&family=Zen+Maru+Gothic&display=swap');

/* ▼▼▼ 全て #designEditorModal で囲ってスコープ化します ▼▼▼ */

#designEditorModal {
    display: none;
    position: fixed;
    /* テーマ側の固定お知らせバナー等が z-index の高い値で重なってくる環境があるため、
       競合を避けて確実に最前面に表示されるよう最大級の値にしておく */
    z-index: 2147483647;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9);
    overflow: hidden;
    font-family: "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", sans-serif;
    color: #333;
    line-height: 1.6;
    font-size: 16px;
    box-sizing: border-box;
}

#designEditorModal * {
    box-sizing: border-box;
}

/* --- コンテナ・レイアウト --- */
#designEditorModal .editor-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: #e0e0e0;
}

/* --- ヘッダー --- */
#designEditorModal .editor-header {
    background: #333;
    color: #fff;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 50px;
    flex-shrink: 0;
}

/* --- ボディ --- */
#designEditorModal .editor-body {
    display: flex;
    flex: 1;
    overflow: hidden;
    position: relative;
}

/* --- 左サイドバー（ツール） --- */
#designEditorModal .editor-toolbar {
    width: 250px;
    background: #f5f5f5;
    border-right: 1px solid #ccc;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 10px;
    flex-shrink: 0;
}

#designEditorModal .tool-section {
    margin-bottom: 20px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 15px;
}
#designEditorModal .tool-section h4 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 0.9rem;
    color: #0073aa;
    padding: 0;
    background: none;
    border: none;
}

#designEditorModal .wde-input-field {
    width: 100%;
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 0.85rem;
}

#designEditorModal .editor-btn {
    display: block;
    width: 100%;
    margin-bottom: 5px;
    padding: 8px;
    background: #fff;
    border: 1px solid #ccc;
    cursor: pointer;
    text-align: left;
    font-size: 0.9rem;
    color: #333;
}
#designEditorModal .editor-btn:hover {
    background: #eee;
}

/* --- キャンバスエリア --- */
#designEditorModal .editor-canvas-area {
    flex: 1;
    background: #999;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: auto;
    position: relative;
}
#designEditorModal .canvas-wrapper {
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
    background: #fff; /* 背景白確保 */
}

/* --- 右サイドバー（パネル） --- */
#designEditorModal .editor-panels {
    width: 280px;
    background: #fff;
    border-left: 1px solid #ccc;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    flex-shrink: 0;
}

#designEditorModal .panel-block {
    padding: 10px;
    border-bottom: 1px solid #eee;
}
#designEditorModal .panel-title {
    font-weight: bold;
    background: #eee;
    padding: 5px 10px;
    margin: -10px -10px 10px -10px;
    font-size: 0.85rem;
}

/* --- プロパティ入力 --- */
#designEditorModal .prop-row {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
}
#designEditorModal .prop-label {
    width: 80px;
    font-size: 0.8rem;
    color: #666;
}
#designEditorModal .prop-input {
    flex: 1;
    padding: 4px;
    font-size: 0.9rem;
    border: 1px solid #ccc;
}
#designEditorModal .prop-color {
    width: 100%;
    height: 30px;
    padding: 0;
    border: none;
}

/* --- レイヤーリスト --- */
#designEditorModal #layer-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
#designEditorModal #layer-list li {
    padding: 5px 10px;
    border-bottom: 1px solid #eee;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
#designEditorModal #layer-list li.active {
    background: #e6f7ff;
    border-left: 3px solid #0073aa;
}
#designEditorModal #layer-list li:hover {
    background: #f9f9f9;
}

/* --- ズームコントロール --- */
#designEditorModal .zoom-controls {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: rgba(255,255,255,0.8);
    padding: 5px;
    border-radius: 4px;
    display: flex;
    gap: 5px;
}
#designEditorModal .zoom-controls button {
    cursor: pointer;
}

/* --- 表面／裏面の切り替え --- */
#designEditorModal .wde-side-switch {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 15px;
    flex-wrap: wrap;
}
#designEditorModal .wde-side-tab {
    padding: 5px 14px;
    background: #555;
    color: #fff;
    border: 1px solid #777;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.9rem;
}
#designEditorModal .wde-side-tab.active {
    background: #ff6600;
    border-color: #ff6600;
    font-weight: bold;
}
#designEditorModal .wde-back-toggle {
    margin-left: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    white-space: nowrap;
}
#designEditorModal .wde-back-select-wrap {
    margin-left: 8px;
    font-size: 0.85rem;
    white-space: nowrap;
}
#designEditorModal .wde-back-select-wrap select {
    max-width: 360px;
    padding: 3px 5px;
    font-size: 0.85rem;
    color: #333;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 3px;
}
@media screen and (max-width: 900px) {
    #designEditorModal .wde-back-select-wrap {
        white-space: normal;
    }
    #designEditorModal .wde-back-select-wrap select {
        max-width: 100%;
    }
}
#designEditorModal .wde-back-note {
    font-size: 0.75rem;
    color: #ddd;
    margin-left: 6px;
}

/* --- フリーデザイン --- */
#designEditorModal .wde-orient-btn.active {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
}
#designEditorModal .wde-free-legend {
    font-size: 0.75rem;
    color: #555;
    line-height: 1.5;
    white-space: normal;
}
#designEditorModal .wde-free-legend > div {
    margin-bottom: 6px;
}
#designEditorModal .wde-legend-line {
    display: inline-block;
    width: 18px;
    height: 0;
    vertical-align: middle;
    margin-right: 5px;
    border-top: 2px solid;
}
/* 凡例の色は editor.js の WDE_GUIDE_COLORS と合わせる */
#designEditorModal .wde-legend-art {
    border-color: #ff0000;
    box-shadow: 0 3px 0 rgba(255, 0, 0, 0.2);
}
#designEditorModal .wde-legend-trim {
    border-color: #0068b7;
}
#designEditorModal .wde-legend-safe {
    border-top-style: dashed;
    border-color: #009944;
}
#designEditorModal .wde-legend-indent {
    display: inline-block;
    padding-left: 23px;
    color: #777;
}
#designEditorModal .wde-guide-note {
    color: #c0392b;
}

/* --- レスポンシブ対応 (SP/Tab) --- */
@media screen and (max-width: 900px) {
    #designEditorModal .editor-container {
        height: 100dvh;
    }
    #designEditorModal .editor-body {
        flex-direction: column;
    }
    #designEditorModal .editor-canvas-area {
        order: 1;
        width: 100%;
        height: 45%;
        border-bottom: 1px solid #ccc;
    }
    #designEditorModal .editor-panels {
        order: 2;
        width: 100%;
        height: 30%;
        border-left: none;
        border-bottom: 1px solid #ccc;
    }
    #designEditorModal .editor-toolbar {
        order: 3;
        width: 100%;
        height: 25%;
        border-right: none;
        display: flex;
        flex-direction: row;
        overflow-x: auto;
        white-space: nowrap;
        align-items: flex-start;
        padding: 5px;
    }
    #designEditorModal .editor-toolbar .tool-section {
        min-width: 160px;
        margin-right: 10px;
        margin-bottom: 0;
        border-bottom: none;
        border-right: 1px solid #ddd;
        padding-right: 10px;
    }
    #designEditorModal .editor-header {
        height: auto;
        flex-direction: column;
        padding: 10px 5px;
        gap: 10px;
    }
}

/* ==========================================================================
   マイデザイン一覧 [wde_my_designs] 用スタイル
   ========================================================================== */
.wde-my-designs-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}
.wde-my-designs-item {
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    background: #fff;
}
.wde-my-designs-thumb {
    width: 100%;
    aspect-ratio: 4 / 3;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.wde-my-designs-thumb img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.wde-my-designs-thumb.has-back {
    gap: 4px;
    padding: 4px;
}
.wde-my-designs-thumb.has-back figure {
    flex: 1;
    margin: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 0;
}
.wde-my-designs-thumb.has-back figure img {
    max-height: calc(100% - 1.4em);
}
.wde-my-designs-thumb figcaption {
    font-size: 0.75rem;
    color: #666;
}
.wde-my-designs-info {
    padding: 10px;
}
.wde-my-designs-product {
    font-weight: bold;
    margin: 0 0 5px;
}
.wde-my-designs-status,
.wde-my-designs-date {
    font-size: 0.85rem;
    color: #666;
    margin: 0 0 5px;
}
.wde-my-designs-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 8px;
}
.wde-my-designs-pager {
    margin-top: 15px;
    display: flex;
    gap: 5px;
}
.wde-my-designs-pager .current {
    font-weight: bold;
}
/* ==========================================================================
   必須オプション未選択時の「デザインを作成・編集する」ボタン
   ========================================================================== */
.wde-launch-btn.wde-launch-disabled,
.wde-launch-btn:disabled {
    background: #b5b5b5 !important;
    color: #fff !important;
    cursor: not-allowed !important;
    opacity: 0.85;
}
.wde-required-note {
    display: block;
    max-width: 300px;
    margin: -4px 0 10px;
    color: #d63638;
    font-size: 0.85rem;
    line-height: 1.5;
}
/* 未選択の必須オプション（「デザイン完了してカートへ」／起動時に未選択だった項目） */
.wde-required-missing {
    outline: 2px solid #d63638 !important;
    outline-offset: 2px;
    background-color: #fff5f5 !important;
}

/* ==========================================================================
   左パネル（ツール）の開閉
   ========================================================================== */
#designEditorModal .tool-section h4.wde-acc-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
}
#designEditorModal .tool-section h4.wde-acc-head::after {
    content: '\25BE'; /* ▾ */
    font-size: 0.8rem;
    color: #666;
    margin-left: 6px;
    transition: transform 0.15s ease;
}
#designEditorModal .tool-section h4.wde-acc-head:hover {
    color: #005a87;
}
#designEditorModal .tool-section h4.wde-acc-head:focus-visible {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}
#designEditorModal .tool-section.wde-acc-collapsed {
    margin-bottom: 10px;
    padding-bottom: 10px;
}
#designEditorModal .tool-section.wde-acc-collapsed > h4.wde-acc-head {
    margin-bottom: 0;
}
#designEditorModal .tool-section.wde-acc-collapsed > h4.wde-acc-head::after {
    transform: rotate(-90deg);
}
#designEditorModal .tool-section.wde-acc-collapsed > .wde-acc-body {
    display: none;
}

/* ==========================================================================
   レイヤーのロック（PC・スマートフォン共通）
   ========================================================================== */
#designEditorModal #layer-list li .wde-layer-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
#designEditorModal #layer-list li .wde-layer-lock {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 26px;
    margin-left: 6px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 4px;
    background: transparent;
    color: #aaa;
    cursor: pointer;
}
#designEditorModal #layer-list li .wde-layer-lock:hover {
    border-color: #ccc;
    color: #555;
}
#designEditorModal #layer-list li .wde-layer-lock.is-locked {
    color: #c0392b;
    background: #fdecea;
}
#designEditorModal #layer-list li.wde-layer-locked .wde-layer-name {
    color: #999;
}
#designEditorModal #layer-list li.wde-layer-locked {
    cursor: default;
}

/* ==========================================================================
   スマートフォン・タブレット用の操作画面（画面下のメニュー＋下から開くパネル）
   ・PC（幅901px以上）の表示は変更しない
   ・左パネルの各項目・右パネル（プロパティ／レイヤー）を、画面下のメニューから開くパネルで表示する
   ========================================================================== */
#designEditorModal .wde-mobile-nav,
#designEditorModal .wde-sheet-header,
#designEditorModal .wde-quickbar,
#designEditorModal #wde-back-print-panel,
#designEditorModal #wde-file-panel,
#designEditorModal .wde-zoom-history {
    display: none;
}

@media screen and (max-width: 900px) {
    /* --- ヘッダー：1行ずつ横スクロール --- */
    #designEditorModal .editor-header {
        flex-direction: column;
        align-items: stretch;
        height: auto;
        padding: 6px 8px;
        gap: 6px;
        font-size: 0.85rem;
    }
    #designEditorModal .editor-header > div {
        display: flex;
        flex-wrap: nowrap;
        align-items: center;
        gap: 6px;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    #designEditorModal .editor-header > div::-webkit-scrollbar {
        display: none;
    }
    #designEditorModal .editor-header button {
        margin-left: 0 !important;
        margin-right: 0 !important;
        flex-shrink: 0;
        min-height: 36px;
        font-size: 0.85rem;
    }
    #designEditorModal .editor-header > div:last-child {
        justify-content: flex-end;
    }
    /* 1行目：見出し（「デザイン編集（表面）」）と案内文は省き、表面／裏面・元に戻す等を並べる */
    #designEditorModal .editor-header > div:first-child {
        font-size: 0;
    }
    #designEditorModal .editor-header > div:first-child button {
        font-size: 0.85rem;
    }
    #designEditorModal .editor-header > div:first-child #editor_target_name,
    #designEditorModal .editor-header .wde-back-note {
        display: none;
    }
    #designEditorModal .wde-side-switch {
        margin-left: 0;
        flex-wrap: nowrap;
    }

    /* --- 本体：キャンバスを大きく表示し、左右のパネルは下から開くパネルに --- */
    #designEditorModal .editor-body {
        flex-direction: column;
        position: relative;
    }
    #designEditorModal .editor-body > .editor-canvas-area {
        order: 1;
        flex: 1;
        width: 100%;
        height: auto;
        min-height: 0;
        border-bottom: none;
        padding: 64px 12px 12px; /* 上は操作バー（元に戻す／削除）の分 */
    }
    #designEditorModal .editor-body > .editor-toolbar,
    #designEditorModal .editor-body > .editor-panels {
        display: none;
    }
    #designEditorModal .editor-container.wde-sheet-open .editor-body > .wde-sheet-host {
        display: block;
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: auto;
        max-height: 55%;
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        background: #fff;
        border: none;
        border-radius: 14px 14px 0 0;
        box-shadow: 0 -4px 18px rgba(0, 0, 0, 0.25);
        padding: 0 14px 14px;
        white-space: normal;
        z-index: 20;
    }
    /* 開いた項目以外は表示しない */
    #designEditorModal .wde-sheet-host > .tool-section:not(.wde-sheet-active),
    #designEditorModal .wde-sheet-host > .panel-block:not(.wde-sheet-active) {
        display: none !important;
    }
    #designEditorModal .wde-sheet-host > .tool-section.wde-sheet-active,
    #designEditorModal .wde-sheet-host > .panel-block.wde-sheet-active {
        display: block !important;
        min-width: 0;
        margin: 0;
        padding: 0;
        border: none;
    }
    /* パネル内では見出し（開閉）を使わず、中身を常に表示する（見出しはパネル上部に表示） */
    #designEditorModal .wde-sheet-host > .wde-sheet-active > h4.wde-acc-head,
    #designEditorModal .wde-sheet-host > .wde-sheet-active > .panel-title {
        display: none;
    }
    #designEditorModal .wde-sheet-host > .wde-sheet-active > .wde-acc-body {
        display: block !important;
    }

    /* パネル上部（つまみ・見出し・閉じる） */
    #designEditorModal .wde-sheet-host > .wde-sheet-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        position: sticky;
        top: 0;
        z-index: 1;
        background: #fff;
        margin: 0 -14px 10px;
        padding: 16px 14px 8px;
        border-bottom: 1px solid #eee;
    }
    #designEditorModal .wde-sheet-header::before {
        content: '';
        position: absolute;
        top: 6px;
        left: 50%;
        width: 40px;
        height: 4px;
        margin-left: -20px;
        border-radius: 2px;
        background: #ccc;
    }
    #designEditorModal .wde-sheet-title {
        font-weight: bold;
        font-size: 1rem;
        color: #333;
    }
    #designEditorModal .wde-sheet-close {
        width: 36px;
        height: 36px;
        border: none;
        border-radius: 50%;
        background: #f0f0f0;
        color: #333;
        font-size: 1.1rem;
        line-height: 1;
        cursor: pointer;
    }

    /* --- 裏面印刷のパネル（上部から移した「裏面印刷あり」チェック・「裏面印刷」選択欄） --- */
    #designEditorModal .wde-back-print-body .wde-back-toggle,
    #designEditorModal .wde-back-print-body .wde-back-select-wrap {
        display: block;
        margin: 0 0 12px;
        font-size: 1rem;
        color: #333;
        white-space: normal;
    }
    #designEditorModal .wde-back-print-body .wde-back-toggle input {
        width: 20px;
        height: 20px;
        vertical-align: middle;
        margin-right: 6px;
    }
    #designEditorModal .wde-back-print-body .wde-back-select-wrap select {
        display: block;
        width: 100%;
        max-width: 100%;
        margin-top: 6px;
        padding: 8px;
        min-height: 44px;
    }

    /* --- 画面下のメニュー --- */
    #designEditorModal .wde-mobile-nav {
        display: flex;
        flex-shrink: 0;
        gap: 2px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        background: #fff;
        border-top: 1px solid #ddd;
        padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
        position: relative;
        z-index: 21;
    }
    #designEditorModal .wde-mobile-nav::-webkit-scrollbar {
        display: none;
    }
    #designEditorModal .wde-mobile-nav-item {
        flex: 0 0 auto;
        min-width: 64px;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2px;
        padding: 6px 6px 4px;
        border: none;
        border-radius: 10px;
        background: transparent;
        color: #444;
        font-size: 11px;
        line-height: 1.2;
        cursor: pointer;
        position: relative;
    }
    #designEditorModal .wde-mobile-nav-item svg {
        width: 24px;
        height: 24px;
    }
    #designEditorModal .wde-mobile-nav-item.active {
        color: #0073aa;
        background: #e6f2f8;
        font-weight: bold;
    }
    #designEditorModal .wde-mobile-nav-item[hidden] {
        display: none;
    }
    /* オブジェクト選択中は「調整」に印を付ける */
    #designEditorModal .wde-mobile-nav-item.wde-has-selection::after {
        content: '';
        position: absolute;
        top: 5px;
        right: 16px;
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: #ff6600;
    }

    /* --- キャンバス上の操作バー（元に戻す／削除） --- */
    #designEditorModal .wde-quickbar {
        display: flex;
        align-items: center;
        gap: 2px;
        position: absolute;
        top: 8px;
        left: 50%;
        transform: translateX(-50%);
        z-index: 5;
        padding: 3px 6px;
        background: #fff;
        border-radius: 26px;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
        white-space: nowrap;
    }
    #designEditorModal .wde-quickbar button {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 1px;
        min-width: 64px;
        min-height: 44px;
        padding: 3px 8px;
        border: none;
        border-radius: 20px;
        background: transparent;
        color: #333;
        font-size: 10px;
        line-height: 1.1;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }
    #designEditorModal .wde-quickbar button svg {
        width: 22px;
        height: 22px;
    }
    #designEditorModal .wde-quickbar button:active:not(:disabled) {
        background: #e6f2f8;
    }
    #designEditorModal .wde-quickbar button:disabled {
        opacity: 0.3;
        cursor: default;
    }
    #designEditorModal .wde-quickbar .wde-qb-delete:not(:disabled) {
        color: #c0392b;
    }
    /* 複数選択モード中はボタンを強調する */
    #designEditorModal .wde-quickbar .wde-qb-multi.active {
        background: #0073aa;
        color: #fff;
    }
    #designEditorModal .wde-quickbar .wde-qb-sep {
        width: 1px;
        height: 28px;
        margin: 0 3px;
        background: #ddd;
    }

    /* --- レイヤーのロック：タップしやすい大きさに --- */
    #designEditorModal #layer-list li {
        min-height: 44px;
    }
    #designEditorModal #layer-list li .wde-layer-lock {
        width: 40px;
        height: 36px;
    }

    /* --- タップしやすい大きさ・入力時にiPhoneで画面が拡大されない文字サイズ（16px以上） --- */
    #designEditorModal .editor-btn {
        min-height: 44px;
        font-size: 0.95rem;
    }
    #designEditorModal input[type="text"],
    #designEditorModal input[type="email"],
    #designEditorModal input[type="number"],
    #designEditorModal select,
    #designEditorModal textarea,
    #designEditorModal .wde-input-field,
    #designEditorModal .prop-input {
        font-size: 16px;
    }
    #designEditorModal .prop-label {
        width: 90px;
    }
    #designEditorModal .prop-color {
        height: 36px;
    }
    #designEditorModal .zoom-controls {
        bottom: 10px;
        right: 10px;
    }
    #designEditorModal .zoom-controls button {
        min-width: 36px;
        min-height: 32px;
    }

    /* --- 上部の「元に戻す」「やり直す」は倍率の横、「PCに保存」「読込」は画面下のメニュー「保存・読込」へ --- */
    #designEditorModal .editor-header .wde-hdr-history,
    #designEditorModal .editor-header .wde-hdr-file {
        display: none !important;
    }
    #designEditorModal .zoom-controls {
        align-items: center;
    }
    #designEditorModal .zoom-controls .wde-zoom-history {
        display: flex;
        gap: 5px;
        padding-right: 6px;
        margin-right: 1px;
        border-right: 1px solid #ccc;
    }
    #designEditorModal .zoom-controls .wde-zoom-history button {
        display: flex;
        align-items: center;
        justify-content: center;
        min-width: 40px;
        padding: 0 6px;
        color: #333;
    }
    #designEditorModal .zoom-controls .wde-zoom-history button:disabled {
        opacity: 0.35;
        cursor: default;
    }

    /* --- 保存・読込のパネル --- */
    #designEditorModal .wde-file-body .wde-file-note {
        margin: 0 0 12px;
        font-size: 0.9rem;
        color: #555;
        line-height: 1.5;
    }
    #designEditorModal .wde-file-body .editor-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        width: 100%;
        margin-bottom: 8px;
        font-weight: bold;
    }
    #designEditorModal .wde-file-body .editor-btn svg {
        width: 22px;
        height: 22px;
        flex-shrink: 0;
    }
    #designEditorModal .wde-file-body .wde-file-save {
        background: #0073aa;
        border-color: #0073aa;
        color: #fff;
    }
}

/* スマートフォンの横向き（高さが低い画面）：ヘッダーを1行に、パネルは右側から開く */
@media screen and (max-width: 900px) and (max-height: 500px) {
    #designEditorModal .editor-header {
        flex-direction: row;
        align-items: center;
    }
    #designEditorModal .editor-header > div:first-child {
        flex: 1 1 auto;
        min-width: 0;
    }
    #designEditorModal .editor-header > div:last-child {
        flex: 0 0 auto;
    }
    #designEditorModal .editor-header button {
        min-height: 32px;
        padding-top: 4px !important;
        padding-bottom: 4px !important;
    }
    #designEditorModal .editor-body > .editor-canvas-area {
        padding-top: 50px;
    }
    #designEditorModal .editor-container.wde-sheet-open .editor-body > .wde-sheet-host {
        top: 0;
        bottom: 0;
        left: auto;
        right: 0;
        width: min(420px, 55%);
        max-height: none;
        border-radius: 14px 0 0 14px;
        box-shadow: -4px 0 18px rgba(0, 0, 0, 0.25);
    }
    #designEditorModal .wde-mobile-nav {
        padding-top: 2px;
        padding-bottom: calc(2px + env(safe-area-inset-bottom, 0px));
    }
    #designEditorModal .wde-mobile-nav-item {
        padding: 3px 6px 2px;
    }
    #designEditorModal .wde-mobile-nav-item svg {
        width: 20px;
        height: 20px;
    }
    #designEditorModal .wde-quickbar {
        top: 4px;
    }
    /* 倍率欄：横幅をとらないよう「元に戻す」「やり直す」を上の段に置く（キャンバスに重ならないように） */
    #designEditorModal .zoom-controls {
        display: grid;
        grid-template-columns: repeat(4, auto);
        align-items: center;
    }
    #designEditorModal .zoom-controls .wde-zoom-history {
        grid-column: 1 / -1;
        justify-self: end;
        padding-right: 0;
        margin-right: 0;
        border-right: none;
    }
    #designEditorModal .wde-quickbar button {
        min-height: 38px;
    }
    #designEditorModal .wde-quickbar button svg {
        width: 18px;
        height: 18px;
    }
}

/* PC：上部のバー（裏面印刷の選択欄がある商品で、ボタンがバーからはみ出してキャンバスに重ならないようにする） */
@media screen and (min-width: 901px) {
    #designEditorModal .editor-header {
        height: auto;
        min-height: 50px;
        flex-wrap: wrap;
        gap: 6px 10px;
    }
    #designEditorModal .editor-header > div:first-child {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        row-gap: 6px;
    }
    #designEditorModal .wde-back-select-wrap select {
        max-width: 240px;
    }
}
