.p-contact__content {
    padding-top: 8.5rem;
    padding-bottom: 15rem;
}

.p-contact__breadcrumb ol {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    margin: 0;
    padding: 0;
    color: #6d7887;
    font-size: 1.1rem;
}

.p-contact__breadcrumb li+li::before {
    margin-right: 0.7rem;
    color: #9ca5b2;
    content: ">";
}

.p-contact__breadcrumb a {
    color: inherit;
}

.p-contact__guide {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 33rem;
    align-items: center;
    gap: 4rem;
    min-height: 19rem;
    padding: 2.8rem 3.2rem 3.2rem 4.5rem;
    border: 1px solid #e8edf3;
    border-radius: 1rem;
    background: #f8fafc;
}

.p-contact__guide-message {
    display: flex;
    align-items: center;
    gap: 2.4rem;
}

.p-contact__guide-icon {
    display: grid;
    flex: 0 0 13.5rem;
    width: 13.5rem;
    height: 13.5rem;
    border-radius: 50%;
    background: #eaf2f8;
    place-items: center;
}

.p-contact__guide-icon img {
    display: block;
    max-width: 100%;
    height: auto;
}

.p-contact__guide h2 {
    margin: 0 0 1.2rem;
    color: #000000;
    font-size: 2.4rem;
    line-height: 1.45;
}

.p-contact__guide p {
    margin: 0;
    color: #000000;
    font-size: 1.2rem;
    line-height: 2;
}

.p-contact__guide-phone {
    --contact-guide-phone-label-width: min(30rem, 100%);
    --contact-guide-phone-divider-left: -4rem;
    position: relative;
    display: grid;
    gap: 0.35rem;
    text-align: center;
}

.p-contact__guide-phone::before {
    position: absolute;
    top: 0;
    bottom: 0;
    left: var(--contact-guide-phone-divider-left);
    border-left: 1px solid #dce4ec;
    content: "";
}

.p-contact__guide-phone span {
    justify-self: center;
    width: var(--contact-guide-phone-label-width);
    margin-bottom: -0.6rem;
    padding: 0.8rem 2rem;
    background: #e9f0f6;
    color: #000000;
    font-size: 1.8rem;
    font-weight: 700;
    border-radius: 0.3rem;
}

.p-contact__guide-phone a {
    color: #0c166f;
    font-size: 4.8rem;
    font-weight: 700;
    line-height: 1.15;
}

.p-contact__guide-phone small {
    color: #000000;
    font-size: 1.2rem;
}

.p-contact__form {
    display: flex;
    flex-direction: column;
    margin-top: 8.7rem;
    border-top: 1px solid #e6e6e6;
}

.p-contact__honeypot {
    order: 0;
    position: absolute;
    left: -9999px;
    overflow: hidden;
    width: 1px;
    height: 1px;
}

.p-contact__type-fieldset {
    order: 1;
}

.p-contact__field {
    order: 2;
}

.p-contact__conditional-fields {
    order: 3;
}

.p-contact__field--contact-method {
    order: 4;
}

.p-contact__field--contact-availability {
    order: 5;
}

.p-contact__field--message {
    order: 6;
}

.p-contact__privacy-note {
    order: 7;
}

.p-contact__actions {
    order: 8;
}

.p-contact__field,
.p-contact__type-fieldset {
    display: grid;
    grid-template-columns: 24rem minmax(0, 1fr);
    min-width: 0;
    gap: 4.0rem;
    margin: 0;
    padding: 2rem 0 2.5rem;
    border: 0;
    border-bottom: 1px solid #e6e6e6;
}

.p-contact__legend,
.p-contact__label {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 0;
    color: #222;
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1.5;
}

.p-contact__label small {
    display: block;
    margin-top: 0.3rem;
    color: #000000;
    font-size: 1.2rem;
    font-weight: 400;
}

.p-contact__label:has(small) {
    display: block;
}

.p-contact__required {
    flex: 0 0 auto;
    display: inline-block;
    margin-left: 0;
    padding: 0.35rem 1.0rem;
    background: #eff6ff;
    color: #1c29a7;
    font-size: 1.4rem;
    font-weight: bold;
    /* line-height: 1.35; */
    vertical-align: middle;
}

.p-contact__required[hidden] {
    display: none;
}

.p-contact__type-list,
.p-contact__radio-list {
    display: grid;
    min-width: 0;
    gap: 1.05rem;
}

.p-contact__type-fieldset .p-contact__type-list {
    padding-top: 0.9rem;
}

.p-contact__radio {
    display: flex;
    align-items: center;
    gap: 1.1rem;
    /* Only the button and its text are clickable, not the empty space to the right. */
    width: fit-content;
    max-width: 100%;
    color: #505a65;
    font-size: 1.8rem;
    line-height: 1.45;
    cursor: pointer;
}

/* The text sat about 2px above the center of the button. */
.p-contact__radio span {
    position: relative;
    top: 0.1rem;
}

