/* AIで理想の家づくり - マルチステップUI スタイル */

body.page-template-ideal-home {
    margin: 0;
    padding: 0;
}

.ideal-home-container {
    min-height: 100vh;
    background-color: rgba(252, 227, 210, 1.0); /* page-bg-clr */
    padding: 60px 20px;
    font-family: "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
    box-sizing: border-box;
}

.ideal-home-wrapper {
    max-width: 760px; /* form-width */
    margin: 0 auto;
    background-color: rgba(255, 255, 255, 1.0); /* form-cont-bg-clr */
    border-radius: 8px; /* form-cont-bdr-radius */
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden; /* ヘッダーの角を丸めるため */
}

/* 独自のヘッダー */
.ideal-home-header {
    background-color: #a68b7c; /* 画像に近い茶色 */
    color: #ffffff;
    text-align: center;
    padding: 25px 20px;
    font-size: 32px;
    font-weight: normal;
    letter-spacing: 1px;
}

/* 内側のコンテンツエリア */
.ideal-home-inner-content {
    padding: 30px 40px; /* 元のwrapperのパディングをここに移動し、少し広げる */
}

/* プログレスバー */
.ideal-home-progress {
    margin-bottom: 30px;
}

.ideal-home-resume-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 18px;
    padding: 12px 14px;
    border: 1px solid rgba(212, 171, 144, 0.7);
    border-radius: 12px;
    background: rgba(255, 250, 246, 0.94);
}

.ideal-home-resume-copy {
    min-width: 0;
}

.ideal-home-resume-title {
    color: #8b4908;
    font-size: 15px;
    font-weight: bold;
    margin-bottom: 4px;
}

.ideal-home-resume-text {
    color: #73513c;
    font-size: 12px;
    line-height: 1.6;
}

.ideal-home-resume-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.ideal-home-resume-btn {
    border-radius: 999px;
    border: 1px solid #be907b;
    padding: 8px 14px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ideal-home-resume-continue {
    background: #be907b;
    color: #fff;
}

.ideal-home-resume-reset {
    background: #fff;
    color: #8b4908;
}

.ideal-home-resume-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(115, 81, 60, 0.12);
}

.ideal-home-questionnaire-hud {
    margin-bottom: 18px;
    padding: 14px 16px;
    border: 1px solid rgba(212, 171, 144, 0.68);
    border-radius: 14px;
    background: rgba(255, 250, 246, 0.96);
    box-sizing: border-box;
}

.ideal-home-questionnaire-hud-head {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    margin-bottom: 10px;
}

.ideal-home-questionnaire-title {
    color: #73513c;
    font-size: 18px;
    font-weight: bold;
    line-height: 1.45;
    margin-bottom: 4px;
}

.ideal-home-questionnaire-subtitle {
    color: #73513c;
    font-size: 13px;
    line-height: 1.6;
}

.ideal-home-questionnaire-step-pill,
.ideal-home-questionnaire-save-pill {
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(251, 232, 218, 0.72);
    color: #8b4908;
    font-size: 12px;
    font-weight: bold;
    white-space: nowrap;
}

.ideal-home-questionnaire-progress-text {
    color: #8b4908;
    font-size: 13px;
    font-weight: bold;
    margin-left: auto;
}

.ideal-home-questionnaire-save-pill.is-saving {
    background: rgba(255, 243, 236, 0.96);
    color: #73513c;
}

.ideal-home-questionnaire-save-pill.is-saved {
    background: rgba(231, 243, 222, 0.96);
    color: #496129;
}

.ideal-home-questionnaire-save-pill.is-warning {
    background: rgba(255, 243, 236, 0.96);
    color: #8b4908;
}

.ideal-home-questionnaire-progress {
    margin-top: 12px;
}

.ideal-home-questionnaire-progress-bar {
    height: 8px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(212, 171, 144, 0.3);
}

.ideal-home-questionnaire-progress-fill {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #be907b 0%, #8b4908 100%);
    transition: width 0.35s ease;
}

.progress-dots {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 30px auto 50px;
    max-width: 600px;
    width: 90%;
    gap: 0; /* 線とドットを密着させる */
}

