.hnr-wrapper * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    line-height: 1.25;
}
.hnr-wrapper {
    font-family: sans-serif;
    background-color: #f5f7fa;
    color: #222;
    height: 100vh;
    max-width: 100%;
    --hnr-background-image: none;
    --hnr-background-image-sp: none;
    --hnr-background-color: white;
    --hnr-answer-choice-color: white;
}
.hnr-wrapper .hnr-container {
    display: flex;
    height: 100vh;
}
/* ロゴエリア */
.hnr-wrapper .hnr-logo-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: #f1f1f1;
    color: #222;
    width: 280px;
    padding: 16px;
}
.hnr-wrapper .hnr-logo-img {
    max-width: 100%;
    margin-bottom: 32px;
}
.hnr-wrapper .hnr-sidebar-images {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
.hnr-wrapper .hnr-sidebar-images img {
    width: 80%;
    height: auto;
    max-height: 130px;
    object-fit: contain;
}
.hnr-wrapper .hnr-note {
    font-size: 14px;
    margin-top: auto;
}
/* メイン */
.hnr-wrapper .hnr-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: #fff;
}
/* 戻るボタン */
.hnr-wrapper .hnr-chat-actions {
    z-index: 10;
    display: flex;
    justify-content: center;
    padding: 16px;
    gap: 16px;
    background-color: rgba(255, 255, 255, 0.9);
    max-width: 1000px;
    margin: 0 auto;
}
.hnr-wrapper .hnr-chat-actions button {
    padding: 10px 16px;
    font-size: 14px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}
.hnr-wrapper .hnr-btn-back {
    background-color: #a1a1a1;
    color: #fff;
}
.hnr-wrapper .hnr-btn-back:hover {
    background-color: #888;
}
.hnr-wrapper .hnr-btn-reset {
    background-color: #932929;
    color: #fff;
}
.hnr-wrapper .hnr-btn-reset:hover {
    background-color: #801f1f;
}
/* チャットエリア */
.hnr-wrapper .hnr-chat-window {
    position: relative;
    padding: 40px;
    background: var(--hnr-background-image);
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    background-color: var(--hnr-background-color);
    height: 100%;
    flex: 1;
    overflow-y: auto; 
}
.hnr-wrapper .hnr-chat-window__inner {
    position: relative;
    background-color: rgba(255, 255, 255, 0.7);
    z-index: 1;
    max-width: 1000px;
    height: calc(100% - 70px);
    margin: 0 auto;
    padding: 40px;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}