.p-contact__radio input {
    flex: 0 0 auto;
    width: 2rem;
    height: 2rem;
    accent-color: #2547d1;
}

/* When the browser jumps to an empty required field, it stops below the fixed header with the field's label in view. */
.p-contact__form input,
.p-contact__form select,
.p-contact__form textarea {
    scroll-margin-top: 16rem;
}

@media screen and (max-width: 1000px) {
    .p-contact__form input,
    .p-contact__form select,
    .p-contact__form textarea {
        scroll-margin-top: 12rem;
    }
}

.p-contact__input,
.p-contact__select,
.p-contact__textarea {
    width: 100%;
    min-height: 5.2rem;
    padding: 1.1rem 1.4rem;
    border: 1px solid #d8dde3;
    border-radius: 0.3rem;
    background: #fff;
    color: #222;
    font: inherit;
    font-size: 1.35rem;
    line-height: 1.5;
}

.p-contact__date-list {
    display: grid;
    gap: 1.1rem;
    max-width: 34rem;
}

.p-contact__date-list label {
    display: grid;
    grid-template-columns: 8rem minmax(0, 1fr);
    align-items: center;
    gap: 1.2rem;
    color: #000000;
    font-size: 1.8rem;
}

.p-contact__date-list .p-contact__input {
    min-height: 4.6rem;
    /* iPhone (Safari) gives date inputs a minimum width of their own, which pushed them off the screen. */
    display: block;
    min-width: 0;
    max-width: 100%;
    -webkit-appearance: none;
    appearance: none;
}

.p-contact__date-list .p-contact__input::-webkit-date-and-time-value {
    text-align: left;
}

/* Touch screens (iPhone / Android) show no calendar icon in date inputs, so the same kind of icon is drawn here.
   Mouse devices keep the browser's own icon. */
@media (hover: none) and (pointer: coarse) {
    .p-contact__date-list .p-contact__input {
        padding-right: 4.4rem;
        background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23222' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4.5' width='18' height='16.5' rx='2'/%3E%3Cpath d='M3 9.5h18M8 2.5v4M16 2.5v4'/%3E%3C/svg%3E") right 1.4rem center / 1.8rem 1.8rem no-repeat;
        position: relative;
    }

    /* Browsers that do draw their own icon (Chrome) keep it working but invisible over the drawn one, so only one shows. */
    .p-contact__date-list .p-contact__input::-webkit-calendar-picker-indicator {
        position: absolute;
        top: 0;
        right: 0;
        width: 4.4rem;
        height: 100%;
        margin: 0;
        padding: 0;
        opacity: 0;
        cursor: pointer;
    }
}

.p-contact__textarea {
    min-height: 17rem;
    resize: vertical;
}

/* A required field left empty when sending (marked by main.js; cleared once filled in). */
.p-contact__input.is-invalid,
.p-contact__select.is-invalid,
.p-contact__textarea.is-invalid {
    border-color: #d93636;
    background-color: #fff7f7;
}

.p-contact__input::placeholder,
.p-contact__textarea::placeholder {
    color: #b8bec5;
}

.p-contact__conditional-fields[hidden] {
    display: none;
}

.p-contact__privacy-note {
    margin: 5.8rem 0 4.8rem;
    color: #000000;
    text-align: center;
    font-size: 1.6rem;
    line-height: 1.9;
}

.p-contact__privacy-note a {
    color: #9c8610;
    text-decoration: underline;
    text-underline-offset: 0.2rem;
}

.p-contact__actions {
    margin: 0;
    text-align: center;
}

.p-contact__submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24rem;
    min-height: 5rem;
    padding: 1rem 2.5rem 0.8rem;
    border: 0;
    border-radius: 99rem;
    background: #ddc31b;
    color: #fff;
    font: inherit;
    font-size: 2.2rem;
    font-weight: 700;
    cursor: pointer;
}

.p-contact__submit.c-arrow-button {
    gap: 0.8rem;
    padding-right: 2.5rem;
    padding-left: 2.5rem;
}

.p-contact__submit.c-arrow-button::before,
.p-contact__submit.c-arrow-button::after {
    display: none;
}

.p-contact__submit.c-arrow-button i {
    position: relative;
    display: block;
    width: 1.8rem;
    height: 1.2rem;
}

.p-contact__submit.c-arrow-button i::before,
.p-contact__submit.c-arrow-button i::after {
    position: absolute;
    top: 50%;
    border-top: 1.5px solid currentColor;
    content: "";
}

.p-contact__submit.c-arrow-button i::before {
    left: 0;
    width: 1.8rem;
}

.p-contact__submit.c-arrow-button i::after {
    right: 0;
    width: 0.9rem;
    transform: rotate(45deg);
    transform-origin: right center;
}

.p-contact__submit span {
    width: 0.9rem;
    height: 0.9rem;
    margin-left: 1rem;
    border-top: 1px solid currentColor;
    border-right: 1px solid currentColor;
    transform: rotate(45deg);
}

