.at-picker-container {
    position: fixed;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    width: 100%; 
    max-width: 400px; 
    overflow-x: hidden !important;
    z-index: 10001;
    font-family: 'Inter', sans-serif;
    color: #1F2937;
    overflow: hidden;
    user-select: none;
    display: none;
    border: 1px solid #E5E7EB;
    box-sizing: border-box !important;
}

.at-picker-container.full-width {
    max-width: none !important;
}


.at-picker-container * {
    box-sizing: border-box;
}

.at-picker-container.show {
    display: block;
}

.at-picker-container.show.dual-view {
    display: flex;
    width: 650px;
}

.at-picker-pane {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.at-picker-pane:first-child {
    border-right: 1px solid #F3F4F6;
}

/* Header */
.at-picker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #F3F4F6;
}

.at-picker-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #6B7280;
    font-size: 1.1rem;
    padding: 5px 10px;
    border-radius: 6px;
    transition: all 0.2s;
}

.at-picker-btn:hover {
    background: #F3F4F6;
    color: #111827;
}

.at-picker-current-view {
    font-weight: 700;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 6px;
}

.at-picker-current-view:hover {
    background: #F3F4F6;
}

/* Body */
.at-picker-body {
    padding: 10px;
    width: 100%;
    overflow-x: hidden;
}

/* Calendar View */
.at-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr)); /* Force columns to shrink */
    text-align: center;
    font-size: 0.85rem;
    width: 100%;
}

.at-weekday {
    color: #9CA3AF;
    font-weight: 600;
    padding: 8px 0;
}

.at-day {
    padding: 10px 0;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
    font-weight: 500;
}

.at-day:hover:not(.empty) {
    background: #F3F4F6;
}

.at-day.selected,
.at-day.range-start,
.at-day.range-end {
    background: #4f46e5 !important;
    color: #fff !important;
}

.at-day.range-between {
    background: rgba(79, 70, 229, 0.1) !important;
    color: #4f46e5 !important;
    border-radius: 0;
}

.at-day.range-start {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.at-day.range-end {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.at-day.today {
    color: #4f46e5;
    font-weight: 800;
}

.at-day.disabled {
    color: #D1D5DB;
    cursor: not-allowed;
}

.at-day.empty {
    cursor: default;
}

.at-grid-view {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr)); 
    gap: 5px;
    padding: 10px;
    max-height: 320px;
    overflow-y: auto;
    overflow-x: hidden;
}

.at-grid-item {
    padding: 10px 0;
    text-align: center;
    cursor: pointer;
    border-radius: 8px;
    font-weight: 600;
    background: #F9FAFB;
    transition: all 0.2s;
    border: 1px solid transparent;
    font-size: 0.9rem;
}

.at-grid-item:hover {
    background: #F3F4F6;
    border-color: #D1D5DB;
}

.at-grid-item.selected {
    background: #06D599;
    color: #fff;
}

.at-grid-item.disabled {
    color: #D1D5DB;
    cursor: not-allowed;
    background: #fff;
    opacity: 0.6;
}

/* Footer (Time Toggle / Info) */
.at-picker-footer {
    padding: 15px;
    border-top: 1px solid #F3F4F6;
    background: #fff;
    position: relative;
}