.hnr-wrapper .hnr-step {
    margin-bottom: 30px;
    padding-top: 10px;
}
.hnr-wrapper .hnr-chat-row {
    display: flex;
    align-items: flex-start;
    margin-bottom: 16px;
    gap: 12px;
}
.hnr-wrapper .hnr-chat-row.hnr-row-illust {
    align-items: center;
    margin-left: 52px;
}
.hnr-wrapper .hnr-chat-row.hnr-row-illust:has(img) {
    margin-left: 0;
}
.hnr-wrapper .hnr-row-bot {
    flex-direction: row;
}
.hnr-wrapper .hnr-row-user {
    flex-direction: row-reverse;
}
.hnr-wrapper .hnr-chat-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #222;
}
.hnr-wrapper .hnr-chat-icon-illust {
    max-width: 80px;
}
.hnr-wrapper .hnr-bot-illust__s {
    font-size: 14px;
    font-weight: bold;
}
.hnr-wrapper .hnr-bot-illust__m {
    font-size: 18px;
    font-weight: bold;
}
.hnr-wrapper .hnr-bot-illust__l {
    font-size: 24px;
    font-weight: bold;
}
.hnr-wrapper .hnr-chat-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}
.hnr-wrapper .hnr-chat-name {
    font-size: 12px;
    color: #222;
    margin-bottom: 4px;
    padding: 0 4px;
    width: 100%;
}
.hnr-wrapper .hnr-row-user .hnr-chat-name {
    text-align: right;
}
.hnr-wrapper .hnr-chat-bubble {
    padding: 10px 15px;
    border-radius: 15px;
    word-break: break-word;
    font-size: 18px;
}
.hnr-wrapper .hnr-chat-bubble + .hnr-chat-bubble {
    margin-top: 8px;
}
.hnr-wrapper .hnr-chat-bubble.hnr-bot {
    position: relative;
    background-color: #fff;
}
.hnr-wrapper .hnr-chat-bubble.hnr-bot::before {
    content: "";
    position: absolute;
    top: 0;
    left: -4px;
    width: 0;
    height: 0;
    border: 10px solid transparent;
    border-right-color: #fff;
    transform: rotate(160deg);
}
.hnr-wrapper .hnr-chat-bubble.hnr-user {
    position: relative;
    background-color: #c7ffd4;
}
.hnr-wrapper .hnr-chat-bubble.hnr-user::before {
    content: "";
    position: absolute;
    top: 12px;
    right: -11px;
    width: 0;
    height: 0;
    border: 10px solid transparent;
    border-right-color: #c7ffd4;
    transform: rotate(240deg);
}
.hnr-wrapper .hnr-chat-bubble a {
    color: #001beb;
}
.hnr-wrapper .hnr-chat-none-bubble {
    margin-top: 8px;
}
.hnr-wrapper .hnr-chat-none-bubble .hnr-chat-message-pic {
    max-width: 400px;
    max-height: 400px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

/* 回答UI */
.hnr-wrapper .hnr-answer-ui {
    margin-left: 56px;
    margin-bottom: 16px;
    font-size: 16px;
    color: #333;
}
.hnr-wrapper .hnr-answer-ui .hnr-chat-content {
    width: 100%;
}
.hnr-wrapper .hnr-options-horizontal {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: flex-start;
    align-items: flex-start;
}
.hnr-wrapper .hnr-options-horizontal label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 16px;
}
.hnr-wrapper .hnr-options-horizontal input[type="radio"] {
    display: none;
}
.hnr-wrapper .hnr-custom-radio {
    display: inline-block;
    padding: 10px 16px;
    border: 2px solid #ccc;
    border-radius: 20px;
    background: var(--hnr-answer-choice-color);
    color: #222;
    transition: all 0.3s ease;
}
.hnr-wrapper .hnr-options-horizontal input[type="radio"]:hover + .hnr-custom-radio {
    border-color: #222;
}
.hnr-wrapper .hnr-options-horizontal input[type="radio"]:checked + .hnr-custom-radio {
    background-color: #222;
    color: #fff;
    border-color: #222;
}
.hnr-wrapper .hnr-radio-image-option {
    position: relative;
    display: inline-block;
    cursor: pointer;
    border-radius: 12px;
    overflow: hidden;
}
.hnr-wrapper .hnr-radio-image-option input[type="radio"] {
    display: none;
}
.hnr-wrapper .hnr-radio-image-option img {
    display: block;
    width: 120px;
    height: auto;
    border: 2px solid #ccc;
    border-radius: 12px;
    transition: all 0.3s ease;
}
.hnr-wrapper .hnr-radio-image-option:hover img {
    border: 2px solid #9b9b9b;
}
.hnr-wrapper .hnr-radio-image-option input[type="radio"]:checked + img {
    border: 2px solid #222;
}
.hnr-wrapper .hnr-options-checkbox {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}
.hnr-wrapper .hnr-options-checkbox label span {
    position: relative;
    padding-left: 28px;
    cursor: pointer;
    font-size: 16px;
    line-height: 1.5;
    color: #222;
    display: inline-block;
}
.hnr-wrapper .hnr-options-checkbox label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}
.hnr-wrapper .hnr-options-checkbox label span::before {
    content: "";
    position: absolute;
    left: 0;
    top: 3px;
    width: 20px;
    height: 20px;
    border: 2px solid #ccc;
    border-radius: 4px;
    background-color: #fff;
    box-sizing: border-box;
    transition: all 0.2s ease;
}
.hnr-wrapper .hnr-options-checkbox label input[type="checkbox"]:hover + span::before {
    border-color: #222;
}.hnr-wrapper .hnr-options-checkbox label input[type="checkbox"]:checked + span::before {
    background-color: #222;
    border-color: #222;
}
.hnr-wrapper .hnr-options-checkbox label input[type="checkbox"]:checked + span::after {
    content: "";
    position: absolute;
    left: 6px;
    top: 5px;
    width: 6px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
.hnr-wrapper .hnr-answer-ui select { 
    width: 100%; 
    max-width: 320px; 
    padding: 8px; 
    border: 2px solid #ccc; 
    border-radius: 8px; 
    background: #fff; 
    font-size: 16px; }

.hnr-wrapper .hnr-answer-ui input[type="text"] {
    width: 100%;
    max-width: 500px;
    padding: 8px;
    border: 2px solid #ccc;
    border-radius: 8px;
    font-size: 16px;
}
.hnr-wrapper .hnr-answer-ui textarea {
    width: 100%;
    max-width: 500px;
    padding: 10px;
    border: 2px solid #ccc;
    border-radius: 8px;
    font-size: 16px;
    resize: vertical;
}
.hnr-wrapper .hnr-answer-ui input[type="date"] {
    width: 100%;
    max-width: 150px;
    min-width: 0;
    padding: 8px;
    border: 2px solid #ccc;
    border-radius: 8px;
    font-size: 16px;
    box-sizing: border-box;
}
.hnr-wrapper .hnr-answer-ui input.error-field,
.hnr-wrapper .hnr-answer-ui textarea.error-field {
    background-color: #ffd9d9;
}
.hnr-wrapper .hnr-answer-ui p.error {
    margin-top: 10px;
    color: darkred;
}
.hnr-wrapper .hnr-chat-row.hnr-row-cf7 {
    justify-content: center;
}
/* 残りステップ */
.hnr-wrapper .hnr-step-text {
    text-align: center;
    font-size: 22px;
    font-weight: bold;
    margin: 16px auto;
}
.hnr-wrapper .hnr-step-text span {
    color: #e90000;
    font-size: 38px;
    margin: 0 4px;
}
.hnr-wrapper .hnr-step-text::before,
.hnr-wrapper .hnr-step-text::after {
    display: inline-block;
    font-size: 24px;
    color: #0099a8;
    font-weight: normal;
}
.hnr-wrapper .hnr-step-text::before {
    content: "＼";
    margin-right: 8px;
}
.hnr-wrapper .hnr-step-text::after {
    content: "／";
    margin-left: 8px;
}

/* 次へボタン */
.hnr-wrapper .hnr-btn-next {
    display: block;
    max-width: 200px;
    width: 100%;
    margin: 0 auto;
    padding: 16px;
    border: none;
    background-color: #293593;
    color: #fff;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
}
.hnr-wrapper .hnr-btn-next:hover {
    background-color: #1d297d;
}
.hnr-wrapper .hnr-btn-next:disabled {
    cursor: default;
}
/* フッター情報 */
.hnr-wrapper .hnr-footer-info {
    padding: 8px;
    text-align: center;
    font-size: 12px;
    background-color: #f1f1f1;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: center;
    gap: 8px 16px;
    color: #a1a1a1;
}
.hnr-wrapper .hnr-footer-info a {
    color: #a1a1a1;
}
.hnr-wrapper .hnr-footer-info__copy {
    font-size: 10px;
}
/* 離脱防止ポップアップ */
.hnr-exit-popup {
    position: fixed;
    inset: 0;
    background-color: rgba(0,0,0,0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    margin: 0;
    width: 100%;
}
.hnr-exit-popup-inner {
    font-family: sans-serif;
    position: relative;
    overflow: hidden;
    background-color: #f1f1f1;
    padding: 24px;
    border-radius: 16px;
    width: 360px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    text-align: left;
}
.hnr-exit-popup-inner > * {
    position: relative;
    z-index: 1;
}
.hnr-exit-chat-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 20px;
}
.hnr-exit-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #222;
}
.hnr-exit-chat-content {
    display: flex;
    flex-direction: column;
}
.hnr-exit-name {
    font-size: 12px;
    color: #222;
    margin-bottom: 4px;
    padding: 2px 4px;
    border-radius: 4px;
    background-color: rgb(255 255 255 / 0.4);
    width: max-content;
    max-width: 100%;
}
.hnr-exit-bubble {
    position: relative;
    background-color: #fff;
    padding: 10px 14px;
    border-radius: 12px;
    margin-bottom: 6px;
    line-height: 1.5;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
.hnr-exit-bubble::before {
    content: "";
    position: absolute;
    top: 0;
    left: -4px;
    width: 0;
    height: 0;
    border: 10px solid transparent;
    border-right-color: #fff;
    transform: rotate(160deg);
}
.hnr-exit-btn {
    display: block!important;
    margin: 0 auto!important;
    padding: 10px 20px;
    border: none;
    background-color: #293593;
    color: #fff;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
}

.hnr-fade-in {
    opacity: 1;
    transform: translateY(0) scale(1);
    transition: opacity .2s ease, transform .2s ease, background-color 0.3s ease;
}
.hnr-fade-out {
    opacity: 0!important;
    transform: scale(0.98);
    transition: opacity .2s ease-in, transform .2s ease-in;
}
.hnr-wrapper .hnr-answer-ui.hnr-fade-out {
    transform: translateY(-20px);
}
.hnr-thinking {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 8px 0 0 0;
    padding: 18px;
    border-radius: 12px;
    background-color: rgb(255 255 255 / 0.4);
}
.hnr-exit-chat-content .hnr-thinking {
    margin: 0;
}
.hnr-thinking .hnr-thinking-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
    background-color: #999;
    transform: scale(0.1);
    animation: hnr-thinking .6s ease-in-out infinite alternate;
}
.hnr-thinking .hnr-thinking-dot:nth-child(2) {
    animation-delay: .1s;
}
.hnr-thinking .hnr-thinking-dot:nth-child(3) {
    animation-delay: .2s;
}
.hnr-thinking .hnr-thinking-dot:nth-child(4) {
    animation-delay: .3s;
}
.hnr-thinking .hnr-thinking-dot:nth-child(5) {
    animation-delay: .4s;
}
@keyframes hnr-thinking {
    0% {
        transform: scale(0.1);
    }
    100% {
        transform: scale(1);
    }
}