.p-contact__error {
    /* main.js scrolls here when the server sends the visitor back; it stops below the fixed header. */
    scroll-margin-top: 13rem;
    margin: 3rem 0 -2rem;
    padding: 1.2rem 1.6rem;
    border: 1px solid #dc7777;
    background: #fff5f5;
    color: #a32626;
    font-size: 1.3rem;
}

@media screen and (min-width: 769px) and (max-width: 1000px) {
    .p-contact__guide {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 2.8rem;
    }

    .p-contact__guide-phone {
        padding: 2rem 0 0;
        border-top: 1px solid #dce4ec;
    }

    .p-contact__guide-phone::before {
        display: none;
    }

    .p-contact__guide p {
        font-size: 1.3rem;
    }
}

@media screen and (max-width: 768px) {
    .p-contact__content {
        padding-top: 12rem;
        padding-bottom: 12rem;
    }

    .p-contact__guide {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 2.8rem;
    }

    .p-contact__guide-phone {
        padding: 2rem 0 0;
        border-top: 1px solid #dce4ec;
    }

    .p-contact__guide-phone::before {
        display: none;
    }

    .p-contact__field,
    .p-contact__type-fieldset {
        grid-template-columns: 20rem minmax(0, 1fr);
        gap: 2.4rem;
    }

    .p-contact__guide p {
        font-size: 1.3rem;
    }

    .p-contact__form {
        margin-top: 6rem;
    }

    .p-contact__legend,
    .p-contact__label {
        font-size: 1.5rem;
    }

    .p-contact__required {
        font-size: 1.2rem;
    }

    .p-contact__radio,
    .p-contact__date-list label {
        font-size: 1.5rem;
    }

    .p-contact__radio input {
        width: 1.8rem;
        height: 1.8rem;
    }

    .p-contact__privacy-note {
        margin: 4.8rem 0 4rem;
        font-size: 1.4rem;
    }
}

@media screen and (max-width: 480px) {
    .p-contact__content {
        padding-top: 10rem;
        padding-bottom: 10rem;
    }

    .p-contact__guide {
        padding: 2rem;
    }

    .p-contact__guide-message {
        align-items: flex-start;
        gap: 1.5rem;
    }

    .p-contact__guide-icon {
        flex-basis: 6rem;
        width: 6rem;
        height: 6rem;
    }

    .p-contact__guide h2 {
        font-size: 1.7rem;
    }

    .p-contact__guide p {
        font-size: 1.2rem;
        font-feature-settings: "palt";
    }

    .p-contact__guide-phone a {
        font-size: 2.8rem;
    }

    .p-contact__form {
        margin-top: 4rem;
    }

    .p-contact__field,
    .p-contact__type-fieldset {
        display: block;
        padding: 1.6rem 0;
    }

    .p-contact__label,
    .p-contact__legend {
        display: block;
        padding-top: 0;
        margin-bottom: 1.2rem;
    }

    .p-contact__type-list,
    .p-contact__radio-list {
        gap: 1rem;
    }

    .p-contact__privacy-note br,
    .p-contact__guide p br {
        display: none;
    }

    .p-contact__legend,
    .p-contact__label {
        font-size: 1.5rem;
    }

    .p-contact__required {
        font-size: 1.1rem;
    }

    .p-contact__radio,
    .p-contact__date-list label {
        font-size: 1.4rem;
    }

    /* Smartphones: "第一希望" above its input, so the date inputs are as wide as the other inputs. */
    .p-contact__date-list {
        max-width: none;
    }

    .p-contact__date-list label {
        grid-template-columns: minmax(0, 1fr);
        gap: 0.6rem;
    }

    .p-contact__privacy-note {
        margin: 4rem 0 3.2rem;
        font-size: 1.3rem;
    }

    .p-contact__label,
    .p-contact__legend {
        padding-bottom: 0;
        margin-bottom: 0.8rem;
    }

    .p-contact__type-fieldset .p-contact__type-list {
        padding-top: 0;
    }

    .p-contact__textarea {
        display: block;
    }

    .p-contact__submit {
        display: flex;
        width: 100%;
        font-size: 1.8rem;
    }

    /* iOS Safari zooms into inputs smaller than 16px on focus. */
    .p-contact__input,
    .p-contact__select,
    .p-contact__textarea {
        font-size: 1.6rem;
    }

    .p-contact__guide-phone span {
        margin-bottom: 3px;
    }
}

@media screen and (max-width: 1000px) {
    .p-contact__guide-icon {
        display: none;
    }

    .p-contact__guide-message {
        justify-content: center;
        text-align: center;
    }
}

/* The phone number is a tap-to-call link on smartphones only. */
@media screen and (min-width: 481px) {
    .p-contact__guide-phone a {
        pointer-events: none;
        cursor: default;
    }
}