/*
 * (c) RE:SML
 * 無断での改変、再配布を禁じます。
 */

/* 全体設定 */
:root {
    --main-color: #2c3e50;
    --accent-color: #3498db;
    --background-color: #f8f9fa;
    --text-color: #2c3e50;
    --highlight-color: #e67e22;
    --border-color: #dcdcdc;
}

/* === 修正D: ワークショップ用コンパクトモード === */
body.compact #app-container {
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    max-height: 100vh;
    border-radius: 0;
    box-shadow: none;
    background-color: transparent;
}

body.compact .screen { 
    padding: 0; 
}

/* 【修正】サブタイマー情報と下部メニューの重なり解消のため、下部にパディングを追加 */
body.compact #main-screen.active { 
    padding: 0 0 70px 0; /* 下部に70pxのパディングを追加 */
}

/* 数字をさらに大きく（縦横に依存） */
body.compact #main-timer-display {
    font-size: clamp(6em, 35vmin, 22em);
}

body.compact body.clock-mode #main-timer-display {
    font-size: clamp(8em, 45vmin, 28em);
}

/* サブ表示は控えめ＆行間タイト */
body.compact #sub-timer-info .sub-display {
    /* 【修正】フォントサイズを現在の1.5倍に */
    font-size: clamp(1.5em, 3.0vw, 1.95em);
    margin: 0.2vh 0;
}

/* 操作ボタンを画面下に固定 */
body.compact .controls {
    position: fixed;
    left: 0; 
    right: 0; 
    bottom: 0;
    padding: 8px 10px;
    background: rgba(255,255,255,0.75);
    backdrop-filter: blur(8px);
    gap: 8px;
    z-index: 200;
}

/* 設定FABも端っこキープ */
body.compact .fab-btn { 
    bottom: 70px; 
    left: 10px; 
}

/* コンパクトモード時の人数カウンター位置調整 */
body.compact #person-counter-container {
    /* 【修正】フォントサイズを現在の1.5倍に */
    top: 12vh !important;
    font-size: clamp(1.5em, 3.75vw, 2.7em) !important;
}

body {
    font-family: 'Segoe UI', 'Helvetica Neue', Arial, 'Hiragino Sans', 'Noto Sans CJK JP', sans-serif;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: var(--background-color);
    color: var(--text-color);
    transition: background-image 0.5s ease-in-out;
}

/* 修正1: app-containerを画面に合わせて動的にサイズ調整 */
#app-container {
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    width: 95vw;
    height: 95vh;
    max-width: 95vw;
    max-height: 95vh;
    box-sizing: border-box;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow-y: auto;
}

.screen {
    width: 100%;
    height: 100%;
    display: none;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    padding: 20px;
    box-sizing: border-box;
    -webkit-overflow-scrolling: touch;
}

.screen.active {
    display: flex;
}

#main-screen.active {
    justify-content: center;
    align-items: center;
    padding: 10px; /* パディングを最小限に */
    position: relative; /* 子要素の絶対配置のため */
}

/* 【修正】メイン画面要素 - 人数カウンター位置調整 */
#person-counter-container {
    /* 【修正】フォントサイズを現在の1.5倍に */
    font-size: clamp(1.8em, 4.5vw, 3em);
    font-weight: bold;
    color: var(--highlight-color);
    letter-spacing: 1px;
    display: flex;
    align-items: baseline;
    z-index: 10;
    
    /* 【修正】位置調整 - 縦中央より少し上に配置 */
    position: absolute;
    top: 15vh;
    left: 50%;
    transform: translateX(-50%);
}

#person-count {
    font-family: 'Courier New', monospace;
    display: inline-block;
    min-width: 30px;
    text-align: right;
}

#person-label {
    margin-left: 5px;
}

/* 修正2: メインタイマーの超大型表示（容器も含めて調整） */
#main-timer-display {
    font-family: 'Courier New', monospace;
    font-weight: bold;
    color: var(--main-color);
    letter-spacing: 2px;
    font-size: clamp(4em, 25vmin, 15em);
    text-align: center;
    width: 100%;
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    box-sizing: border-box;
    /* 文字が切れないよう、コンテナサイズに合わせる */
    word-break: keep-all;
    white-space: nowrap;
    overflow: visible; /* はみ出しを許可 */
    
    /* 【追加】人数カウンターとの間隔調整 */
    margin-top: 8vh;
}