/* CF7 */
.hnr-wrapper .wpcf7 {
    max-width: 400px;
    margin: 0 auto;
    font-size: 16px;
}
.hnr-form-flex {
    display: flex;
    width: 208px;
    justify-content: space-between;
}
.hnr-wrapper .hnr-form-group {
    margin-bottom: 20px;
}
.hnr-wrapper .hnr-scroll-box {
    height: 120px!important;
}
.hnr-wrapper .wpcf7-form label {
    display: block;
    font-weight: bold;
    position: relative;
    margin-bottom: 4px;
}
.hnr-wrapper .hnr-required-marker {
    color: red;
    margin-left: 4px;
    font-weight: bold;
}
.hnr-wrapper .wpcf7 input[type="text"],
.hnr-wrapper .wpcf7 input[type="email"],
.hnr-wrapper .wpcf7 input[type="tel"],
.hnr-wrapper .wpcf7 select,
.hnr-wrapper .wpcf7 textarea {
    width: 100%;
    max-width: 100%;
    padding: 8px 12px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 6px;
    background-color: #fff;
    box-sizing: border-box;
}
.hnr-wrapper .wpcf7 select:invalid {
    color: #999;
}
.hnr-wrapper .wpcf7 textarea {
    resize: vertical;
    min-height: 120px;
}
.hnr-wrapper .wpcf7-not-valid-tip {
    color: red;
    font-size: 14px;
    margin-top: 4px;
    text-align: left;
}
.hnr-wrapper .wpcf7 .scroll-box {
    height: 150px;
    overflow-y: auto;
    border: 1px solid #ccc;
    padding: 10px;
    margin: 10px 0;
    font-size: 14px;
    line-height: 1.5;
    white-space: pre-line;
    background-color: #fafafa;
}
.hnr-wrapper .hnr-input-wrap {
    text-align: center;
}
.hnr-wrapper .wpcf7 input[type="checkbox"] {
    margin-right: 6px;
}
.hnr-wrapper .wpcf7 input[type="submit"] {
    display: block;
    width: 120px;
    margin: 0 auto;
    background-color: #293593;
    color: #fff;
    border: none;
    padding: 12px 24px;
    font-size: 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}
