/*---------------------------------------------*/
/* 1. アコーディオン & 外枠デザイン */
/*---------------------------------------------*/
/* 1. デフォルト設定：スライダーがない時（H2直下など）は上に余白を作る */
.comp-accordion {
    margin: 15px 0 10px 0 !important; /* 上に15px、下に10pxの余白 */
    border: 1px solid #e0e0e0;
    background: #fff;
    border-radius: 6px;
    box-sizing: border-box !important;
}

/* 2. 条件付き設定：スライダーの直後にアコーディオンが来た時だけ、上の余白を0にする */
.audio-sliders-container + .comp-accordion {
    margin-top: 0 !important;
}

/* ヘッダー：グレーのフラットバー */
.comp-toggle {
    display: block;
    width: 100%;
    padding: 4px 20px;
    background-color: #f5f5f5;
    color: #333;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    border-bottom: 1px solid #e0e0e0;
    transition: background 0.2s;
    box-sizing: border-box !important;
}
.comp-toggle:hover {
    background-color: #ededed;
}

/* 内部コンテンツ：余白を確保しつつ溢れを防止 */
.comp-content {
    padding: 25px !important;
    background: #fff;
    box-sizing: border-box !important;
}

/*---------------------------------------------*/
/* 2. 検索UI & 操作エリア */
/*---------------------------------------------*/
.comp-ui-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 15px;
    flex-wrap: wrap; /* スマホ対策 */
}

#comp-search-wrap {
    flex: 1;
    min-width: 250px; /* 極端に狭くなるのを防止 */
    position: relative;
    box-sizing: border-box !important;
}

.input-inner-wrap {
    position: relative;
    width: 100%;
    box-sizing: border-box !important;
}

/* 入力フォーム：溢れ対策（border-boxを徹底） */
.comp-input {
    width: 100% !important;
    padding: 10px 15px !important;
    border: 1px solid #ccc !important;
    border-radius: 6px !important;
    font-size: 15px !important;
    outline: none !important;
    box-sizing: border-box !important; /* これが溢れ防止の要 */
    display: block !important;
}

/* 検索結果リスト：浮き上がりを強調 */
.comp-results {
    display: none;
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    right: 0;
    z-index: 1000;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    max-height: 250px;
    overflow-y: auto;
}