/* 時計モード時のフォントサイズをさらに大きく */
body.clock-mode #main-timer-display {
    font-size: clamp(6em, 35vmin, 20em);
}

/* 【修正】サブ表示の強制表示とスタイル調整 */
#sub-timer-info {
    text-align: center;
    margin-top: 2vh;
    margin-bottom: 2vh;
    z-index: 1;
    
    /* 【追加】表示を確実にする */
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    min-height: 60px; /* 最小高さを確保 */
}

.sub-display {
    /* 【修正】フォントサイズを現在の1.5倍に */
    font-size: clamp(1.5em, 3.75vw, 2.25em);
    color: var(--text-color);
    margin: 0.3vh 0;
    
    /* 【追加】表示を確実にする */
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    line-height: 1.4;
}

.controls {
    display: flex;
    gap: 10px;
    margin-top: 1vh;
    flex-wrap: wrap;
    justify-content: center;
    z-index: 1;
}

/* 修正3: ボタンのz-indexとポインターイベントを確実に */
.control-btn, .action-btn {
    background-color: var(--accent-color);
    color: white;
    border: none;
    border-radius: 8px;
    padding: clamp(8px, 2vw, 12px) clamp(15px, 3vw, 20px);
    font-size: clamp(0.8em, 1.5vw, 1em);
    cursor: pointer;
    min-width: clamp(70px, 12vw, 90px);
    min-height: clamp(35px, 6vw, 40px);
    transition: background-color 0.2s ease, transform 0.1s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    font-weight: bold;
    z-index: 100; /* 確実に上に表示 */
    pointer-events: auto; /* ポインターイベントを確実に有効に */
    position: relative; /* z-indexを有効にするため */
}

.control-btn:hover:not(:disabled), .action-btn:hover:not(:disabled) {
    background-color: #2980b9;
    transform: translateY(-2px);
}

.control-btn:active:not(:disabled), .action-btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.control-btn:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.control-btn.primary-btn {
    background-color: var(--highlight-color);
}

.control-btn.primary-btn:hover:not(:disabled) {
    background-color: #d35400;
}

/* 設定ボタンの位置調整 */
.fab-btn {
    position: absolute;
    bottom: 15px;
    left: 15px;
    background-color: var(--accent-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.5em;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: background-color 0.2s ease, transform 0.2s ease;
    z-index: 200; /* 最前面に表示 */
    pointer-events: auto;
}

.fab-btn:hover {
    background-color: #2980b9;
    transform: rotate(90deg);
}

/* 【修正】設定画面の横幅を調整 */
#settings-screen {
    justify-content: flex-start;
    overflow-y: auto;
    padding-bottom: 80px; /* 戻るボタンのスペース */
    
    max-width: 700px; /* デスクトップでの最大幅を制限 */
    margin: 0 auto; /* 中央寄せ */
    padding: 20px; /* 既存のパディングを維持 */
    box-sizing: border-box; /* パディングを幅に含める */
}

.settings-title {
    color: var(--main-color);
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.8em;
}

.settings-section {
    width: 100%;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.settings-section:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
}

.settings-section h3 {
    color: var(--main-color);
    font-size: 1.1em;
    margin-top: 0;
    margin-bottom: 10px;
    border-left: 4px solid var(--accent-color);
    padding-left: 10px;
}

.setting-item {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.9em;
    flex-wrap: wrap;
}

.setting-item label:not(.toggle-switch) {
    margin-right: 8px;
    flex-shrink: 0;
    white-space: nowrap;
    font-size: 0.85em;
}

.setting-item input[type="text"],
.setting-item input[type="number"],
.setting-item select {
    flex-grow: 1;
    padding: 6px 8px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.85em;
    color: var(--text-color);
    background-color: white;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: border-color 0.2s ease;
    min-width: 50px;
}

