* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Yu Gothic", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
    background: linear-gradient(180deg, #eaf5ff 0%, #f7fbff 45%, #ffffff 100%);
    color: #102a43;
    font-size: 18px;
    line-height: 1.7;
}

.safety-page {
    width: min(960px, 100%);
    margin: 0 auto;
    padding: 18px;
}

.safety-header {
    background: #ffffff;
    border: 1px solid #d8e8f8;
    border-radius: 22px;
    padding: 26px 22px;
    text-align: center;
    box-shadow: 0 10px 28px rgba(24, 119, 242, 0.12);
    margin-bottom: 18px;
}

.safety-header h1 {
    margin: 8px 0 2px;
    font-size: 22px;
    color: #0b3d75;
}

.safety-header h2 {
    margin: 0;
    font-size: 30px;
    color: #082b52;
}

.safety-header p {
    margin: 10px 0 0;
    font-size: 16px;
    color: #486581;
}

.safety-header__badge {
    display: inline-block;
    padding: 6px 18px;
    border-radius: 999px;
    color: #ffffff;
    font-weight: 700;
    font-size: 16px;
}

.mode-training {
    background: #1e88e5;
}

.mode-real {
    background: #e53935;
}

.safety-message {
    background: #ffffff;
    border-radius: 18px;
    padding: 18px 20px;
    margin-bottom: 14px;
    font-weight: 700;
    border: 2px solid #d8e8f8;
    box-shadow: 0 8px 20px rgba(16, 42, 67, 0.08);
}

.safety-message.mode-training {
    background: #eef7ff;
    border-color: #90caf9;
    color: #0b5394;
}

.safety-message.mode-real {
    background: #fff1f1;
    border-color: #ef9a9a;
    color: #9f1d1d;
}

.safety-help-area {
    text-align: right;
    margin-bottom: 14px;
}

.help-button {
    border: none;
    border-radius: 999px;
    background: #0b74de;
    color: #ffffff;
    font-weight: 700;
    padding: 12px 20px;
    font-size: 17px;
    cursor: pointer;
    box-shadow: 0 6px 14px rgba(11, 116, 222, 0.22);
}

.safety-closed {
    background: #fff3e0;
    color: #8a4b00;
    border: 2px solid #ffb74d;
    border-radius: 18px;
    padding: 24px;
    font-weight: 700;
    text-align: center;
}

.safety-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.form-card,
.submit-card {
    background: #ffffff;
    border: 1px solid #d8e8f8;
    border-radius: 18px;
    padding: 20px;
    box-shadow: 0 8px 22px rgba(16, 42, 67, 0.08);
}

.form-label {
    display: block;
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 10px;
    color: #102a43;
}

.required::after {
    content: "必須";
    display: inline-block;
    margin-left: 10px;
    padding: 2px 8px;
    border-radius: 6px;
    background: #e53935;
    color: #ffffff;
    font-size: 13px;
    vertical-align: middle;
}

.text-input {
    width: 100%;
    min-height: 54px;
    border: 2px solid #c9d8e8;
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 18px;
    background: #ffffff;
}

.text-input:focus {
    outline: none;
    border-color: #1e88e5;
    box-shadow: 0 0 0 4px rgba(30, 136, 229, 0.14);
}

.short-input {
    max-width: 180px;
}

.address-fixed {
    display: inline-block;
    margin-bottom: 12px;
    padding: 8px 14px;
    border-radius: 10px;
    background: #eef7ff;
    font-weight: 700;
    color: #0b5394;
}

.address-row {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
}

.sub-label {
    display: block;
    font-weight: 700;
    margin-bottom: 6px;
    color: #486581;
}

.button-radio-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px; /* ←追加 */
}

.button-radio-group label {
    display: inline-flex;
}

.button-radio-group input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.button-radio-group span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    min-width: 120px;
    padding: 10px 18px;
    border: 2px solid #c9d8e8;
    border-radius: 12px;
    background: #ffffff;
    color: #102a43;
    font-weight: 700;
    cursor: pointer;
    transition: 0.15s ease;
    text-align: center;
}

.button-radio-group input:checked + span {
    background: #1e88e5;
    border-color: #1e88e5;
    color: #ffffff;
    box-shadow: 0 6px 14px rgba(30, 136, 229, 0.22);
}

.button-radio-group input:checked + span::before {
    content: "✓ ";
    font-weight: 900;
}

.multi-line span {
    min-width: 150px;
}

.button-radio-group span.safe {
    border-color: #43a047;
    color: #2e7d32;
    background: #f1fff4;
}

.button-radio-group input:checked + span.safe {
    background: #43a047;
    color: #ffffff;
}

.button-radio-group span.warning {
    border-color: #f9a825;
    color: #9a6600;
    background: #fff9e6;
}

.button-radio-group input:checked + span.warning {
    background: #f9a825;
    color: #ffffff;
}

.button-radio-group span.caution {
    border-color: #fb8c00;
    color: #b45f00;
    background: #fff3e0;
}

.button-radio-group input:checked + span.caution {
    background: #fb8c00;
    color: #ffffff;
}

.button-radio-group span.danger {
    border-color: #e53935;
    color: #b71c1c;
    background: #fff1f1;
}

.button-radio-group input:checked + span.danger {
    background: #e53935;
    color: #ffffff;
}

.button-radio-group span.critical {
    border-color: #8e24aa;
    color: #6a1b9a;
    background: #fbf0ff;
}

.button-radio-group input:checked + span.critical {
    background: #8e24aa;
    color: #ffffff;
}

.other-input {
    display: none;
    margin-top: 12px;
}

.other-input.is-visible {
    display: block;
}