.comp-item {
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    font-size: 14px;
}
.comp-item:hover { background: #f0f7ff; color: #0077B3; }

/* 履歴エリア：チップデザイン */
.comp-history-area { margin-top: 15px; }
.history-label {
    font-size: 10px;
    color: #aaa;
    letter-spacing: 0.1em;
    margin-bottom: 8px;
    font-weight: bold;
}
.history-chip {
    display: inline-block;
    background: #f0f0f0;
    color: #444;
    padding: 4px 12px;
    margin: 0 8px 8px 0;
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}
.history-chip:hover { background: #e5e5e5; }

/*---------------------------------------------*/
/* 3. ボタン & 確定バッジ（サイトカラー適用） */
/*---------------------------------------------*/
.comp-btn-wrap {
    display: flex;
    gap: 10px;
    align-items: center;
}

.comp-btn {
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid #0077B3 !important;
}

.btn-this {
    background: #fff !important;
    color: #0077B3 !important;
}
.btn-this:hover { background: #f0faff !important; }

.btn-all {
    background: #0077B3 !important;
    color: #fff !important;
}
.btn-all:hover { background: #005f8d !important; transform: translateY(-1px); }

/* 確定後のバッジ */
.locked-name-badge {
    display: inline-flex;
    align-items: center;
    background: #fff !important;
    border: 2px solid #0077B3 !important;
    color: #0077B3 !important;
    padding: 6px 14px !important;
    border-radius: 20px !important;
    font-weight: bold;
}

.comp-reset-x {
    margin-left: 10px;
    background: transparent !important;
    border: none;
    color: #ccc !important;
    font-size: 18px;
    cursor: pointer;
    line-height: 1;
}
.comp-reset-x:hover { color: #ff5252 !important; }

/* . 下部閉じるボタン */
    .comp-close-bottom-wrap {
        display: block;
        margin-top: 20px;
        text-align: center;
    }

    .comp-close-bottom {
        width: 100%;
        padding: 10px;
        background: #f5f5f5;
        border: 1px solid #ddd;
        border-radius: 4px;
        color: #666;
        font-size: 11px;
        font-weight: bold;
        cursor: pointer;
    }

/*---------------------------------------------*/
/* 4. 比較結果エリア（ミニマル圧縮） */
/*---------------------------------------------*/
.comparison-target-area {
    margin-top: 20px;
    padding: 20px;
    background-color: #f8f9fa !important;
    border: 1px solid #dee2e6 !important;
    border-radius: 8px;
}

/* スライダーの垂直圧縮 */
.comparison-target-area .audio-sliders-container {
    padding: 10px 15px !important;
    background: #fff !important;
    margin-bottom: 15px !important;
    border: 1px solid #eee !important;
    border-radius: 4px !important;
}

.comparison-target-area .audio-slider-row { padding: 2px 0 !important; }

.comparison-target-area .slider-label {
    font-size: 10px !important;
    line-height: 1 !important;
    color: #777 !important;
}

.comparison-target-area .slider-dot.is-active {
    background-color: #0077B3 !important; /* ここもサイトカラーに */
    width: 10px !important; height: 10px !important;
}

/* テキストボックスの圧縮デザイン */
.comparison-target-area .txt-box {
    border: 1px solid #d1d9e0 !important;
    border-top: 2px solid #546e7a !important;
    background: #fff !important;
    margin: 0 0 12px 0 !important;
    padding: 10px !important;
}

/* 白文字タイトルタグ */
.comparison-target-area .txt-title {
    background: #546e7a !important;
    color: #ffffff !important;
    font-size: 10.5px !important;
    padding: 2px 10px !important;
    border-radius: 0 0 4px 0 !important;
    margin: -10px 0 10px -10px !important;
    display: inline-block;
}

.comparison-target-area .txt-box .txt-inner,
.comparison-target-area .txt-box .txt-paragraph {
    font-size: 14px !important;
    line-height: 1.4 !important;
    border-left: 3px solid #90a4ae !important;
    background: #fcfdfe !important;
    padding: 5px 8px !important;
}

/* ぐるぐるスピナー */
.comp-spinner {
    width: 30px; height: 30px; border: 3px solid #ddd; border-top: 3px solid #0077B3;
    border-radius: 50%; margin: 20px auto; animation: spin 1s linear infinite;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }



/*---------------------------------------------*/
/* スマホ用最適化 (768px以下) */
/*---------------------------------------------*/
@media screen and (max-width: 768px) {
    /* 1. アコーディオンの横幅を広げる（左右余白を削る） */
    .comp-content {
        padding: 15px 8px !important; /* 25px -> 8px に大幅圧縮 */
    }

    /* 2. インデント解除 & テキストボックス最適化 */
    .comparison-target-area .txt-box {
        margin: 0 0 10px 0 !important;
        padding: 8px !important;
    }

    .comparison-target-area .txt-box .txt-inner,
    .comparison-target-area .txt-box .txt-paragraph {
        margin-left: 0 !important; /* インデント解除 */
        padding: 5px 8px !important;
        font-size: 13px !important; /* スマホでは微調整 */
    }

    .comparison-target-area .txt-title {
        margin: -8px 0 8px -8px !important; /* 親のpadding変更に追従 */
    }

    /* 3. スライダーの横幅合わせ */
    .comparison-target-area .audio-sliders-container {
        padding: 10px 5px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .comparison-target-area .slider-label {
        font-size: 9px !important; /* スマホでは限界まで小さく */
        white-space: nowrap;
    }

    /* 検索UIのボタンを縦並びまたはコンパクトに */
    .comp-ui-row {
        flex-direction: column;
        gap: 10px;
    }

    .comp-btn-wrap {
        width: 100%;
        justify-content: space-between;
    }

    .comp-btn {
        flex: 1;
        padding: 10px 5px !important;
        text-align: center;
    }
}
/* フルレビュー記事へのリンクエリア */
.comp-link-article-wrap {
    margin: 20px 0 10px;
    text-align: center;
}

.comp-link-article {
    display: inline-block;
    padding: 8px 20px;
    color: #0077B3 !important;
    text-decoration: none !important;
    font-size: 13px;
    font-weight: bold;
    border: 1px solid #0077B3;
    border-radius: 25px; /* 丸みを持たせてボタンらしく */
    transition: all 0.2s;
    background: #fff;
}

.comp-link-article:hover {
    background: #0077B3;
    color: #fff !important;
    box-shadow: 0 4px 8px rgba(0,119,179,0.2);
}

/* スマホでは横幅を広めにする */
@media screen and (max-width: 768px) {
    .comp-link-article {
        width: 100%;
        box-sizing: border-box;
        padding: 12px;
    }
}