.pb-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

.pb-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.pb-form.pb-has-border {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 30px;
    background: #fff;
}

.pb-form.pb-font-small {
    font-size: 13px;
}

.pb-form.pb-font-medium {
    font-size: 14px;
}

.pb-form.pb-font-large {
    font-size: 16px;
}

.pb-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.pb-field label {
    font-weight: 500;
    color: #333;
}

.pb-required-label {
    display: inline-block;
    background: #e53935;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 3px;
    margin-left: 8px;
    vertical-align: middle;
}

.pb-field input[type="text"],
.pb-field input[type="email"],
.pb-field input[type="tel"],
.pb-field input[type="number"],
.pb-field select,
.pb-field textarea {
    padding: 12px 14px;
    border: 1px solid;
    border-radius: 6px;
    font-size: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.pb-field textarea {
    min-height: 120px;
    resize: vertical;
}

.pb-date-row {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-bottom: 8px;
}

.pb-date-row .pb-calendar-wrapper {
    flex: 1;
    min-width: 0;
}

.pb-date-row .pb-time-select {
    flex: 1;
    min-width: 0;
}

.pb-date-input {
    cursor: pointer;
    width: 100%;
    padding: 12px 14px;
    border: 1px solid;
    border-radius: 6px;
    font-size: inherit;
    box-sizing: border-box;
}

.pb-calendar-wrapper {
    position: relative;
}

.pb-calendar-popup {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 9999;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    width: 280px;
    padding: 12px 12px 0;
    overflow: hidden;
}

.pb-calendar-popup.pb-open {
    display: block;
}

.pb-cal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.pb-cal-nav {
    background: none;
    border: 1px solid #ddd;
    border-radius: 4px;
    width: 28px;
    height: 28px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.pb-cal-nav:hover {
    background: #f0f0f0;
}

.pb-cal-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.pb-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.pb-cal-weekday {
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: #333;
    padding: 4px 0;
}

.pb-cal-weekday.pb-cal-sun {
    color: #e53935;
}

.pb-cal-weekday.pb-cal-sat {
    color: #1565c0;
}

.pb-cal-day {
    text-align: center;
    padding: 6px 2px;
    font-size: 13px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s;
    color: #111;
}

.pb-cal-day:hover:not(.pb-cal-disabled):not(.pb-cal-empty) {
    background: #f0f4ff;
}

.pb-cal-day.pb-cal-today {
    font-weight: 700;
}

.pb-cal-day.pb-cal-selected {
    color: #000;
    font-weight: 700;
}

.pb-cal-day.pb-cal-disabled {
    color: #777;
    cursor: not-allowed;
}

.pb-cal-day.pb-cal-empty {
    cursor: default;
}

.pb-cal-day.pb-cal-sunday {
    color: #e53935;
}

.pb-cal-day.pb-cal-saturday {
    color: #1565c0;
}

.pb-cal-day.pb-cal-holiday {
    color: #e53935;
}

.pb-cal-day.pb-cal-closed {
    background: #ef9a9a;
    color: #b71c1c;
    cursor: not-allowed;
}

.pb-cal-day.pb-cal-am-closed {
    background: linear-gradient(to bottom, #c8e6c9 50%, #ffffff 50%);
}

.pb-cal-day.pb-cal-pm-closed {
    background: linear-gradient(to bottom, #ffffff 50%, #ffe0b2 50%);
}

.pb-cal-day.pb-cal-temp-closed {
    background: #ffcdd2;
    color: #c62828;
    cursor: not-allowed;
}

.pb-cal-legend {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    padding: 6px 4px;
    margin-top: 4px;
    border-top: 1px solid #eee;
    background: #fafafa;
    margin-left: -12px;
    margin-right: -12px;
    padding-left: 12px;
    padding-right: 12px;
}

.pb-cal-legend-item {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 10px;
    color: #333;
}

.pb-cal-legend-swatch {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    flex-shrink: 0;
}

.pb-cal-legend-open {
    background: #fff;
    border: 1px solid #ccc;
}

.pb-cal-legend-closed {
    background: #ef9a9a;
    border: 1px solid #e57373;
}

.pb-cal-legend-am {
    background: linear-gradient(to bottom, #c8e6c9 50%, #ffffff 50%);
    border: 1px solid #a5d6a7;
}

.pb-cal-legend-pm {
    background: linear-gradient(to bottom, #ffffff 50%, #ffe0b2 50%);
    border: 1px solid #ffcc80;
}

.pb-cal-legend-temp {
    background: #ffcdd2;
    border: 1px solid #ef9a9a;
}

.pb-cal-time-info {
    font-size: 11px;
    color: #333;
    text-align: center;
    padding: 5px 4px 8px;
    background: #fafafa;
    margin-left: -12px;
    margin-right: -12px;
    border-top: 1px solid #eee;
}

.pb-time-select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid;
    border-radius: 6px;
    font-size: inherit;
    background: #fff;
    cursor: pointer;
    box-sizing: border-box;
}

.pb-checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 24px;
}

.pb-radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 24px;
}

.pb-radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.pb-radio-label input[type="radio"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.pb-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.pb-checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.pb-file-wrapper {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pb-file-hint {
    font-size: 12px;
    color: #333;
    margin: 0;
}

.pb-file-error {
    font-size: 12px;
    color: #dc3545;
    margin: 4px 0 0;
}

.pb-reception-closed {
    padding: 20px;
    text-align: center;
    color: #333;
    background: #f8f8f8;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
}

.pb-result-back-btn {
    display: block;
    margin: 16px auto 0;
    padding: 10px 24px;
    font-size: 14px;
    color: #333;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 6px;
    cursor: pointer;
}

.pb-result-back-btn:hover {
    background: #f5f5f5;
}

.pb-submit {
    margin-top: 10px;
}

.pb-submit-btn {
    width: 100%;
    padding: 14px 32px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.pb-submit-btn:hover {
    opacity: 0.9;
}

.pb-submit-btn:active {
    transform: scale(0.98);
}

.pb-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.pb-submit-btn.loading {
    position: relative;
    color: transparent !important;
}

.pb-submit-btn.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: pb-spin 0.8s linear infinite;
}

@keyframes pb-spin {
    to { transform: rotate(360deg); }
}

.pb-confirm-screen {
    padding: 20px 0;
}

.pb-confirm-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.pb-confirm-message {
    font-size: 14px;
    color: #333;
    margin-bottom: 24px;
}

.pb-confirm-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 24px;
}

.pb-confirm-table th,
.pb-confirm-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #eee;
    text-align: left;
}

.pb-confirm-table th {
    width: 35%;
    font-weight: 500;
    color: #333;
    background: #f8f9fa;
}

.pb-confirm-table td {
    color: #333;
}

.pb-confirm-buttons {
    display: flex;
    gap: 12px;
}

.pb-back-btn {
    flex: 1;
    padding: 14px 24px;
    font-size: 15px;
    font-weight: 600;
    background: #f0f0f0;
    border: 2px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pb-back-btn:hover {
    background: #e5e5e5;
}

.pb-confirm-submit-btn {
    flex: 2;
    padding: 14px 32px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.pb-confirm-submit-btn:hover {
    opacity: 0.9;
}

.pb-confirm-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.pb-confirm-submit-btn.loading {
    position: relative;
    color: transparent !important;
}

.pb-confirm-submit-btn.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: pb-spin 0.8s linear infinite;
}

.pb-result-screen {
    padding: 40px 20px;
    text-align: center;
}

.pb-result-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.pb-result-icon.success {
    color: #28a745;
}

.pb-result-icon.error {
    color: #dc3545;
}

.pb-result-message {
    font-size: 16px;
    color: #333;
    line-height: 1.6;
}

.pb-error {
    padding: 16px;
    background: #fff5f5;
    border: 1px solid #ffcdd2;
    border-radius: 6px;
    color: #c62828;
    font-size: 14px;
}

.pb-hp-field {
    position: absolute;
    left: -9999px;
    top: -9999px;
    opacity: 0;
    height: 0;
    width: 0;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
}

.pb-field.error input,
.pb-field.error select,
.pb-field.error textarea {
    border-color: #e53935 !important;
    box-shadow: 0 0 0 3px rgba(229,57,53,0.2) !important;
}

@media screen and (max-width: 600px) {
    .pb-container {
        padding: 16px;
    }
    .pb-form.pb-has-border {
        padding: 20px;
    }
    .pb-date-row {
        flex-direction: column;
        align-items: stretch; /* 親の align-items:flex-start を打ち消し、縦積み時に幅いっぱいへ */
    }
    .pb-date-row .pb-calendar-wrapper {
        width: 100%;
    }
    .pb-date-row .pb-date-input {
        width: 100%;
        box-sizing: border-box;
    }
    .pb-date-row .pb-time-select {
        width: 100%;
    }
    .pb-radio-group {
        flex-direction: column;
        gap: 10px;
    }
    .pb-confirm-buttons {
        flex-direction: column;
    }
    .pb-back-btn,
    .pb-confirm-submit-btn {
        flex: none;
        width: 100%;
    }
    .pb-confirm-table th,
    .pb-confirm-table td {
        display: block;
        width: 100%;
    }
    .pb-confirm-table th {
        border-bottom: none;
        padding-bottom: 4px;
    }
    .pb-confirm-table td {
        padding-top: 4px;
        padding-bottom: 16px;
    }
    .pb-calendar-popup {
        width: 260px;
    }
}