.progress-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background-color: #fbdaba; /* page-unvisited-bg-clr */
    border: none; /* 枠線をなしに */
    transition: background-color 0.4s ease;
    flex-shrink: 0;
    z-index: 2;
    position: relative;
    color: transparent; /* 数字を非表示に */
}

.progress-dot.active,
.progress-dot.completed {
    background-color: #8b4908; /* page-visited-bg-clr */
}

/* ステップ間の線 */
.progress-line {
    height: 2px;
    flex-grow: 1;
    background-color: #fbdaba; /* page-unvisited-bg-clr */
    position: relative;
    z-index: 1;
    overflow: hidden;
    margin: 0 -1px; /* ドットとの隙間を埋める */
}

.progress-line::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background-color: #8b4908; /* page-visited-bg-clr */
    transition: width 0.4s ease;
}

.progress-line.active::after {
    width: 100%;
}

/* ページタイトル */
.ideal-home-page-title {
    text-align: left; /* page-inline-title-align */
    color: #8b4908; /* page-inline-title-txt-clr */
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid #d4ab90; /* page-inline-bdr-clr */
}

/* コンテンツエリア */
.ideal-home-content {
    min-height: 400px;
    margin-bottom: 30px;
}

.ideal-home-step {
    display: none;
}

.ideal-home-step.active {
    display: block;
}

/* HTMLテキスト要素 */
.ideal-home-html-text {
    margin-bottom: 25px;
    text-align: center;
}

/* Page 2の画像を中央揃えで表示 */
.ideal-home-step[data-step="2"] .ideal-home-html-text {
    text-align: center;
    margin-bottom: 30px;
}

.ideal-home-step[data-step="2"] .ideal-home-html-text img {
    max-width: 100%;
    height: auto;
    margin: 0 auto;
    display: block;
}

.ideal-home-html-text img {
    max-width: 100%;
    height: auto;
    margin: 10px 0;
}

.ideal-home-html-text p {
    margin: 10px 0;
    color: #000000; /* label-txt-clr */
}

/* セクション見出し */
.ideal-home-section {
    margin: 30px 0 20px 0;
    padding: 15px 0;
    border-bottom: 2px solid #d4ab90;
}

.ideal-home-section h2 {
    color: #8b4908;
    font-size: 20px;
    font-weight: bold;
    margin: 0;
}

/* フィールドラベル */
.ideal-home-field-label {
    display: block;
    margin-bottom: 5px; /* 8pxから縮小 */
    color: #000000; /* label-txt-clr */
    font-weight: bold;
    font-size: 16px; /* 14pxから拡大（画像に合わせる） */
}

.ideal-home-field-label.required::after {
    content: " *";
    color: #cc1111; /* field-mandatory-clr */
    font-size: 18px;
    vertical-align: middle;
    font-weight: bold;
}

/* 入力フィールド */
/* 質問の見出し（延床面積など） */
.ideal-home-field-label.custom-header {
    font-size: 22px;
    color: #000000;
    margin-bottom: 20px;
    margin-top: 10px;
    display: block;
    font-weight: bold;
    line-height: 1.4;
    border-bottom: none;
    padding-bottom: 0;
}

.ideal-home-field-group-title {
    margin-bottom: 12px;
    color: #000000;
    font-size: 22px;
    font-weight: bold;
    line-height: 1.4;
}

.ideal-home-other-text-container {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(212, 171, 144, 0.45);
}

.ideal-home-other-text-label {
    display: block;
    margin-bottom: 8px;
    color: #73513c;
    font-size: 14px;
    font-weight: bold;
}

.ideal-home-field {
    margin-bottom: 35px; /* fields-ver-space-bottom */
}

.ideal-home-restored-file-hint {
    margin-top: 10px;
    color: #8b4908;
    font-size: 12px;
    line-height: 1.6;
    background: rgba(255, 243, 236, 0.9);
    border: 1px solid rgba(212, 171, 144, 0.65);
    border-radius: 10px;
    padding: 10px 12px;
}

@media (max-width: 768px) {
    .ideal-home-inner-content {
        padding: 24px 20px;
    }

    .ideal-home-resume-banner,
    .ideal-home-questionnaire-hud-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .ideal-home-resume-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .ideal-home-resume-actions {
        flex-direction: column;
    }

    .ideal-home-resume-btn {
        width: 100%;
    }

    .ideal-home-questionnaire-title {
        font-size: 16px;
    }
}

