.fstrb {
    font-family: var(--fstrb-current-font, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif);
    max-width: 100%;
    color: var(--fstrb-current-text, #1f2937);
    line-height: 1.5;
}

.fstrb .fstrb-row {
    display: flex;
    gap: 12px;
    align-items: center;
    margin: 12px 0;
    flex-wrap: wrap;
}

.fstrb-selection-row {
    margin: 24px 0;
}

.fstrb-label-block {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--fstrb-current-text, #374151);
}

.fstrb input,
.fstrb textarea,
.fstrb select {
    padding: 10px 14px;
    border: 1px solid var(--fstrb-current-border, #d1d5db);
    border-radius: var(--fstrb-current-radius, 10px);
    font-size: 14px;
    background: var(--fstrb-current-bg, #fff);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.fstrb input:focus,
.fstrb textarea:focus,
.fstrb select:focus {
    outline: none;
    border-color: var(--fstrb-current-primary, #111);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}

.fstrb textarea {
    width: 100%;
    min-height: 100px;
}

.fstrb .fstrb-btn {
    border: 1px solid var(--fstrb-current-border, #d1d5db);
    color: var(--fstrb-current-text, #111);
    border-radius: var(--fstrb-current-radius, 10px);
    background: var(--fstrb-current-bg, #fff);
    padding: 10px 18px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.fstrb .fstrb-btn:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

.fstrb .fstrb-btn-primary {
    background: var(--fstrb-current-primary, #111);
    color: #fff;
    border-color: var(--fstrb-current-primary, #111);
}

.fstrb .fstrb-btn-primary:hover {
    filter: brightness(1.1);
}

/* Calendar Styles */
.fstrb-calendar {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.fstrb-cal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.fstrb-prev,
.fstrb-next {
    width: 36px;
    height: 36px;
    padding: 0 !important;
    border-radius: 50% !important;
    font-size: 20px !important;
}

.fstrb-cal-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--fstrb-current-text, #111827);
}

.fstrb-cal-grid-container {
    display: flex;
    flex-wrap: wrap;
    gap: 32px;
    justify-content: flex-start;
}

.fstrb-month-block {
    flex: 1 1 300px;
    max-width: 100%;
    min-width: 280px;
}

.fstrb-month-title {
    text-align: center;
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 20px;
    color: #111827;
}

.fstrb-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    width: 100%;
}

.fstrb-cal-wd {
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    text-align: center;
    padding-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.fstrb-cal-day {
    border: 1px solid var(--fstrb-current-border, #e5e7eb);
    border-radius: var(--fstrb-current-radius, 12px);
    padding: 8px;
    min-height: 52px;
    position: relative;
    cursor: pointer;
    background: var(--fstrb-current-bg, #fff);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    transition: all 0.2s;
    user-select: none;
}

.fstrb-cal-day:hover:not(.past):not(.occ):not(.fstrb-checkin):not(.fstrb-checkout):not(.fstrb-checkout-checkin) {
    border-color: var(--fstrb-current-primary, #111);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.fstrb-cal-day.occ {
    background: #f9fafb;
    border-color: var(--fstrb-current-border, #f3f4f6);
    cursor: not-allowed;
    color: var(--fstrb-current-text, #9ca3af);
    opacity: 0.8;
}

.fstrb-cal-day.past {
    opacity: 0.4;
    cursor: not-allowed;
}

.fstrb-cal-day.fstrb-checkout {
    background: linear-gradient(135deg, var(--fstrb-current-border, #f3f4f6) 50%, var(--fstrb-current-bg, #ffffff) 50%);
}

.fstrb-cal-day.fstrb-checkin {
    background: linear-gradient(135deg, var(--fstrb-current-bg, #ffffff) 50%, var(--fstrb-current-border, #f3f4f6) 50%);
}

.fstrb-cal-day.fstrb-checkout-checkin {
    background: linear-gradient(to bottom, #f3f4f6 48%, #d1d5db 48%, #d1d5db 52%, #f3f4f6 52%);
}

.fstrb-cal-day .d {
    font-weight: 700;
    font-size: 14px;
}

.fstrb-cal-day .tag {
    font-size: 10px;
    opacity: 0.8;
    margin-top: 4px;
    line-height: 1.1;
}

.fstrb-cal-day.sel {
    outline: 2px solid var(--fstrb-current-primary, #111);
    outline-offset: -2px;
    z-index: 10;
}

.fstrb-cal-day.inrange {
    background: rgba(0, 0, 0, 0.04);
}

.fstrb-cal-legend {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    flex-wrap: wrap;
    border-top: 1px solid #f3f4f6;
    padding-top: 20px;
}

.fstrb-pill {
    border: 1px solid var(--fstrb-current-border, #e5e7eb);
    border-radius: 999px;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 500;
    background: var(--fstrb-current-bg, #fff);
    color: var(--fstrb-current-text, #374151);
}

.fstrb-pill-sel {
    border-color: var(--fstrb-current-primary, #111);
    font-weight: 600;
}

.fstrb-cal-selected {
    margin-top: 16px;
}

.fstrb-selected-range {
    font-weight: 700;
    font-size: 15px;
    color: var(--fstrb-current-primary, #111);
}

/* Redundancy Management */
.fstrb-single-month .fstrb-month-title {
    display: none;
}

/* Mobile Optimizations */
@media (max-width: 640px) {
    .fstrb-calendar {
        padding: 16px;
    }

    .fstrb-cal-grid-container {
        gap: 24px;
    }

    .fstrb-cal-day {
        min-height: 48px;
        padding: 6px;
    }

    .fstrb-cal-day .tag {
        display: none;
    }
}

@media (max-width: 320px) {
    .fstrb-month-block {
        min-width: 100%;
    }
}