.setting-item input[type="text"]:focus,
.setting-item input[type="number"]:focus,
.setting-item select:focus {
    border-color: var(--accent-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

/* 修正4: ファイル選択ボタンの追加 */
.file-select-container {
    display: flex;
    gap: 5px;
    align-items: center;
    flex-wrap: wrap;
    width: 100%; /* 親要素の幅いっぱいに広げる */
}

.file-input-btn {
    background-color: var(--accent-color);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 0.75em;
    cursor: pointer;
    white-space: nowrap;
}

.file-input-btn:hover {
    background-color: #2980b9;
}

.file-input-hidden {
    display: none;
}

.current-file-display {
    font-size: 0.75em;
    color: #666;
    font-style: italic;
    margin-left: 5px;
    white-space: nowrap; /* 長いファイル名でも改行しない */
    overflow: hidden; /* はみ出した部分は隠す */
    text-overflow: ellipsis; /* ...で表示 */
    flex-shrink: 1; /* 必要に応じて縮小 */
}

/* 【追加】タイマー設定アクションボタン群のコンテナ */
.timer-config-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
    justify-content: flex-start; /* 左寄せ */
}

/* 修正5: 保存状況表示 */
.save-status {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: #27ae60;
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 0.8em;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1000;
}

.save-status.show {
    opacity: 1;
}

.save-status.error {
    background-color: #e74c3c;
}

small {
    color: #777;
    margin-left: 5px;
}

/* タイマーリスト */
#timers-list {
    margin-bottom: 10px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.timer-item {
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    padding: 8px;
    font-size: 0.85em;
}

.timer-item h4 {
    margin: 0 0 5px 0;
    color: var(--main-color);
    font-size: 0.9em;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 5px;
    border-bottom: 1px solid #eee;
}

.timer-item label {
    display: flex;
    align-items: center;
    gap: 5px;
    margin: 3px 0;
    font-size: 0.8em;
}

.timer-item label input,
.timer-item label select {
    flex-grow: 1;
    font-size: 0.8em;
    padding: 3px 5px;
    height: 24px;
    box-sizing: border-box;
}

.timer-name-short {
    flex-grow: 1;
    min-width: 50px;
}

.timer-item .remove-timer-btn {
    background-color: #e74c3c;
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.7em;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.2s ease;
    line-height: 1;
}

.timer-item .remove-timer-btn:hover {
    background-color: #c0392b;
}

/* トグルスイッチ */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 35px;
    height: 18px;
    margin-right: 8px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 12px;
    width: 12px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
}

input:checked + .slider {
    background-color: var(--accent-color);
}

input:checked + .slider:before {
    transform: translateX(17px);
}

.slider.round {
    border-radius: 18px;
}

.slider.round:before {
    border-radius: 50%;
}

/* 設定画面のフッター */
#settings-footer {
    /* 【修正】設定画面の最大幅に合わせて調整 */
    width: 100%; /* 親要素(settings-screen)の幅に合わせる */
    margin-left: 0; /* 不要なマイナスmarginを削除 */
    margin-right: 0; /* 不要なマイナスmarginを削除 */
    padding: 15px 20px 10px;
    border-top: 1px solid var(--border-color);
    background-color: rgba(255, 255, 255, 0.95);
    position: sticky;
    bottom: 0;
    text-align: center;
    z-index: 10;
    box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.05);
}

#settings-screen #back-to-main-btn {
    width: 100%;
    max-width: 300px;
    background-color: var(--highlight-color);
    margin: 0;
}