.hnr-wrapper .wpcf7 input[type="submit"]:hover {
    background-color: #1c276d;
}

/* モバイル対応 */
@media (max-width: 768px) {
    .hnr-pc {
        display: none;
    }
    .hnr-wrapper .hnr-container {
        flex-direction: column;
        height: 100vh;
    }
    .hnr-wrapper .hnr-chat-window {
        padding: 0;
        overflow: visible;
        background: var(--hnr-background-image-sp);
        background-size: cover;
        background-position: center center;
        background-repeat: no-repeat;
        background-color: var(--hnr-background-color);
    }
    .hnr-wrapper .hnr-chat-window__inner {
        padding: 16px;
    }
    .hnr-wrapper .hnr-chat-bubble {
        font-size: 16px;
    }
    .hnr-wrapper .hnr-chat-none-bubble .hnr-chat-message-pic {
        max-width: 240px;
        max-height: 240px;
    }
    /* サイドバーをheaderに */
    .hnr-wrapper .hnr-logo-group {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 12px;
        width: 100%;
    }
    .hnr-wrapper .hnr-logo-group .hnr-note:empty {
        display: none;
    }
    .hnr-wrapper .hnr-logo-row {
        display: flex;
        align-items: center;
        gap: 16px;
    }
    .hnr-wrapper .hnr-logo-img {
        max-width: 200px;
        margin-bottom: 0;
    }
    .hnr-wrapper .hnr-sidebar-images {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }
    .hnr-wrapper .hnr-sidebar-images img {
        width: 80px;
        height: auto;
        max-height: none;
    }
    .hnr-wrapper .hnr-note {
        font-size: 12px;
        margin-top: 8px;
        text-align: center;
    }
    /* ポップアップ */
    .hnr-exit-popup-inner {
        padding: 24px 16px;
        width: 340px;
    }
}