.at-footer-info-area {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.at-warning-text {
    font-size: 0.7rem;
    color: #9CA3AF;
    margin-bottom: 0;
    line-height: 1.3;
    flex: 1;
}

.at-time-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.at-time-label {
    font-weight: 700;
    color: #111827;
    font-size: 0.85rem;
    line-height: 1.2;
    text-align: right;
}

.at-time-row {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.at-time-btn {
    background: #F9FAFB;
    border: 1px solid #E5E7EB;
    padding: 6px 12px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    min-width: 55px;
    text-align: center;
    transition: all 0.2s;
}

.at-time-btn.active {
    border-color: #06D599;
    color: #06D599;
    background: #ecfdf5;
}

/* Mobile Grid Time Wrapper (Overlay) */
.at-grid-time-wrapper {
    background: #fff;
    border-top: 1px solid #F3F4F6;
    padding: 20px 15px; /* Increased padding for better centering and "book-like" look */
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.1);
    animation: at-slide-up 0.3s ease-out;
    width: 100% !important;
    box-sizing: border-box !important;
}

@keyframes at-slide-up {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.at-grid-time-wrapper .at-grid-view {
    max-height: 280px;
    overflow-y: auto;
}

.at-mobile-confirm-btn {
    display: none !important; /* User explicitly requested to remove it */
}

/* Mobile Modal & Wheel Picker Additions */
.at-picker-container.stacked-view {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100% !important;
    width: 100% !important;
    border: none;
    border-radius: 0;
    box-shadow: none;
    background: #fff;
    overflow: hidden;
}

.at-picker-scroll-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Sticky Weekdays for Mobile Modal */
.at-weekdays-sticky-mobile {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    text-align: center;
    background: #fff;
    padding: 10px 10px 5px 10px;
    border-bottom: 1px solid #F3F4F6;
    position: sticky;
    top: 0;
    z-index: 10;
    width: 100%;
    box-sizing: border-box;
}

@media (max-width: 479px) {
    .at-weekdays-sticky-mobile {
        padding: 10px 5px 5px 5px;
    }
}

/* Wheel Picker (iOS Style) */
.at-wheel-picker {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 250px !important; 
    background: #fff;
    position: relative;
    overflow: hidden !important;
    padding: 10px 0;
}

/* Vignette/Gradient Overlays for Wheel effect */
.at-wheel-picker::before,
.at-wheel-picker::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 80px;
    z-index: 5;
    pointer-events: none;
}

.at-wheel-picker::before {
    top: 0;
    background: linear-gradient(to bottom, rgba(255,255,255,1) 0%, rgba(255,255,255,0) 100%);
}

.at-wheel-picker::after {
    bottom: 0;
    background: linear-gradient(to top, rgba(255,255,255,1) 0%, rgba(255,255,255,0) 100%);
}

.at-wheel {
    flex: 1;
    height: 100%;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 0;
    position: relative;
}

.at-wheel::-webkit-scrollbar {
    display: none;
}

.at-wheel-list {
    display: flex;
    flex-direction: column;
}

.at-wheel-item {
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: 500;
    color: #9ca3af;
    scroll-snap-align: center;
    transition: color 0.2s, font-size 0.2s;
    cursor: pointer;
}

.at-wheel-item.selected {
    color: #06D599; /* Primary color for selection */
    font-weight: 800;
    font-size: 1.6rem;
    line-height: 44px;
}

.at-wheel-item.disabled {
    opacity: 0.3;
    pointer-events: none;
}

.at-wheel-center {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 44px; /* Slightly taller for better touch targets */
    margin-top: -22px;
    border-top: 2px solid rgba(6, 213, 153, 0.1); 
    border-bottom: 2px solid rgba(6, 213, 153, 0.1);
    background: rgba(6, 213, 153, 0.05); /* Subtle highlight */
    pointer-events: none;
    z-index: 4;
}

/* Date Wheel Picker Styles (Global for Birthdays) */
.at-wheel-date-container {
    display: flex;
    justify-content: stretch;
    align-items: center;
    height: 250px; /* Match new height */
    background: #fff;
    padding: 0;
    gap: 0;
}

/* Base Wheel Styles (Mobile Default) */
.at-wheel-days, .at-wheel-months, .at-wheel-years {
    flex: 1;
}

.at-wheel-days .at-wheel-item, 
.at-wheel-months .at-wheel-item, 
.at-wheel-years .at-wheel-item {
    justify-content: center;
    padding: 0;
}

.at-wheel-item {
    font-size: 1.1rem;
    height: 40px;
    line-height: 40px; /* Force consistent vertical center */
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    white-space: nowrap;
}

.at-wheel-item.selected {
    font-size: 1.3rem;
    line-height: 40px; /* Keep same line-height even when large */
}

/* Desktop Specific Wheel Enhancements - Now applies to Tablet/Small Desktop too */
@media (min-width: 480px) {
    .at-wheel-days { flex: 1; }
    .at-wheel-months { flex: 2.5; }
    .at-wheel-years { flex: 1.5; }

    .at-wheel-days .at-wheel-item { justify-content: flex-start; padding-left: 5px; }
    .at-wheel-months .at-wheel-item { justify-content: center; }
    .at-wheel-years .at-wheel-item { justify-content: flex-end; padding-right: 5px; }

    .at-wheel-item {
        font-size: 0.7rem;
    }

    .at-wheel-item.selected {
        font-size: 0.85rem;
    }
}

.at-wheel-separator {
    font-size: 1.8rem;
    font-weight: 700;
    color: #1e2d44;
    padding: 0 10px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 6;
}

/* Bubble Wheel Wrapper */
.at-wheel-wrapper {
    position: absolute;
    bottom: 85px; 
    background: #fff;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    width: 62px;
    max-height: 350px;
    z-index: 1000;
    transform: translateX(-50%);
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.2s, visibility 0s;
}

/* Integrated Dual-View for Search Modal */
.at-wheel-wrapper.dual-view {
    position: absolute !important; /* Float over calendar */
    bottom: 100% !important; /* Positioned exactly above the info area */
    right: 15px !important; /* Align with right margin of footer */
    left: auto !important;
    transform: translateY(-10px) !important; /* Slight gap from buttons */
    width: 145px !important;
    height: 200px !important;
    visibility: visible !important;
    opacity: 1 !important;
    display: flex !important;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    background: #fff;
    overflow: hidden !important;
    z-index: 100;
}

.at-wheel-wrapper.dual-view .at-wheel-picker {
    height: 200px !important;
    width: 100%;
    justify-content: center;
}

.at-wheel-wrapper.dual-view .at-wheel-picker::before,
.at-wheel-wrapper.dual-view .at-wheel-picker::after {
    height: 50px !important; 
}

.at-wheel-wrapper.dual-view .at-wheel-center {
    border-top: 1px solid rgba(6, 213, 153, 0.4);
    border-bottom: 1px solid rgba(6, 213, 153, 0.4);
    background: rgba(6, 213, 153, 0.08);
    left: 5px;
    right: 5px;
}

.at-wheel-wrapper.active {
    visibility: visible;
    opacity: 1;
    animation: at-bubble-in 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes at-bubble-in {
    from { opacity: 0; transform: translateX(-50%) translateY(10px) scale(0.95); }
    to { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}

.at-wheel-done-btn {
    width: 100%;
    padding: 10px;
    background: #F9FAFB;
    border: none;
    border-top: 1px solid #F3F4F6;
    color: #06D599;
    font-weight: 700;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
    cursor: pointer;
}

/* Mobile Adjustments for ATPicker - General Tweaks (No width override) */
@media (max-width: 479px) {
    .at-picker-container {
        box-shadow: none !important;
        border: none !important;
    }
    
    .at-picker-body {
        padding: 5px 0 !important; 
        width: 100% !important;
        overflow-x: hidden !important;
    }

    .at-calendar-grid {
        width: 100% !important;
        box-sizing: border-box !important;
        font-size: 0.78rem;
    }
    
    .at-day {
        padding: 8px 0;
    }

    .at-month-section-header {
        padding: 15px 10px 10px;
        font-weight: 700;
        font-size: 0.95rem;
        color: #1e2d44;
    }

    .at-picker-header {
        padding: 10px 15px;
    }

    /* Larger Birthday Wheels for Mobile - Consistent height for JS */
    .at-wheel-date-container {
        height: 250px; 
    }
    
    .at-wheel-item {
        font-size: 1.15rem; /* Slightly larger for touch but not huge */
        height: 40px; /* Reset to 40px to match JS logic */
    }
    
    .at-wheel-center {
        height: 40px;
        margin-top: -20px;
    }
}

/* Extra responsiveness for all mobile screens (up to 500px) */
@media (max-width: 500px) {
    .at-picker-container {
        width: 100vw !important;
        max-width: 100vw !important;
        left: 0 !important;
        right: 0 !important;
        margin: 0 !important;
        border-radius: 0 !important;
        border: none !important;
        box-shadow: none !important;
    }

    .at-weekdays-sticky-mobile {
        padding: 5px 0 !important;
        grid-template-columns: repeat(7, 1fr) !important;
    }

    .at-weekdays-sticky-mobile .at-weekday {
        font-size: 0.62rem !important;
        letter-spacing: -0.03em !important;
    }

    .at-footer-info-area {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 5px !important;
        padding: 5px 10px !important;
    }

    .at-warning-text {
        font-size: 0.6rem !important;
        line-height: 1.1 !important;
        text-align: left !important;
        width: 100% !important;
        margin-bottom: 3px !important;
    }

    .at-time-wrapper {
        width: 100% !important;
        justify-content: flex-start !important;
        gap: 10px !important;
    }

    .at-time-label {
        font-size: 0.7rem !important;
        text-align: left !important;
        white-space: nowrap !important;
    }

    .at-month-section {
        padding: 0 !important; /* Zero padding around months */
        width: 100% !important;
    }

    .at-picker-body {
        padding: 0 !important; /* ZERO horizontal padding for the grid */
        width: 100% !important;
    }

    .at-month-section-header {
        font-size: 0.82rem !important;
        padding: 8px 10px 4px !important;
        text-align: left !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .at-calendar-grid {
        font-size: 0.85rem !important;
        width: 100% !important;
        grid-template-columns: repeat(7, 1fr) !important; /* Strictly equal columns */
        gap: 0 !important; /* No gaps in grid */
        padding: 0 !important;
        margin: 0 !important;
    }

    .at-day {
        padding: 6px 0 !important; /* Slightly more vertical space */
        font-size: 0.95rem !important;
        min-width: 0 !important; /* Allow shrinking below content */
    }

    /* Important: Ensure scroll body is not wider than container */
    .at-picker-scroll-body {
        max-width: 100% !important;
        padding: 0 !important;
        overflow-x: hidden !important;
    }
}

/* Medium Mobile / Tablet Adjustments - No full-width override here */
@media (max-width: 768px) {
    .at-picker-container.dual-view {
        flex-direction: column !important;
        width: 100% !important;
    }

    .at-picker-pane {
        width: 100% !important;
        border-right: none !important;
        flex: none !important;
    }
    
    .at-grid-view {
        max-height: 280px; 
    }

    .at-wheel-date-container {
        padding: 0 5px;
    }

    .at-wheel-item {
        font-size: 1.15rem;
    }
}