.submit-card {
    display: flex;
    gap: 12px;
    flex-direction: column;
}

.submit-button,
.clear-button {
    width: 100%;
    min-height: 58px;
    border-radius: 14px;
    font-size: 20px;
    font-weight: 800;
    cursor: pointer;
}

.submit-button {
    border: none;
    color: #ffffff;
    background: linear-gradient(135deg, #1e88e5, #0b74de);
    box-shadow: 0 8px 18px rgba(30, 136, 229, 0.28);
}

.clear-button {
    background: #ffffff;
    color: #0b74de;
    border: 2px solid #0b74de;
}

.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(16, 42, 67, 0.45);
    padding: 20px;
    z-index: 9999;
}

.modal-overlay.is-open {
    display: flex;
    align-items: center;
    justify-content: center;
}

.help-modal {
    width: min(720px, 100%);
    max-height: 86vh;
    overflow-y: auto;
    background: #ffffff;
    border-radius: 22px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.25);
}

.help-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 18px 20px;
    border-bottom: 1px solid #d8e8f8;
}

.help-modal-header h3 {
    margin: 0;
    font-size: 24px;
    color: #082b52;
}

.help-modal-header button {
    width: 46px;
    height: 46px;
    border: none;
    border-radius: 50%;
    background: #e53935;
    color: #ffffff;
    font-size: 26px;
    font-weight: 800;
    cursor: pointer;
}

.help-modal-body {
    padding: 20px;
}

.help-section {
    padding: 16px;
    border-radius: 14px;
    background: #f7fbff;
    border: 1px solid #d8e8f8;
    margin-bottom: 12px;
}

.help-section h4 {
    margin: 0 0 8px;
    color: #0b5394;
    font-size: 20px;
}

.help-section p {
    margin: 0;
}

@media (max-width: 640px) {
    body {
        font-size: 17px;
    }

    .safety-page {
        padding: 12px;
    }

    .safety-header {
        padding: 22px 16px;
        border-radius: 18px;
    }

    .safety-header h2 {
        font-size: 26px;
    }

    .form-card,
    .submit-card {
        padding: 16px;
    }

    .button-radio-group {
        display: grid;
        grid-template-columns: 1fr;
    }

    .button-radio-group span {
        width: 100%;
        min-width: 0;
        font-size: 18px;
    }

    .address-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .short-input {
        max-width: 100%;
    }

    .safety-help-area {
        text-align: center;
    }
}

#buildingOtherBox {

    display: none;

    margin-top: 15px;

}

#buildingOtherBox.is-visible {

    display: block;

}

.other-input {

    display: none;

    margin-top: 20px;

}

#contactValue {

    margin-top: 20px;

}

.reset-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(16, 42, 67, 0.55);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.reset-modal-overlay.is-open {
    display: flex;
}

.reset-modal {
    width: min(520px, 100%);
    background: #ffffff;
    border-radius: 24px;
    padding: 30px 24px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
}

.reset-modal-icon {
    width: 58px;
    height: 58px;
    margin: 0 auto 14px;
    border-radius: 50%;
    background: #fb8c00;
    color: #ffffff;
    font-size: 34px;
    font-weight: 900;
    line-height: 58px;
}

.reset-modal h3 {
    margin: 0 0 10px;
    font-size: 24px;
    color: #102a43;
}

.reset-modal p {
    margin: 0 0 24px;
    color: #486581;
    font-size: 17px;
}

.reset-modal-buttons {
    display: flex;
    gap: 12px;
}

.reset-cancel-button,
.reset-ok-button {
    flex: 1;
    min-height: 54px;
    border-radius: 14px;
    font-size: 18px;
    font-weight: 800;
    cursor: pointer;
}

.reset-cancel-button {
    background: #ffffff;
    color: #0b74de;
    border: 2px solid #0b74de;
}

.reset-ok-button {
    background: #e53935;
    color: #ffffff;
    border: none;
}

.privacy-card {

    border: 2px solid #d7e6d7;

    background: #fbfffb;

}

.privacy-summary {

    font-size: 15px;

    line-height: 1.8;

    color: #333;

}

.privacy-summary p {

    margin: 0 0 10px;

}

.privacy-summary a {

    font-weight: 700;

    color: #1f6f3f;

}

.privacy-check {

    display: flex;

    gap: 10px;

    align-items: flex-start;

    margin-top: 14px;

    font-size: 17px;

    font-weight: 700;

}

.privacy-check input {

    width: 22px;

    height: 22px;

    margin-top: 2px;

}

.privacy-details {
    margin-top: 14px;
    border: 2px solid #d7e6d7;
    border-radius: 14px;
    background: #ffffff;
    overflow: hidden;
}

.privacy-details summary {
    padding: 14px 16px;
    font-weight: 800;
    color: #1f6f3f;
    cursor: pointer;
    background: #f1fff4;
}

.privacy-full-text {
    padding: 16px;
    font-size: 15px;
    line-height: 1.8;
    color: #333;
    max-height: 360px;
    overflow-y: auto;
    border-top: 1px solid #d7e6d7;
}

.privacy-details {
    margin-top: 14px;
    border: 2px solid #d7e6d7;
    border-radius: 14px;
    background: #ffffff;
    overflow: hidden;
}

.privacy-details summary {
    padding: 14px 16px;
    font-weight: 800;
    color: #1f6f3f;
    cursor: pointer;
    background: #f1fff4;
}

.privacy-full-text {
    padding: 16px;
    font-size: 15px;
    line-height: 1.8;
    color: #333;
    max-height: 360px;
    overflow-y: auto;
    border-top: 1px solid #d7e6d7;
}