/* ========================================================
   VAIO x Google Material Inspired UI (PC & SP 統合完全版)
======================================================== */

/* --------------------------------------------------------
   1. 全体ベース設定
-------------------------------------------------------- */
#f16f14_2604 {
    max-width: 900px;
    margin: 40px auto;
    font-family: 'Roboto', "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Meiryo", sans-serif;
    color: #202124;
}

/* --------------------------------------------------------
   2. PC版HTML（div構成）のレイアウト
-------------------------------------------------------- */
#f16f14_2604 .questionnaire_box_ {
    margin-bottom: 32px;
    padding: 24px;
    background: #fff;
    border: 1px solid #dadce0;
    border-radius: 8px;
}
#f16f14_2604 .common_headline2_ {
    font-size: 16px !important;
    font-weight: 500;
    color: #202124;
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    border: none;
    padding: 0;
}
#f16f14_2604 .common_headline2_ .must_ {
    height: 18px;
    margin-right: 12px;
    order: -1;
}
#f16f14_2604 .desc_ {
    font-size: 14px !important;
    color: #5f6368;
    margin-bottom: 24px;
    font-weight: normal;
}
#f16f14_2604 .questionnaire_box_content_ {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    position: relative;
}

/* --------------------------------------------------------
   3. スマホ版HTML（dl, dt, dd構成）のレイアウト
-------------------------------------------------------- */
#f16f14_2604 dl.questionnaire_input_ {
    margin: 0;
    padding: 0;
}
/* 見出し部分 (カード上部) */
#f16f14_2604 dt {
    background: #fff;
    border: 1px solid #dadce0;
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    padding: 24px 24px 8px 24px;
    font-size: 16px !important;
    font-weight: 500;
    color: #202124;
    display: flex;
    align-items: center;
    margin: 0;
}
#f16f14_2604 dt .must_ {
    height: 18px;
    margin-right: 12px;
    order: -1;
}
/* 選択肢部分 (カード下部) */
#f16f14_2604 dd {
    background: #fff;
    border: 1px solid #dadce0;
    border-top: none;
    border-radius: 0 0 8px 8px;
    padding: 0 24px 24px 24px;
    margin: 0 0 32px 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    position: relative;
}
#f16f14_2604 dd .comment_ {
    grid-column: 1 / -1;
    font-size: 14px !important;
    color: #5f6368;
    margin-bottom: 8px;
}
#f16f14_2604 dd > br {
    display: none;
}
#f16f14_2604 dd .error_ {
    grid-column: 1 / -1;
    color: #d93025;
    font-size: 13px;
}

/* --------------------------------------------------------
   4. 共通要素（選択肢ボタン・アイコン・入力欄）
-------------------------------------------------------- */
/* デフォルトのinputを非表示 */
#f16f14_2604 .questionnaire_box_content_ input,
#f16f14_2604 dd input {
    position: absolute !important;
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    pointer-events: none !important;
}

/* 選択肢ラベルのベーススタイル */
#f16f14_2604 .questionnaire_box_content_ label,
#f16f14_2604 dd label {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: #fff;
    border: 1px solid #dadce0;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #3c4043;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 48px;
    box-sizing: border-box;
}
#f16f14_2604 .questionnaire_box_content_ label:hover,
#f16f14_2604 dd label:hover {
    background: #f8f9fa;
}
#f16f14_2604 .questionnaire_box_content_ input:checked + label,
#f16f14_2604 dd input:checked + label {
    border-color: #000;
    background: #f8f9fa;
    color: #000;
    font-weight: bold;
}

/* アイコン設定 */
#f16f14_2604 .questionnaire_box_content_ label::before,
#f16f14_2604 dd label::before {
    content: "";
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-right: 12px;
    border: 2px solid #5f6368;
    flex-shrink: 0;
    transition: 0.2s ease;
    box-sizing: border-box;
}

/* ラジオボタン */
#f16f14_2604 input[type="radio"] + label::before { border-radius: 50%; }
#f16f14_2604 input[type="radio"]:checked + label::before {
    border-color: #000;
    border-width: 6px;
}

/* チェックボックス */
#f16f14_2604 input[type="checkbox"] + label::before { border-radius: 2px; }
#f16f14_2604 input[type="checkbox"]:checked + label::before {
    background-color: #000;
    border-color: #000;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
    background-size: 14px;
    background-position: center;
    background-repeat: no-repeat;
}

/* 自由記述 textarea */
#f16f14_2604 textarea {
    grid-column: 1 / -1;
    width: 100% !important;
    box-sizing: border-box !important;
    border: 1px solid #dadce0 !important;
    border-radius: 8px !important;
    padding: 16px !important;
    font-family: inherit;
    font-size: 14px;
    color: #3c4043;
    resize: vertical;
    transition: border-color 0.2s;
}
#f16f14_2604 textarea:focus {
    outline: none;
    border-color: #000 !important;
    border-width: 2px !important;
    padding: 15px !important;
}

/* --------------------------------------------------------
   5. レスポンシブ対応 (スマホ・タブレット)
-------------------------------------------------------- */
@media screen and (max-width: 800px) {
    #f16f14_2604 .questionnaire_box_content_,
    #f16f14_2604 dd {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media screen and (max-width: 480px) {
    /* PC版HTMLがスマホで表示された場合 (保険) */
    #f16f14_2604 .questionnaire_box_content_ {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }
    #f16f14_2604 .questionnaire_box_ { padding: 16px 12px; }

    /* スマホ版HTMLのスマホ表示時（本命） */
    #f16f14_2604 dd {
        grid-template-columns: repeat(3, 1fr); /* 3カラム強制 */
        padding: 0 12px 16px 12px; /* 枠の余白圧縮 */
        gap: 6px; /* 選択肢の隙間圧縮 */
    }
    #f16f14_2604 dt {
        padding: 16px 12px 8px 12px;
    }
    
    /* 3分割で狭くなるため、ラベル内の余白と文字サイズをスマホ専用に圧縮 */
    #f16f14_2604 .questionnaire_box_content_ label,
    #f16f14_2604 dd label {
        padding: 8px 6px;
        font-size: 11px; /* 長い文字が収まるように縮小 */
        min-height: 44px;
        line-height: 1.2;
    }
    
    /* アイコン（丸・四角）もスマホサイズに小さく */
    #f16f14_2604 .questionnaire_box_content_ label::before,
    #f16f14_2604 dd label::before {
        width: 16px;
        height: 16px;
        margin-right: 6px;
        border-width: 1.5px;
    }
    
    /* ラジオ・チェックの選択時アイコンサイズ調整 */
    #f16f14_2604 input[type="radio"]:checked + label::before {
        border-width: 5px;
    }
    #f16f14_2604 input[type="checkbox"]:checked + label::before {
        background-size: 12px;
    }
}