.blgcal-wrap {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    width: 100%;
    margin: 0 auto;
    padding: 1.5rem;
    box-sizing: border-box;
    background: #fff;
    border-radius: 8px;
}

/* Header */
.blgcal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.2rem;
}
.blgcal-title {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
}
.blgcal-nav {
    background: transparent;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 5px 14px;
    font-size: 18px;
    cursor: pointer;
    color: #555;
    line-height: 1.4;
}
.blgcal-nav:hover { background: #f5f5f5; }

/* Toolbar: filters left, legend right */
.blgcal-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

/* Filters */
.blgcal-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}
.blgcal-fbtn {
    font-size: 14px;
    padding: 4px 14px;
    border-radius: 20px;
    border: 1px solid #ddd;
    background: transparent;
    cursor: pointer;
    color: #555;
}
.blgcal-fbtn:hover { background: #f5f5f5; }
.blgcal-fbtn.active { border-width: 2px; font-weight: 600; }

/* Legend */
.blgcal-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: flex-end;
}
.blgcal-legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    color: #666;
    white-space: nowrap;
}
.blgcal-legend-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Calendar table wrapper — provides border-radius + outer border */
.blgcal-table {
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    overflow: hidden;
}

/* Day labels */
.blgcal-day-labels {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
}
.blgcal-day-labels span {
    text-align: center;
    font-size: 12px;
    color: #888;
    padding: 10px 0;
    font-weight: 700;
    border-right: 1px solid #e8e8e8;
    border-bottom: 1px solid #e8e8e8;
}
.blgcal-day-labels span:last-child { border-right: none; }

/* Grid */
.blgcal-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
}
.blgcal-cell {
    min-height: 110px;
    padding: 10px 8px 8px 8px;
    background: #fff;
    min-width: 0;
    box-sizing: border-box;
    border-right: 1px solid #e8e8e8;
    border-bottom: 1px solid #e8e8e8;
}
/* remove right border on last column, bottom border on last row */
.blgcal-cell:nth-child(7n) { border-right: none; }
.blgcal-grid .blgcal-cell:nth-last-child(-n+7) { border-bottom: none; }
.blgcal-cell.other-month { background: #f9fafb; }
.blgcal-cell.today { background: #EEF5FF; }

/* Date number */
.blgcal-dnum {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    font-size: 13px;
    font-weight: 500;
    color: #333;
    border-radius: 50%;
    margin-bottom: 4px;
}
.blgcal-cell.other-month .blgcal-dnum { color: #bbb; }
.blgcal-cell.today .blgcal-dnum {
    background: #2563EB;
    color: #fff;
    font-weight: 700;
}

/* Post pills */
.blgcal-posts {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}
.blgcal-pill {
    font-size: 11px;
    padding: 3px 7px;
    border-radius: 4px;
    cursor: pointer;
    line-height: 1.45;
    text-decoration: none;
    display: block;
    white-space: normal;
    word-break: break-word;
    width: 100%;
    box-sizing: border-box;
}
.blgcal-pill:hover { opacity: 0.75; text-decoration: none; }
.blgcal-more {
    font-size: 11px;
    color: #aaa;
    margin-top: 2px;
    padding-left: 2px;
}

/* Loading / error */
.blgcal-msg {
    text-align: center;
    padding: 2rem 0;
    font-size: 13px;
    color: #888;
    grid-column: 1 / -1;
}
.blgcal-err { color: #c0392b; }

/* Responsive */
@media (max-width: 640px) {
    .blgcal-cell { min-height: 64px; padding: 6px 4px 4px 4px; }
    .blgcal-dnum { width: 22px; height: 22px; font-size: 11px; }
    .blgcal-pill { font-size: 9px; padding: 2px 4px; }
    .blgcal-title { font-size: 15px; }
    .blgcal-toolbar { flex-direction: column; align-items: flex-start; }
    .blgcal-legend { justify-content: flex-start; }
}
