/* ==========================================================================
   Uni-no-Hama Booking - Public Styles
   Ocean-inspired, clean design for booking widget
   ========================================================================== */

:root {
    --unb-primary: #0ea5e9;
    --unb-primary-dark: #0284c7;
    --unb-primary-light: #e0f2fe;
    --unb-ocean: #06b6d4;
    --unb-ocean-light: #cffafe;
    --unb-success: #10b981;
    --unb-success-light: #d1fae5;
    --unb-warning: #f59e0b;
    --unb-warning-light: #fef3c7;
    --unb-danger: #ef4444;
    --unb-danger-light: #fee2e2;
    --unb-gray-50: #f9fafb;
    --unb-gray-100: #f3f4f6;
    --unb-gray-200: #e5e7eb;
    --unb-gray-300: #d1d5db;
    --unb-gray-400: #9ca3af;
    --unb-gray-500: #6b7280;
    --unb-gray-600: #4b5563;
    --unb-gray-700: #374151;
    --unb-gray-800: #1f2937;
    --unb-radius: 12px;
    --unb-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
    --unb-shadow-lg: 0 4px 12px rgba(0,0,0,0.1);
}

/* Wrapper */
.unb-booking-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
    max-width: 720px;
    margin: 0 auto;
    color: var(--unb-gray-700);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden; /* Prevent any horizontal overflow from child elements */
}
.unb-booking-wrapper * { box-sizing: border-box; }

/* Step Indicator */
.unb-step-indicator {
    margin-bottom: 28px;
    overflow-x: auto;
}
.unb-steps {
    display: flex;
    gap: 4px;
    min-width: 520px;
}
.unb-step {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 8px;
    background: var(--unb-gray-100);
    font-size: 12px;
    color: var(--unb-gray-400);
    transition: all 0.3s;
    white-space: nowrap;
}
.unb-step.active {
    background: var(--unb-primary);
    color: #fff;
}
.unb-step.done {
    background: var(--unb-success-light);
    color: var(--unb-success);
}
.unb-step-num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    font-weight: 700;
    font-size: 12px;
    flex-shrink: 0;
}
.unb-step.active .unb-step-num { background: rgba(255,255,255,0.3); }
.unb-step.done .unb-step-num { background: var(--unb-success); color: #fff; }
.unb-step-text { font-weight: 600; }

/* Panel */
.unb-panel {
    background: #fff;
    border: 1px solid var(--unb-gray-200);
    border-radius: var(--unb-radius);
    padding: 32px;
    box-shadow: var(--unb-shadow);
    animation: unbFadeIn 0.3s ease;
    overflow: hidden; /* Prevent any child overflow */
    max-width: 100%; /* Never exceed parent width */
}
@keyframes unbFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.unb-panel-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--unb-gray-800);
    margin: 0 0 20px;
}

/* Plan Header */
.unb-plan-header {
    text-align: center;
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 2px solid var(--unb-primary-light);
}
.unb-plan-title {
    font-size: 24px;
    font-weight: 800;
    color: var(--unb-primary-dark);
    margin: 0 0 8px;
    line-height: 1.3;
}
.unb-plan-subtitle {
    font-size: 14px;
    color: var(--unb-gray-500);
    margin: 0;
}

/* Plan Description */
.unb-plan-description {
    font-size: 14px;
    line-height: 1.8;
    color: var(--unb-gray-600);
    margin-bottom: 24px;
    padding: 16px 20px;
    background: var(--unb-ocean-light);
    border-radius: 8px;
    border-left: 4px solid var(--unb-ocean);
}

/* Info Cards */
.unb-plan-info-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}
.unb-info-card {
    text-align: center;
    padding: 20px 16px;
    background: var(--unb-gray-50);
    border-radius: 10px;
    border: 1px solid var(--unb-gray-200);
}
.unb-info-icon {
    color: var(--unb-primary);
    margin-bottom: 8px;
}
.unb-info-icon svg { width: 28px; height: 28px; }
.unb-info-label {
    font-size: 12px;
    color: var(--unb-gray-500);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}
.unb-info-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--unb-gray-700);
}