.ideal-home-field input[type="text"],
.ideal-home-field input[type="email"],
.ideal-home-field input[type="tel"],
.ideal-home-field input[type="number"],
.ideal-home-field textarea,
.ideal-home-field select {
    width: 100%;
    padding: 10px;
    border: 1px solid rgba(212, 171, 144, 1); /* input-bdr-clr */
    border-radius: 4px;
    background-color: rgba(255, 255, 255, 1); /* input-bg-clr */
    color: rgba(115, 81, 60, 1); /* value-txt-clr */
    font-size: 14px;
    font-family: Arial, Helvetica, sans-serif;
    box-sizing: border-box;
}

.ideal-home-select-wrapper {
    position: relative;
}

.ideal-home-select-wrapper select {
    position: relative;
    z-index: 1;
    background: transparent;
    color: rgba(115, 81, 60, 1) !important;
    -webkit-text-fill-color: rgba(115, 81, 60, 1);
}

.ideal-home-select-placeholder {
    position: absolute;
    left: 10px;
    right: 36px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(115, 81, 60, 1);
    font-size: 14px;
    line-height: 1.4;
    pointer-events: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    z-index: 3;
    display: none !important;
}

.ideal-home-select-wrapper:not(.is-showing-placeholder) .ideal-home-select-placeholder {
    display: none;
}

.ideal-home-select-wrapper select option {
    color: rgba(115, 81, 60, 1) !important;
    background-color: #ffffff !important;
}

.ideal-home-field input:focus,
.ideal-home-field textarea:focus,
.ideal-home-field select:focus {
    outline: none;
    border-color: #8b4908; /* input-focus-clr */
    box-shadow: 0 0 0 2px rgba(139, 73, 8, 0.2);
}

.ideal-home-field textarea {
    min-height: 100px;
    resize: vertical;
}

/* ラジオボタン・チェックボックス */
.ideal-home-radio-group,
.ideal-home-checkbox-group {
    margin-top: 10px;
}

.ideal-home-radio-option,
.ideal-home-checkbox-option {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    padding: 15px 20px;
    background-color: #ffffff;
    border: 1px solid rgba(212, 171, 144, 0.5);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.ideal-home-radio-option:hover,
.ideal-home-checkbox-option:hover {
    border-color: #8b4908;
    background-color: rgba(251, 232, 218, 0.3);
}

.ideal-home-radio-option.selected,
.ideal-home-checkbox-option.selected {
    border-color: #8b4908;
    background-color: rgba(251, 232, 218, 0.5);
}

/* 「その他」入力欄のスタイル */
.ideal-home-other-text-container {
    margin-top: -10px;
    margin-bottom: 20px;
    padding: 0 10px 15px 50px;
}

.ideal-home-other-text-container input[type="text"] {
    border-top: none;
    border-left: none;
    border-right: none;
    border-radius: 0;
    padding: 8px 0;
    background-color: transparent;
    font-size: 16px;
}

.ideal-home-other-text-container input[type="text"]:focus {
    box-shadow: none;
    border-bottom-width: 2px;
}

/* デフォルトのチェックボックス/ラジオを非表示にし、カスタム表示を作成 */
.ideal-home-radio-option input[type="radio"],
.ideal-home-checkbox-option input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

/* カスタムチェックボックス/ラジオの外枠 */
.ideal-home-checkbox-option::before,
.ideal-home-radio-option::before {
    content: "";
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 2px solid #8b4908;
    margin-right: 15px;
    background-color: #fff;
    flex-shrink: 0;
    box-sizing: border-box;
}

.ideal-home-checkbox-option::before {
    border-radius: 4px;
}

.ideal-home-radio-option::before {
    border-radius: 50%;
}

/* チェック状態のスタイル */
.ideal-home-checkbox-option.selected::before {
    background-color: #8b4908;
}

.ideal-home-radio-option.selected::before {
    background-color: #fff;
    border-width: 7px;
}

/* チェックマーク */
.ideal-home-checkbox-option.selected::after {
    content: "✓";
    position: absolute;
    left: 25px;
    top: 50%;
    transform: translateY(-50%);
    color: #fff;
    font-size: 16px;
    font-weight: bold;
}

.ideal-home-radio-option label,
.ideal-home-checkbox-option label {
    cursor: pointer;
    color: #73513c; /* value-txt-clr */
    font-size: 18px;
    font-weight: bold;
    flex: 1;
    margin: 0;
    display: block;
}

/* 画像選択フィールド */
.ideal-home-image-choice {
    margin-bottom: 30px;
}

/* ファイルアップロードのスタイル */
.ideal-home-file-upload-wrapper {
    position: relative;
    margin-bottom: 10px;
}

.ideal-home-file-input {
    position: absolute;
    width: 0.1px;
    height: 0.1px;
    opacity: 0;
    overflow: hidden;
    z-index: -1;
}

.ideal-home-file-upload-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    background-color: #fff;
    border: 1px dashed #be907b;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 80px;
    box-sizing: border-box;
}

