.trc-aforms-zero-hidden {
    display: none !important;
}

.trc-aforms-monitor-value-hidden {
    visibility: hidden !important;
}

/* AForms本来のText入力を唯一の入力欄として利用する。 */
input[data-trc-date-field="1"],
input[data-trc-time-field="1"] {
    box-sizing: border-box;
    width: min(100%, 22rem) !important;
    max-width: 100% !important;
    min-height: 48px;
    font-size: 16px;
}

/* 左側は手入力、右端56pxは常時見えるカレンダー領域。 */
input[data-trc-date-field="1"] {
    padding-right: 68px !important;
    background-color: #fff !important;
    background-repeat: no-repeat, no-repeat !important;
    background-position: right 17px center, center !important;
    background-size: 22px 22px, 100% 100% !important;
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%231f4e79' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cpath d='M16 3v4M8 3v4M3 10h18'/%3E%3C/svg%3E"),
        linear-gradient(to right,
            transparent 0,
            transparent calc(100% - 56px),
            #9fb8d1 calc(100% - 56px),
            #9fb8d1 calc(100% - 55px),
            #eaf3fb calc(100% - 55px),
            #eaf3fb 100%) !important;
}

input[data-trc-date-field="1"][data-trc-picker-hover="1"] {
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cpath d='M16 3v4M8 3v4M3 10h18'/%3E%3C/svg%3E"),
        linear-gradient(to right,
            transparent 0,
            transparent calc(100% - 56px),
            #2f6fb0 calc(100% - 56px),
            #2f6fb0 100%) !important;
}

/* 独自カレンダー：PCで十分な大きさを確保し、土日祝を日本の一般的な配色にする。 */
.trc-aforms-calendar {
    position: fixed;
    z-index: 2147483000;
    box-sizing: border-box;
    width: min(420px, calc(100vw - 24px));
    padding: 14px;
    border: 1px solid #b8c8d8;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 12px 36px rgba(23, 59, 92, 0.22);
    color: #222;
    font-family: inherit;
}

.trc-aforms-calendar[hidden] {
    display: none !important;
}

.trc-aforms-cal-header {
    display: grid;
    grid-template-columns: 52px 1fr 52px;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.trc-aforms-cal-title {
    text-align: center;
    font-size: 20px;
    color: #173b5c;
}

.trc-aforms-cal-nav,
.trc-aforms-cal-close {
    border: 1px solid #aac0d6;
    border-radius: 8px;
    background: #f7fbff;
    color: #1f4e79;
    cursor: pointer;
}

.trc-aforms-cal-nav {
    min-width: 52px;
    min-height: 44px;
    font-size: 30px;
    line-height: 1;
}

.trc-aforms-cal-nav:hover,
.trc-aforms-cal-close:hover {
    background: #eaf3fb;
    border-color: #2f6fb0;
}

.trc-aforms-cal-weekdays,
.trc-aforms-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.trc-aforms-cal-weekdays {
    margin-bottom: 5px;
    font-weight: 700;
    text-align: center;
    font-size: 15px;
}

.trc-aforms-cal-weekdays > span {
    padding: 5px 0;
}

.trc-aforms-cal-empty,
.trc-aforms-cal-day {
    min-width: 0;
    min-height: 48px;
}

.trc-aforms-cal-day {
    border: 1px solid transparent;
    border-radius: 8px;
    background: #fff;
    color: #222;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
}

.trc-aforms-cal-day:hover:not(:disabled) {
    border-color: #6fa0cf;
    background: #eef6fd;
}

.trc-aforms-calendar .is-sunday-holiday {
    color: #c62828 !important;
}

.trc-aforms-calendar .is-saturday {
    color: #1565c0 !important;
}

.trc-aforms-cal-day.is-today {
    box-shadow: inset 0 0 0 2px #9fb8d1;
}

.trc-aforms-cal-day.is-selected {
    border-color: #2f6fb0;
    background: #dceeff;
    box-shadow: inset 0 0 0 1px #2f6fb0;
}

.trc-aforms-cal-day.is-past {
    opacity: 0.28;
    cursor: not-allowed;
    background: #f5f6f8;
}

.trc-aforms-cal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e0e6ec;
    font-size: 13px;
    color: #666;
}

.trc-aforms-cal-close {
    min-height: 38px;
    padding: 0 16px;
    font-size: 14px;
    font-weight: 700;
}

/* 時刻はAForms本来のText入力欄へ直接手入力する。候補リストや時計アイコンは付けない。 */
input[data-trc-time-field="1"] {
    padding-right: 12px !important;
    background-color: #fff !important;
    background-image: none !important;
}

@media (max-width: 640px) {
    input[data-trc-date-field="1"],
    input[data-trc-time-field="1"] {
        width: 100% !important;
        max-width: 100% !important;
    }

    .trc-aforms-calendar {
        width: calc(100vw - 20px);
        padding: 10px;
        border-radius: 10px;
    }

    .trc-aforms-cal-header {
        grid-template-columns: 46px 1fr 46px;
    }

    .trc-aforms-cal-title {
        font-size: 18px;
    }

    .trc-aforms-cal-nav {
        min-width: 46px;
        min-height: 42px;
    }

    .trc-aforms-cal-empty,
    .trc-aforms-cal-day {
        min-height: 42px;
    }

    .trc-aforms-cal-day {
        font-size: 16px;
    }
}


/* 契約区分ごとの申込期限を超えたレンタル希望日を明確にエラー表示する。 */
input[data-trc-booking-limit-invalid="1"] {
    border-color: #d64545 !important;
    box-shadow: 0 0 0 2px rgba(214, 69, 69, 0.13) !important;
}

.trc-aforms-booking-limit-error {
    margin-top: 7px;
    color: #c62828;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.55;
}

.trc-aforms-calendar .trc-aforms-cal-day.is-over-booking-limit {
    opacity: 0.30;
    cursor: not-allowed;
    background: #f5f6f8;
}