/* Price Cards */
.unb-price-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 24px;
}
.unb-price-card {
    text-align: center;
    padding: 24px 16px;
    background: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 100%);
    border-radius: 10px;
    color: #fff;
}
.unb-price-label {
    font-size: 13px;
    opacity: 0.9;
    margin-bottom: 8px;
    font-weight: 500;
}
.unb-price-amount {
    font-size: 28px;
    font-weight: 800;
    line-height: 1;
}
.unb-yen { font-size: 18px; margin-right: 2px; }
.unb-price-unit { font-size: 14px; font-weight: 400; opacity: 0.8; margin-left: 4px; }

/* Notices */
.unb-notices {
    background: var(--unb-warning-light);
    border: 1px solid #fde68a;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 24px;
}
.unb-notices h4 {
    margin: 0 0 8px;
    font-size: 14px;
    color: #92400e;
}
.unb-notices ul {
    margin: 0;
    padding-left: 20px;
}
.unb-notices li {
    font-size: 13px;
    color: #78350f;
    margin-bottom: 4px;
    line-height: 1.6;
}
.unb-notices-confirm {
    background: #fff7ed;
    border-color: #fed7aa;
}
.unb-notices-confirm h4 { color: #9a3412; }
.unb-notices-confirm li { color: #9a3412; }

/* Buttons */
.unb-action {
    margin-top: 24px;
    text-align: center;
}
.unb-action-dual {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}
.unb-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 32px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    line-height: 1;
    font-family: inherit;
}
.unb-btn-primary {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(14,165,233,0.3);
}
.unb-btn-primary:hover {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(14,165,233,0.4);
}
.unb-btn-primary:active { transform: translateY(0); }
.unb-btn-lg { padding: 16px 48px; font-size: 16px; }
.unb-btn-back {
    background: var(--unb-gray-100);
    color: var(--unb-gray-600);
    border: 1px solid var(--unb-gray-300);
}
.unb-btn-back:hover { background: var(--unb-gray-200); }
.unb-btn-submit {
    min-width: 200px;
}
.unb-btn-arrow { font-size: 18px; }
.unb-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Calendar */
.unb-calendar-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 20px;
}
.unb-cal-prev, .unb-cal-next {
    width: 40px;
    height: 40px;
    border: 1px solid var(--unb-gray-300);
    border-radius: 8px;
    background: #fff;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--unb-gray-600);
    transition: all 0.15s;
}
.unb-cal-prev:hover, .unb-cal-next:hover {
    background: var(--unb-gray-50);
    border-color: var(--unb-primary);
    color: var(--unb-primary);
}
.unb-cal-month {
    font-size: 20px;
    font-weight: 700;
    min-width: 160px;
    text-align: center;
    color: var(--unb-gray-800);
}