.ideal-home-file-upload-label:hover {
    background-color: rgba(251, 232, 218, 0.3);
    border-color: #8b4908;
}

.ideal-home-file-upload-label.has-files {
    border-style: solid;
    border-color: #8b4908;
    background-color: rgba(251, 232, 218, 0.2);
}

.ideal-home-file-upload-label .upload-text {
    color: #73513c;
    font-size: 18px;
    font-weight: normal;
}

.ideal-home-file-upload-label .upload-icon {
    color: #73513c;
    display: flex;
    align-items: center;
}

.ideal-home-file-hint {
    margin-top: 10px;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    text-align: left;
}

.ideal-home-image-choice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.ideal-home-image-choice-item {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    border: 2px solid rgba(212, 171, 144, 1); /* input-bdr-clr */
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: rgba(255, 255, 255, 1);
}

.ideal-home-image-choice-item:hover {
    border-color: #8b4908; /* input-focus-clr */
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.ideal-home-image-choice-item.selected {
    border-color: #8b4908;
    background-color: rgba(251, 232, 218, 0.5); /* elements-clr */
}

.ideal-home-image-choice-item img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    display: block;
}

/* A few Q2 source images include built-in canvas padding. Crop them slightly. */
#step-2 .ideal-home-image-choice-item[data-value="カントリー"] img,
#step-2 .ideal-home-image-choice-item[data-value="モダン"] img {
    transform: scale(1.16);
    transform-origin: center center;
}

.ideal-home-image-choice-label {
    padding: 10px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 12px;
    color: rgba(115, 81, 60, 1); /* value-txt-clr */
    font-weight: bold;
}

.ideal-home-image-choice-checkmark {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 24px;
    height: 24px;
    background-color: #8b4908;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    font-weight: bold;
}

.ideal-home-image-choice-item.selected .ideal-home-image-choice-checkmark {
    display: flex;
}

/* 拡大ボタン */
.ideal-home-image-zoom-btn {
    position: absolute;
    top: 5px;
    left: 5px;
    width: 32px;
    height: 32px;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8b4908;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 5;
}

.ideal-home-image-zoom-btn:hover {
    background-color: #fff;
    transform: scale(1.1);
}

/* ライトボックス */
.ideal-home-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.ideal-home-lightbox.active {
    opacity: 1;
    pointer-events: auto;
}

.ideal-home-lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
}

.ideal-home-lightbox-content img {
    max-width: 100%;
    max-height: 90vh;
    border-radius: 4px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.5);
}

.ideal-home-lightbox-close {
    position: fixed;
    top: calc(env(safe-area-inset-top, 0px) + 12px);
    right: calc(env(safe-area-inset-right, 0px) + 12px);
    width: 44px;
    height: 44px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 32px;
    line-height: 44px;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.2s ease;
    z-index: 10001;
    -webkit-tap-highlight-color: transparent;
}

.ideal-home-lightbox-close:hover {
    color: #fff;
    background: rgba(0, 0, 0, 0.72);
}

/* Step 8: 画像生成（ローディング / 結果表示） */
.ideal-home-generated-wrapper {
    margin-top: 25px;
}

.ideal-home-generation-status {
    margin-bottom: 20px;
    padding: 20px;
    border: 1px solid rgba(212, 171, 144, 0.9);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255, 250, 246, 0.98) 0%, rgba(251, 232, 218, 0.72) 100%);
    box-shadow: 0 14px 36px rgba(115, 81, 60, 0.12);
    box-sizing: border-box;
}