#settings-screen #back-to-main-btn:hover {
    background-color: #d35400;
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
    #app-container {
        width: 98vw;
        height: 98vh;
    }

    .screen {
        padding: 15px;
    }

    #main-screen.active {
        padding: 8px 8px 70px 8px; /* コンパクトモードと同じように下部にパディングを追加 */
    }
    
    /* 【修正】設定画面は狭い画面では幅いっぱいに表示 */
    #settings-screen {
        max-width: 100%;
        margin: 0;
    }

    #person-counter-container {
        /* 【修正】フォントサイズを現在の1.5倍に */
        top: 10vh !important;
        font-size: clamp(1.5em, 3.75vw, 2.4em) !important;
    }

    #main-timer-display {
        margin-top: 6vh;
        font-size: clamp(3em, 20vmin, 12em);
    }

    body.clock-mode #main-timer-display {
        font-size: clamp(5em, 30vmin, 15em);
    }

    #sub-timer-info {
        margin-top: 1.5vh;
        min-height: 50px;
    }

    .controls {
        gap: 8px;
    }

    .control-btn {
        padding: 6px 10px;
        font-size: 0.75em;
        min-width: 60px;
        min-height: 32px;
    }

    .fab-btn {
        width: 40px;
        height: 40px;
        font-size: 1.3em;
        bottom: 10px;
        left: 10px;
    }

    .settings-title {
        font-size: 1.5em;
    }

    .setting-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .setting-item label:not(.toggle-switch) {
        margin-right: 0;
        margin-bottom: 3px;
    }

    .setting-item input[type="text"],
    .setting-item input[type="number"],
    .setting-item select {
        width: 100%;
    }

    .file-select-container {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    #person-counter-container {
        /* 【修正】フォントサイズを現在の1.5倍に */
        top: 8vh !important;
        font-size: clamp(1.35em, 3vw, 2.1em) !important;
    }

    #main-timer-display {
        margin-top: 5vh;
        font-size: clamp(2.5em, 18vmin, 8em);
    }

    body.clock-mode #main-timer-display {
        font-size: clamp(4em, 25vmin, 12em);
    }

    #sub-timer-info {
        margin-top: 1vh;
        min-height: 40px;
    }

    .control-btn {
        min-width: 50px;
        padding: 5px 8px;
        font-size: 0.7em;
    }

    .fab-btn {
        width: 35px;
        height: 35px;
        font-size: 1.1em;
        bottom: 60px !important; /* 【修正】コントロールバーと被らないよう位置調整 */
    }
    
    /* 【修正】ストップウォッチ表示 */
    #stopwatch-display {
        font-size: clamp(3em, 14vw, 8em) !important;
    }
}

/* ワーク名と時間表示のスタイル */
.work-name-display {
    font-size: clamp(1.2em, 2.5vw, 1.8em);
    font-weight: 600;
    color: var(--main-color);
    display: block;
    margin-bottom: 0.3em;
}

.time-display {
    font-size: clamp(1em, 2vw, 1.5em);
    color: var(--text-color);
    display: block;
}

/* コンパクトモード時 */
body.compact .work-name-display {
    font-size: clamp(1.5em, 3vw, 2.4em);
}

body.compact .time-display {
    font-size: clamp(1.3em, 2.5vw, 2em);
}
/* 視覚警告のスタイル */
body.visual-warning-10 {
    background-color: rgba(255, 255, 0, 0.1) !important;
}

body.visual-warning-5 {
    background-color: rgba(255, 165, 0, 0.2) !important;
}

body.visual-warning-3 {
    background-color: rgba(255, 0, 0, 0.3) !important;
    animation: warning-pulse 1s infinite;
}

@keyframes warning-pulse {
    0%, 100% {
        background-color: rgba(255, 0, 0, 0.3);
    }
    50% {
        background-color: rgba(255, 0, 0, 0.5);
    }
}

/* タイマー設定のスタイル */
.timer-row {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 15px;
    background-color: #f9f9f9;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 10px;
}

.timer-label {
    font-weight: bold;
    color: var(--main-color);
    font-size: 1.1em;
}

.timer-name-input {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.95em;
}

.timer-field-label {
    font-weight: 600;
    color: var(--text-color);
    margin-top: 5px;
}

.timer-duration-input,
.timer-interval-input {
    width: 120px;
    padding: 6px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.timer-preset-container {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin: 5px 0;
}

.timer-preset-btn {
    padding: 4px 8px;
    font-size: 0.75em;
    background-color: #e0e0e0;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.timer-preset-btn:hover {
    background-color: #d0d0d0;
}

.delete-timer-btn {
    padding: 6px 12px;
    background-color: #e74c3c;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85em;
    margin-top: 5px;
    align-self: flex-start;
}

.delete-timer-btn:hover {
    background-color: #c0392b;
}

/* 縦画面（ポートレート）専用の調整 */
@media (max-width: 768px) and (orientation: portrait) {
    #main-timer-display {
        font-size: clamp(2.5em, 18vmin, 10em);
        margin-top: 4vh;
    }
    
    #person-counter-container {
        top: 8vh !important;
        font-size: clamp(1.3em, 3vw, 2em) !important;
    }
    
    #sub-timer-info {
        margin-top: 1vh;
        font-size: clamp(0.9em, 2vw, 1.2em);
    }
    
    .controls {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        padding: 8px;
        background: rgba(255,255,255,0.95);
        gap: 6px;
        justify-content: center;
        z-index: 200;
    }
    
    .control-btn {
        padding: 8px 12px;
        font-size: 0.7em;
        min-width: auto;
        flex: 1;
        max-width: 80px;
    }
    
    /* 【修正】ストップウォッチ表示が切れないよう横幅ベースでフォントサイズ制限 */
    #stopwatch-display {
        font-size: clamp(5em, 20vw, 12em) !important;
        padding: 0 10px;
        box-sizing: border-box;
    }
    
    body.compact #stopwatch-display {
        font-size: clamp(3em, 14vw, 8em) !important;
    }
    
    /* 【修正】設定ボタン(FAB)がコントロールボタンと被らないよう位置調整 */
    .fab-btn {
        bottom: 65px !important;
        left: 10px;
    }
    
    body.compact .fab-btn {
        bottom: 65px !important;
    }
}