.unb-calendar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 16px;
    width: 100%;
    max-width: 100%;
}
.unb-cal-head {
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    padding: 8px 4px;
    color: var(--unb-gray-500);
    min-width: 0; /* Allow shrinking in grid */
    overflow: hidden;
}
.unb-cal-head.sun { color: var(--unb-danger); }
.unb-cal-head.sat { color: var(--unb-primary); }
.unb-cal-cell {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    padding: 4px;
    font-size: 15px;
    font-weight: 700;
    position: relative;
    border: 2px solid transparent;
    min-width: 0; /* Allow grid items to shrink below content size */
    overflow: hidden; /* Clip any content that exceeds cell bounds */
}
.unb-cal-cell:hover:not(.empty):not(.unavailable):not(.past) {
    transform: scale(1.05);
    box-shadow: var(--unb-shadow-lg);
}
.unb-cal-cell.empty { cursor: default; }
.unb-cal-cell.past {
    color: var(--unb-gray-300);
    cursor: default;
}
.unb-cal-cell.available {
    background: var(--unb-success-light);
    color: #065f46;
    border-color: #a7f3d0;
}
.unb-cal-cell.available:hover { border-color: var(--unb-success); }
.unb-cal-cell.few {
    background: var(--unb-warning-light);
    color: #92400e;
    border-color: #fde68a;
}
.unb-cal-cell.few:hover { border-color: var(--unb-warning); }
.unb-cal-cell.full {
    background: var(--unb-danger-light);
    color: #991b1b;
    cursor: default;
    opacity: 0.6;
}
.unb-cal-cell.closed {
    background: var(--unb-gray-100);
    color: var(--unb-gray-400);
    cursor: default;
}
.unb-cal-cell.none {
    background: var(--unb-gray-50);
    color: var(--unb-gray-400);
    cursor: default;
    opacity: 0.5;
}
.unb-cal-cell.unavailable {
    cursor: default;
    opacity: 0.5;
}
.unb-cal-cell.selected {
    border-color: var(--unb-primary);
    box-shadow: 0 0 0 3px rgba(14,165,233,0.2);
}
.unb-cal-day { line-height: 1; margin-bottom: 2px; }
.unb-cal-label {
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.3px;
    line-height: 1;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.unb-cal-cell.sun .unb-cal-day { color: var(--unb-danger); }
.unb-cal-cell.sat .unb-cal-day { color: var(--unb-primary); }
.unb-cal-cell.available.sun, .unb-cal-cell.few.sun { }
.unb-cal-cell.available.sat, .unb-cal-cell.few.sat { }

/* Calendar Legend */
.unb-calendar-legend {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 12px;
    color: var(--unb-gray-500);
}
.unb-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}
.unb-legend-dot {
    width: 14px;
    height: 14px;
    border-radius: 4px;
}
.unb-legend-dot.unb-available { background: var(--unb-success-light); border: 1px solid #a7f3d0; }
.unb-legend-dot.unb-few       { background: var(--unb-warning-light); border: 1px solid #fde68a; }
.unb-legend-dot.unb-full      { background: var(--unb-danger-light); border: 1px solid #fca5a5; }
.unb-legend-dot.unb-closed    { background: var(--unb-gray-100); border: 1px solid var(--unb-gray-300); }

/* Selected Date Display */
.unb-selected-date {
    text-align: center;
    font-size: 18px;
    font-weight: 700;
    color: var(--unb-primary-dark);
    padding: 12px;
    background: var(--unb-primary-light);
    border-radius: 8px;
    margin-bottom: 20px;
}

/* Slots List */
.unb-slots-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.unb-slot-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border: 2px solid var(--unb-gray-200);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}
.unb-slot-item:hover:not(.unavailable) {
    border-color: var(--unb-primary);
    background: var(--unb-primary-light);
    box-shadow: var(--unb-shadow);
}
.unb-slot-item.unavailable {
    opacity: 0.5;
    cursor: default;
    background: var(--unb-gray-50);
}
.unb-slot-item.selected {
    border-color: var(--unb-primary);
    background: var(--unb-primary-light);
    box-shadow: 0 0 0 3px rgba(14,165,233,0.15);
}
.unb-slot-time {
    font-size: 18px;
    font-weight: 700;
    color: var(--unb-gray-800);
}
.unb-slot-info {
    display: flex;
    align-items: center;
    gap: 12px;
}
.unb-slot-symbol {
    font-size: 24px;
    font-weight: 800;
    min-width: 32px;
    text-align: center;
}
.unb-slot-symbol.good    { color: var(--unb-success); }
.unb-slot-symbol.few     { color: var(--unb-warning); }
.unb-slot-symbol.full    { color: var(--unb-danger); }
.unb-slot-remaining {
    font-size: 13px;
    color: var(--unb-gray-500);
    font-weight: 600;
}

/* Booking Summary */
.unb-selected-summary,
.unb-booking-summary {
    background: var(--unb-primary-light);
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 24px;
    font-size: 14px;
}
.unb-selected-summary strong,
.unb-booking-summary strong {
    color: var(--unb-primary-dark);
}

/* Option Selector */
.unb-option-selector {
    margin-bottom: 24px;
}
.unb-option-selector::before {
    content: 'プラン選択';
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: var(--unb-gray-700);
    margin-bottom: 10px;
}
.unb-option-choice {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 20px;
    border: 2px solid var(--unb-gray-200);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 8px;
    background: #fff;
}
.unb-option-choice:last-child {
    margin-bottom: 0;
}
.unb-option-choice:hover {
    border-color: var(--unb-primary);
    background: var(--unb-primary-light);
}
.unb-option-choice.selected {
    border-color: var(--unb-primary);
    background: var(--unb-primary-light);
    box-shadow: 0 0 0 3px rgba(14,165,233,0.15);
}
.unb-option-choice-radio {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid var(--unb-gray-300);
    flex-shrink: 0;
    margin-top: 2px;
    position: relative;
    transition: all 0.2s;
}
.unb-option-choice.selected .unb-option-choice-radio {
    border-color: var(--unb-primary);
    background: var(--unb-primary);
}
.unb-option-choice.selected .unb-option-choice-radio::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    background: #fff;
    border-radius: 50%;
    transform: translate(-50%, -50%);
}
.unb-option-choice-content {
    flex: 1;
    min-width: 0;
}
.unb-option-choice-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--unb-gray-800);
    margin-bottom: 4px;
}
.unb-option-choice-desc {
    font-size: 13px;
    color: var(--unb-gray-500);
    line-height: 1.6;
    margin-bottom: 6px;
}
.unb-option-choice-price {
    font-size: 13px;
    font-weight: 600;
    color: var(--unb-primary-dark);
}