.ideal-home-generation-status-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.ideal-home-generation-status-copy {
    flex: 1;
}

.ideal-home-generation-eyebrow {
    color: #8b4908;
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 0.16em;
    margin-bottom: 8px;
}

.ideal-home-generation-title-row {
    display: flex;
    align-items: center;
    gap: 14px;
}

.ideal-home-generation-title-copy {
    min-width: 0;
}

.ideal-home-generation-title {
    color: #73513c;
    font-size: 22px;
    font-weight: bold;
    line-height: 1.35;
    margin-bottom: 6px;
}

.ideal-home-generation-text {
    color: #73513c;
    font-size: 14px;
    font-weight: normal;
    line-height: 1.6;
    white-space: pre-line;
}

.ideal-home-generation-metrics {
    min-width: 150px;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(212, 171, 144, 0.8);
    text-align: right;
    box-sizing: border-box;
}

.ideal-home-generation-count {
    color: #8b4908;
    font-size: 20px;
    font-weight: bold;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.ideal-home-generation-summary {
    color: #73513c;
    font-size: 12px;
    margin-top: 6px;
    line-height: 1.5;
}

.ideal-home-generation-progress {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 18px;
}

.ideal-home-generation-progress-bar {
    position: relative;
    flex: 1;
    height: 12px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(212, 171, 144, 0.35);
}

.ideal-home-generation-progress-fill {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #be907b 0%, #8b4908 100%);
    transition: width 0.35s ease;
}

.ideal-home-generation-progress-percent {
    min-width: 48px;
    color: #8b4908;
    font-size: 14px;
    font-weight: bold;
    text-align: right;
}

.ideal-home-generation-status.is-complete .ideal-home-generation-progress-fill {
    background: linear-gradient(90deg, #8b4908 0%, #6f8a4a 100%);
}

.ideal-home-generation-status.is-complete .ideal-home-generation-spinner {
    animation: none;
    border-color: rgba(111, 138, 74, 0.25);
    border-top-color: rgba(111, 138, 74, 0.25);
    background: rgba(111, 138, 74, 0.12);
    position: relative;
}

.ideal-home-generation-status.is-complete .ideal-home-generation-spinner::after {
    content: '';
    position: absolute;
    left: 15px;
    top: 10px;
    width: 10px;
    height: 18px;
    border-right: 4px solid #6f8a4a;
    border-bottom: 4px solid #6f8a4a;
    transform: rotate(45deg);
}

.ideal-home-generation-spinner {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 4px solid rgba(212, 171, 144, 0.6);
    border-top-color: #8b4908;
    animation: idealHomeSpin 1s linear infinite;
    flex: 0 0 auto;
}

@keyframes idealHomeSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.ideal-home-generation-error {
    margin-top: 15px;
    padding: 15px 18px;
    border: 1px solid rgba(204, 17, 17, 0.4);
    background-color: rgba(251, 232, 218, 0.35);
    border-radius: 8px;
    color: #cc1111;
    font-weight: bold;
    text-align: center;
    line-height: 1.6;
}

.ideal-home-generated-grid {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-top: 15px;
}

.ideal-home-generated-section {
    padding: 16px;
    border: 1px solid rgba(212, 171, 144, 0.72);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.78);
}

.ideal-home-generated-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.ideal-home-generated-section-title {
    font-size: 16px;
    font-weight: bold;
    color: #73513c;
}

.ideal-home-generated-section-status {
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: bold;
    white-space: nowrap;
}

.ideal-home-generated-section-status.is-waiting {
    color: #8b4908;
    background: rgba(251, 232, 218, 0.9);
}

.ideal-home-generated-section-status.is-partial {
    color: #73513c;
    background: rgba(255, 243, 236, 0.95);
}

.ideal-home-generated-section-status.is-done {
    color: #496129;
    background: rgba(227, 241, 208, 0.95);
}

.ideal-home-generated-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.ideal-home-generated-row::-webkit-scrollbar {
    height: 6px;
}

.ideal-home-generated-row::-webkit-scrollbar-thumb {
    background: rgba(212, 171, 144, 0.5);
    border-radius: 6px;
}

.ideal-home-generated-item {
    position: relative;
    border: 2px solid rgba(212, 171, 144, 1);
    border-radius: 8px;
    overflow: hidden;
    background-color: #fff;
    min-width: 0;
}

.ideal-home-generated-item img {
    width: 100%;
    height: 170px;
    display: block;
    object-fit: cover;
}

.ideal-home-generated-item-placeholder {
    min-height: 170px;
    border-style: dashed;
    background:
        linear-gradient(135deg, rgba(255, 250, 246, 0.98) 0%, rgba(248, 238, 230, 0.98) 100%);
}

.ideal-home-generated-placeholder-inner {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 14px;
    height: 170px;
    padding: 18px 16px;
}

.ideal-home-generated-placeholder-shimmer {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.85) 50%, rgba(255, 255, 255, 0) 100%);
    transform: translateX(-100%);
    animation: idealHomePlaceholderShimmer 1.8s ease-in-out infinite;
}