/* 横画面（ランドスケープ）での調整 */
@media (max-width: 768px) and (orientation: landscape) {
    #main-timer-display {
        font-size: clamp(3em, 25vmin, 14em);
    }
    
    #person-counter-container {
        top: 5vh !important;
    }
    
    .controls {
        gap: 10px;
    }
}

/* 非常に小さい画面用 */
@media (max-width: 360px) {
    .control-btn {
        font-size: 0.65em;
        padding: 6px 8px;
        min-width: 50px;
    }
    
    #sub-timer-info {
        font-size: clamp(0.8em, 1.8vw, 1em);
    }
    
    /* 【修正】小さい画面でのストップウォッチ表示 */
    #stopwatch-display {
        font-size: clamp(2.5em, 13vw, 6em) !important;
        padding: 0 8px;
    }
    
    body.compact #stopwatch-display {
        font-size: clamp(2.5em, 13vw, 6em) !important;
    }
    
    /* 【修正】FABボタンの位置 */
    .fab-btn {
        bottom: 60px !important;
        width: 32px;
        height: 32px;
        font-size: 1em;
    }
}

/* ストップウォッチモードのスタイル */
#stopwatch-ui-container {
    width: 100%;
    height: 100%;
}

#stopwatch-section {
    text-align: center;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    border: none;
    background-color: transparent;
}

#stopwatch-section h3 {
    font-size: 1.5em;
    margin-bottom: 10px;
    color: var(--main-color);
}

.stopwatch-display-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

#stopwatch-display {
    font-size: clamp(8em, 40vmin, 25em);
    font-weight: bold;
    color: var(--highlight-color);
    margin: 20px 0;
}

/* コンパクトモード時のストップウォッチ表示 */
body.compact #stopwatch-display {
    font-size: clamp(8em, 40vmin, 25em);
}

.stopwatch-controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 15px;
}

.stopwatch-controls .action-btn {
    padding: 10px 20px;
    font-size: 1em;
}

@media (max-width: 768px) {
    #stopwatch-display {
        font-size: clamp(4em, 16vw, 12em);
        padding: 0 10px;
        box-sizing: border-box;
    }
    
    .stopwatch-controls {
        gap: 10px;
    }
    
    .stopwatch-controls .action-btn {
        padding: 8px 16px;
        font-size: 0.9em;
    }
    
    /* モバイル時のサブ表示を改行 */
    #remaining-time-display {
        display: block;
        line-height: 1.4;
        white-space: pre-wrap;
        word-break: break-word;
    }
    
    /* モバイル時の設定画面調整 */
    .setting-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5em;
    }
    
    .file-select-container {
        flex-direction: column;
        width: 100%;
    }
    
    .file-select-container .action-btn {
        width: 100%;
    }
}

/* クリアボタンのスタイル */
.clear-btn {
    background-color: #e74c3c;
    color: white;
}

.clear-btn:hover {
    background-color: #c0392b;
}

.small-btn {
    padding: 5px 10px;
    font-size: 0.85em;
}

/* 色入力のスタイル */
input[type="color"] {
    width: 60px;
    height: 35px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    padding: 2px;
}

input[type="color"]:hover {
    border-color: var(--accent-color);
}

/* ファイル選択コンテナのスタイル改善 */
.file-select-container {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.media-file-name {
    color: var(--text-color);
    font-size: 0.9em;
    padding: 5px 10px;
    background-color: rgba(52, 152, 219, 0.1);
    border-radius: 4px;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* プリセット情報のスタイル */
.preset-info {
    margin-top: 15px;
    padding: 10px;
    background-color: rgba(127, 140, 141, 0.1);
    border-radius: 4px;
    border-left: 3px solid #7f8c8d;
}