/* Form */
.unb-form-group {
    margin-bottom: 20px;
}
.unb-form-group label {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: var(--unb-gray-700);
    margin-bottom: 6px;
}
.unb-required {
    color: var(--unb-danger);
    font-size: 11px;
    font-weight: 600;
    margin-left: 4px;
    padding: 1px 6px;
    background: var(--unb-danger-light);
    border-radius: 3px;
}
.unb-form-group input,
.unb-form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--unb-gray-200);
    border-radius: 8px;
    font-size: 15px;
    color: var(--unb-gray-800);
    transition: border-color 0.2s;
    font-family: inherit;
    background: #fff;
}
.unb-form-group input:focus,
.unb-form-group textarea:focus {
    outline: none;
    border-color: var(--unb-primary);
    box-shadow: 0 0 0 3px rgba(14,165,233,0.1);
}
.unb-form-group input.error,
.unb-form-group textarea.error {
    border-color: var(--unb-danger);
}
.unb-form-row-inline {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* Number Input */
.unb-number-input {
    display: flex;
    align-items: center;
    border: 2px solid var(--unb-gray-200);
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}
.unb-number-input input {
    border: none !important;
    text-align: center;
    font-size: 20px;
    font-weight: 700;
    padding: 10px 0;
    width: 60px;
    -moz-appearance: textfield;
    box-shadow: none !important;
}
.unb-number-input input::-webkit-outer-spin-button,
.unb-number-input input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.unb-num-btn {
    width: 48px;
    height: 48px;
    border: none;
    background: var(--unb-gray-50);
    font-size: 22px;
    font-weight: 700;
    cursor: pointer;
    color: var(--unb-gray-600);
    transition: background 0.15s;
    flex-shrink: 0;
}
.unb-num-btn:hover { background: var(--unb-gray-200); }
.unb-num-btn:active { background: var(--unb-gray-300); }

/* Price Estimate */
.unb-price-estimate {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 1px solid #bae6fd;
    border-radius: 8px;
    padding: 14px 20px;
    margin-bottom: 24px;
    font-size: 16px;
    font-weight: 700;
    text-align: center;
    color: var(--unb-primary-dark);
}

/* Form Error */
.unb-form-error {
    background: var(--unb-danger-light);
    border: 1px solid #fca5a5;
    border-radius: 8px;
    padding: 12px 16px;
    color: #991b1b;
    font-size: 13px;
    margin-bottom: 16px;
}

/* Confirmation Table */
.unb-confirm-table {
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--unb-gray-200);
    margin-bottom: 20px;
}
.unb-confirm-row {
    display: flex;
    border-bottom: 1px solid var(--unb-gray-100);
}
.unb-confirm-row:last-child { border-bottom: none; }
.unb-confirm-label {
    flex: 0 0 140px;
    padding: 12px 16px;
    background: var(--unb-gray-50);
    font-weight: 600;
    font-size: 13px;
    color: var(--unb-gray-500);
}
.unb-confirm-value {
    flex: 1;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--unb-gray-800);
}
.unb-confirm-intro {
    text-align: center;
    color: var(--unb-gray-500);
    margin-bottom: 20px;
}