.ideal-home-generated-placeholder-lines {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 1;
}

.ideal-home-generated-placeholder-lines span {
    display: block;
    height: 10px;
    border-radius: 999px;
    background: rgba(212, 171, 144, 0.55);
}

.ideal-home-generated-placeholder-lines span:nth-child(1) {
    width: 78%;
}

.ideal-home-generated-placeholder-lines span:nth-child(2) {
    width: 58%;
}

.ideal-home-generated-placeholder-lines span:nth-child(3) {
    width: 66%;
}

.ideal-home-generated-placeholder-label {
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: 14px;
    z-index: 2;
    color: #73513c;
    font-size: 12px;
    font-weight: bold;
    line-height: 1.4;
}

.ideal-home-image-badge {
    position: absolute;
    left: 8px;
    bottom: 8px;
    background: rgba(139, 73, 8, 0.85);
    color: #fff;
    font-size: 12px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 10px;
}

.ideal-home-image-badge.is-placeholder {
    background: rgba(190, 144, 123, 0.92);
}

@keyframes idealHomePlaceholderShimmer {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(100%);
    }
}

@media (max-width: 768px) {
    .ideal-home-progress {
        margin-bottom: 14px;
    }

    .progress-dots {
        display: none;
    }

    .ideal-home-questionnaire-hud {
        padding: 10px 12px;
        border-radius: 12px;
        margin-bottom: 14px;
    }

    .ideal-home-questionnaire-hud-head {
        margin-bottom: 8px;
        gap: 8px;
    }

    .ideal-home-questionnaire-step-pill {
        padding: 6px 10px;
        font-size: 11px;
    }

    .ideal-home-questionnaire-progress-text {
        font-size: 12px;
    }

    .ideal-home-questionnaire-title {
        font-size: 15px;
        margin-bottom: 2px;
        line-height: 1.3;
    }

    .ideal-home-questionnaire-subtitle {
        font-size: 12px;
        line-height: 1.45;
    }

    .ideal-home-questionnaire-progress {
        margin-top: 8px;
    }

    .ideal-home-questionnaire-progress-bar {
        height: 6px;
    }

    .ideal-home-generation-status {
        padding: 16px;
    }

    .ideal-home-generation-status-head {
        flex-direction: column;
    }

    .ideal-home-generation-title {
        font-size: 18px;
    }

    .ideal-home-generation-metrics {
        width: 100%;
        min-width: 0;
        text-align: left;
    }

    .ideal-home-generation-count {
        font-size: 18px;
    }

    .ideal-home-generation-progress {
        align-items: flex-start;
        flex-direction: column;
    }

    .ideal-home-generation-progress-percent {
        min-width: 0;
        text-align: left;
    }

    .ideal-home-generated-section {
        padding: 14px;
    }

    .ideal-home-generated-section-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .ideal-home-generated-item img {
        height: 150px;
    }

    .ideal-home-generated-item-placeholder {
        min-height: 150px;
    }

    .ideal-home-generated-placeholder-inner {
        height: 150px;
    }
}

/* ページ番号 */
.ideal-home-page-number {
    text-align: right;
    font-size: 16px;
    font-weight: bold;
    color: #000000;
    margin-top: 20px;
}

/* ナビゲーションボタン */
.ideal-home-navigation {
    display: flex;
    justify-content: center; /* すべてのページで中央寄せに変更 */
    gap: 12px; /* ボタン同士の間隔を狭くする */
    margin-top: 30px; /* 余白を少し調整 */
    padding-top: 0;
}