/* Complete */
.unb-complete {
    text-align: center;
}
.unb-complete-icon {
    margin-bottom: 16px;
}
.unb-complete-title {
    font-size: 24px;
    font-weight: 800;
    color: var(--unb-success);
    margin: 0 0 12px;
}
.unb-complete-code {
    font-size: 16px;
    color: var(--unb-gray-600);
    margin-bottom: 8px;
}
.unb-complete-code strong {
    font-size: 20px;
    color: var(--unb-primary-dark);
    background: var(--unb-primary-light);
    padding: 4px 16px;
    border-radius: 6px;
    letter-spacing: 1px;
}
.unb-complete-message {
    color: var(--unb-gray-500);
    margin-bottom: 24px;
}
.unb-complete-summary {
    text-align: left;
    background: var(--unb-gray-50);
    border: 1px solid var(--unb-gray-200);
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 24px;
    font-size: 14px;
    line-height: 1.8;
}
.unb-complete-contact {
    background: var(--unb-primary-light);
    border-radius: 8px;
    padding: 16px 20px;
    margin-top: 20px;
    font-size: 14px;
}

/* Error Panel */
.unb-panel-error {
    text-align: center;
}
.unb-error-content {
    padding: 20px;
}
.unb-error-icon { margin-bottom: 16px; }
.unb-error-content h3 {
    color: var(--unb-danger);
    margin: 0 0 8px;
}
.unb-error-content p {
    color: var(--unb-gray-600);
    margin-bottom: 20px;
}

/* Loading */
.unb-loading {
    text-align: center;
    padding: 32px;
    color: var(--unb-gray-400);
    font-size: 14px;
}

/* Responsive */
@media (max-width: 600px) {
    .unb-panel { padding: 20px 16px; }
    .unb-plan-title { font-size: 20px; }
    .unb-price-cards { grid-template-columns: 1fr; }
    .unb-price-amount { font-size: 24px; }
    .unb-form-row-inline { grid-template-columns: 1fr; }

    /* Mobile Step Navigation - 2-line stacked layout */
    .unb-step-indicator { overflow-x: visible; }
    .unb-steps { gap: 2px; min-width: auto; }
    .unb-step {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 4px;
        padding: 8px 4px;
        border-radius: 6px;
        position: relative;
    }
    .unb-step-num {
        width: 26px;
        height: 26px;
        font-size: 13px;
    }
    .unb-step-text {
        display: block;
        font-size: 10px;
        font-weight: 600;
        line-height: 1.2;
        white-space: nowrap;
        letter-spacing: -0.3px;
    }
    /* Active step emphasis on mobile */
    .unb-step.active {
        flex: 1.3;
    }
    .unb-step.active .unb-step-num {
        width: 30px;
        height: 30px;
        font-size: 14px;
        box-shadow: 0 2px 8px rgba(14,165,233,0.3);
    }
    .unb-step.active .unb-step-text {
        font-size: 11px;
        font-weight: 700;
    }
    /* Connector lines between steps on mobile */
    .unb-step:not(:last-child)::after {
        content: '';
        position: absolute;
        top: 19px;
        right: -2px;
        width: 4px;
        height: 2px;
        background: var(--unb-gray-300);
    }
    .unb-step.done:not(:last-child)::after {
        background: var(--unb-success);
    }
    .unb-step.active:not(:last-child)::after {
        background: var(--unb-primary);
    }

    /* ============================================================
       Mobile Calendar - prevent Saturday column overflow
       ============================================================
       Root cause analysis (375px iPhone viewport):
       - .unb-panel padding: 32px (16px each side on mobile)
       - WordPress theme may add body/container padding: ~16-32px
       - Available width for calendar grid: ~295-327px
       - With aspect-ratio:1, cells need min ~42px (label text)
       - 7 cells × 42px + 6 gaps × 4px = 318px > available
       - Combined with border (2px×2) and padding, causes overflow
       
       Fix strategy:
       1. Remove aspect-ratio on mobile (use auto height)
       2. Reduce panel side padding for calendar step only
       3. Force min-width:0 so grid items can shrink below content
       4. Constrain label text to never expand cell width
       5. Wrapper overflow-x:hidden as safety net
       ============================================================ */

    /* Wrapper safety: never allow horizontal overflow */
    .unb-booking-wrapper {
        overflow-x: hidden;
        width: 100%;
        max-width: 100%;
    }

    /* Calendar panel: reduce side padding to maximize grid space */
    #unb-step-1.unb-panel {
        padding-left: 8px;
        padding-right: 8px;
    }

    /* Calendar grid: tighter gaps, force 100% containment */
    .unb-calendar {
        gap: 3px;
        width: 100%;
        max-width: 100%;
        overflow: hidden;
    }

    /* Weekday headers */
    .unb-cal-head {
        font-size: 12px;
        padding: 6px 0;
        min-width: 0;
    }

    /* Date cells: KEY FIX - remove aspect-ratio so cells don't
       force a minimum width from their height constraint.
       Use auto height with fixed padding instead. */
    .unb-cal-cell {
        aspect-ratio: auto;
        min-width: 0;
        max-width: 100%;
        padding: 6px 1px 4px;
        font-size: 12px;
        border-width: 1.5px;
        border-radius: 8px;
        overflow: hidden;
    }

    /* Date number */
    .unb-cal-day {
        font-size: 14px;
        line-height: 1;
        margin-bottom: 1px;
    }

    /* Status labels: constrain to cell width, never expand cell */
    .unb-cal-label {
        font-size: 8px;
        font-weight: 600;
        letter-spacing: -0.3px;
        line-height: 1.1;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
        display: block;
    }

    /* Prevent selected-cell box-shadow from expanding beyond grid */
    .unb-cal-cell.selected {
        box-shadow: 0 0 0 2px rgba(14,165,233,0.25);
    }

    /* Disable hover scale effect on mobile (causes overflow) */
    .unb-cal-cell:hover:not(.empty):not(.unavailable):not(.past) {
        transform: none;
        box-shadow: none;
    }

    /* Calendar nav: slightly smaller month display */
    .unb-cal-month {
        font-size: 18px;
        min-width: 120px;
    }
    .unb-cal-prev, .unb-cal-next {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }
    .unb-calendar-nav {
        gap: 12px;
    }

    /* Calendar legend: compact for mobile */
    .unb-calendar-legend {
        gap: 8px;
        font-size: 11px;
        padding: 0 4px;
    }
    .unb-legend-dot {
        width: 12px;
        height: 12px;
        flex-shrink: 0;
    }
    .unb-legend-item {
        gap: 4px;
    }

    .unb-slot-time { font-size: 15px; }
    .unb-action-dual { flex-direction: column-reverse; }
    .unb-confirm-row { flex-direction: column; }
    .unb-confirm-label { flex: none; }
    .unb-btn-lg { padding: 14px 24px; }
}

/* Extra small screens (320px) */
@media (max-width: 380px) {
    .unb-steps { gap: 1px; }
    .unb-step { padding: 6px 2px; }
    .unb-step-text { font-size: 9px; }
    .unb-step-num { width: 22px; height: 22px; font-size: 11px; }
    .unb-step.active .unb-step-num { width: 26px; height: 26px; font-size: 12px; }
    .unb-step.active .unb-step-text { font-size: 10px; }
    /* Extra small calendar */
    .unb-calendar { gap: 2px; }
    .unb-cal-cell { padding: 4px 0 3px; border-radius: 6px; font-size: 11px; border-width: 1px; }
    .unb-cal-day { font-size: 12px; }
    .unb-cal-label { font-size: 7px; letter-spacing: -0.5px; }
    .unb-cal-head { font-size: 10px; padding: 4px 0; }
    #unb-step-1.unb-panel { padding-left: 4px; padding-right: 4px; }
    .unb-calendar-legend { gap: 4px; font-size: 9px; }
    .unb-cal-month { font-size: 16px; min-width: 100px; }
    .unb-cal-prev, .unb-cal-next { width: 30px; height: 30px; font-size: 14px; }
    .unb-calendar-nav { gap: 8px; }
}