.ideal-home-navigation.is-hidden-by-script {
    display: none !important;
}

.ideal-home-navigation button {
    padding: 12px 30px;
    border-radius: 50px; /* すべて楕円形に変更 */
    font-size: 18px;
    font-weight: normal;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid;
    font-family: Arial, Helvetica, sans-serif;
    min-width: 160px; /* ボタンの幅を統一 */
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-back {
    background-color: #ffffff; /* 白背景 */
    color: #be907b; /* 茶色文字 */
    border-color: #be907b; /* 茶色枠線 */
}

.btn-back:hover {
    background-color: rgba(190, 144, 123, 0.1);
}

.btn-next,
.btn-submit {
    background-color: #be907b; /* 茶色背景 */
    color: #ffffff; /* 白文字 */
    border-color: #be907b;
    margin-left: 0; /* 中央寄せのためリセット */
}

.btn-next {
    background-color: #d9b6a5; /* 未回答時: 薄い茶色 */
    border-color: #d9b6a5;
}

.btn-next.is-answer-ready {
    background-color: #8b4908; /* 回答済み時: 濃い茶色 */
    border-color: #8b4908;
}
.ideal-home-navigation.is-always-dark .btn-next,
.ideal-home-navigation.is-always-dark .btn-submit {
    background-color: #8b4908;
    border-color: #8b4908;
}

.btn-next:hover,
.btn-submit:hover {
    background-color: rgba(139, 73, 8, 1);
    border-color: rgba(139, 73, 8, 1);
}

/* エラーメッセージ */
.ideal-home-field-error {
    color: #cc1111; /* field-mandatory-clr */
    font-size: 16px; /* 12pxから拡大 */
    font-weight: bold; /* 太字に追加 */
    margin-top: 10px; /* 5pxから調整 */
    display: none;
}

.ideal-home-field.has-error .ideal-home-field-error {
    display: block;
}

.ideal-home-field.has-error input,
.ideal-home-field.has-error textarea,
.ideal-home-field.has-error select {
    border-color: #cc1111;
}

/* Page 1専用スタイル - 1枚の画像 */
.ideal-home-step-page1 {
    position: relative;
    width: 100%;
}

.ideal-home-page1-image-container {
    position: relative;
    width: 100%;
    margin: 0 auto;
    text-align: center;
}

.ideal-home-page1-image {
    width: 100%;
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* メールアドレス入力欄（アイコン付き） */
.ideal-home-email-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.ideal-home-email-input-wrapper .email-icon {
    position: absolute;
    left: 15px;
    color: rgba(212, 171, 144, 1);
    display: flex;
    align-items: center;
    pointer-events: none;
    z-index: 1;
}

.ideal-home-email-input {
    padding-left: 45px !important;
}

.ideal-home-contact-reason {
    margin: 8px 0 14px;
    color: #73513c;
    font-size: 14px;
    line-height: 1.6;
}

.ideal-home-step[data-step="9"] .ideal-home-field {
    margin-top: 25px;
    margin-bottom: 25px;
    padding-bottom: 25px;
    border-bottom: 1px solid rgba(212, 171, 144, 1);
}

.ideal-home-step[data-step="9"] .ideal-home-field:last-of-type {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

/* プライバシーポリシー規約ボックス */
.ideal-home-terms-container {
    margin-bottom: 20px;
}

.ideal-home-terms-box {
    height: 200px;
    overflow-y: scroll;
    border: 1px solid #333; /* 枠線を黒めに */
    padding: 20px;
    margin-bottom: 15px;
    background-color: #fff;
    font-size: 14px;
    line-height: 1.6;
    border-radius: 4px;
    color: #333;
}

.ideal-home-terms-box h1,
.ideal-home-terms-box h2,
.ideal-home-terms-box h3 {
    margin-top: 0;
    font-weight: 700 !important; /* より太く */
    color: #333;
    line-height: 1.2;
}

.ideal-home-terms-box h1 { font-size: 20px; margin-bottom: 20px; }
.ideal-home-terms-box h2 { font-size: 18px; margin-top: 20px; margin-bottom: 10px; }
.ideal-home-terms-box h3 { font-size: 16px; margin-top: 15px; margin-bottom: 10px; }

.ideal-home-terms-box h4 {
    font-size: 15px;
    font-weight: bold;
    margin-top: 15px;
    margin-bottom: 5px;
    color: #333;
}

.ideal-home-terms-box p {
    margin-bottom: 10px;
}

.ideal-home-terms-box strong {
    font-weight: 700;
}

.ideal-home-terms-box ul,
.ideal-home-terms-box ol {
    margin-bottom: 10px;
    padding-left: 20px;
}

.ideal-home-terms-box li {
    margin-bottom: 5px;
}

.ideal-home-terms-agree {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ideal-home-terms-agree input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    /* カスタムチェックボックスのスタイルを流用 */
    position: relative;
    opacity: 0;
    pointer-events: none;
}

.ideal-home-terms-agree input[type="checkbox"] + label::before {
    content: "";
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 2px solid #8b4908;
    margin-right: 10px;
    background-color: #fff;
    flex-shrink: 0;
    box-sizing: border-box;
    border-radius: 4px;
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
}

.ideal-home-terms-agree input[type="checkbox"]:checked + label::before {
    background-color: #8b4908;
}

.ideal-home-terms-agree input[type="checkbox"]:checked + label::after {
    content: "✓";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    color: white;
    font-size: 16px;
    text-align: center;
    line-height: 22px;
    font-weight: bold;
}

.ideal-home-terms-agree label {
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    color: #333;
    position: relative;
    padding-left: 35px; /* カスタムチェックボックスのスペース */
    display: flex;
    align-items: center;
    min-height: 24px; /* チェックボックスの高さに合わせる */
}

.ideal-home-step[data-step="9"] .ideal-home-html-text {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(212, 171, 144, 1);
    text-align: center;
}

/* 最初のテキスト（迷惑メール...）の下に線を引く */
.ideal-home-step[data-step="9"] .ideal-home-html-text:first-child {
    border-bottom: 1px solid rgba(212, 171, 144, 1);
    margin-bottom: 20px;
    padding-bottom: 20px;
}

/* Page 1専用ナビゲーション（中央揃えの画像ボタン） */
.ideal-home-step[data-step="1"] ~ .ideal-home-navigation {
    justify-content: center;
}

.ideal-home-step[data-step="1"] ~ .ideal-home-navigation .btn-next {
    border-radius: 50px;
    padding: 15px 60px;
    font-size: 24px;
    min-width: 320px;
    gap: 15px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.ideal-home-step[data-step="1"] ~ .ideal-home-navigation .btn-next::after {
    content: "→";
    font-size: 20px;
}

.ideal-home-generation-actions {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ideal-home-generation-action-btn {
    width: 100%;
    padding: 14px 18px;
    border-radius: 999px;
    font-size: 16px;
    font-weight: bold;
    border: 2px solid #be907b;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ideal-home-generation-action-btn.is-primary {
    background: #be907b;
    color: #ffffff;
}

.ideal-home-generation-action-btn.is-outline {
    background: #ffffff;
    color: #be907b;
}

.ideal-home-generation-action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(115, 81, 60, 0.12);
}

.ideal-home-save-hint {
    margin: 2px 0 0;
    color: #73513c;
    font-size: 12px;
    line-height: 1.6;
    text-align: center;
}

.ideal-home-generation-action-btn:disabled {
    opacity: 0.75;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* レスポンシブ */
@media (max-width: 768px) {
    .ideal-home-wrapper {
        margin: 0;
        border-radius: 0;
    }

    .ideal-home-header {
        font-size: 24px;
        padding: 20px 15px;
    }

    .ideal-home-inner-content {
        padding: 20px 15px;
    }
    
    .ideal-home-image-choice-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
    }
    
    .ideal-home-navigation {
        display: flex !important;
        flex-direction: column !important;
    }

    .ideal-home-navigation .btn-next,
    .ideal-home-navigation .btn-submit {
        order: 1 !important;
    }

    .ideal-home-navigation .btn-back {
        order: 2 !important;
    }
    
    .btn-next,
    .btn-submit {
        margin-left: 0;
        width: 100%;
    }
    
    .ideal-home-page1-image-container {
        padding: 0 10px;
    }
}

