.calendar-layout {
    margin: 0;
    display: grid;
    width: 100%;
    max-width: none;
    flex: 1 1 auto;
    gap: 1rem;
    padding: 1rem 1.25rem 1.5rem;
    min-width: 0;
    min-height: 0;
    align-items: stretch;
}
@media (min-width: 1100px) {
    .calendar-layout {
        grid-template-columns: minmax(0, 1fr) 280px;
    }
    .calendar-layout.is-time {
        grid-template-columns: minmax(0, 1fr) 260px;
    }
}

.cal-seg {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 3px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.55);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset;
}
.cal-seg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 0 0.7rem;
    border-radius: 9px;
    font-size: 12.5px;
    font-weight: 600;
    color: #4f4f4f;
    text-decoration: none;
    border: 0;
    background: transparent;
}
.cal-seg-btn:hover { color: #1e1e1e; background: rgba(255, 255, 255, 0.8); }
.cal-seg-btn.is-active {
    background: #fff;
    color: #1e1e1e;
    box-shadow: 0 4px 12px rgba(30, 30, 30, 0.08);
}
.cal-toolbar-filter .form-input {
    min-width: 180px;
    height: 36px;
}

.cal-board {
    min-width: 0;
    width: 100%;
    overflow: hidden;
    border-radius: 18px;
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.42));
    box-shadow:
        0 16px 40px rgba(30, 30, 30, 0.07),
        0 1px 0 rgba(255, 255, 255, 0.85) inset;
}
.cal-board--week {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 12.5rem);
}
.calendar-layout.is-time .cal-board--week {
    height: 100%;
}

.cal-month-head {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    border-bottom: 1px solid rgba(224, 224, 224, 0.55);
    background: rgba(255, 255, 255, 0.35);
}
.cal-week-head,
.cal-week-allday,
.cal-week-body {
    display: grid;
    width: 100%;
    grid-template-columns: var(--cal-cols, 56px repeat(7, minmax(0, 1fr)));
}
.cal-week-head {
    border-bottom: 1px solid rgba(224, 224, 224, 0.55);
    background: rgba(255, 255, 255, 0.35);
}
.cal-month-dow,
.cal-week-head-day {
    padding: 0.7rem 0.5rem 0.55rem;
    text-align: center;
    font-size: 11px;
    font-weight: 650;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #828282;
}
.cal-month-dow.is-weekend,
.cal-week-head-day.is-weekend { color: #bdbdbd; }
.cal-week-head-day {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
}
.cal-week-dow { font-size: 10.5px; }
.cal-week-date {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 700;
    color: #1e1e1e;
    letter-spacing: 0;
    text-transform: none;
}
.cal-week-head-day.is-today .cal-week-date,
.cal-month-cell.is-today .cal-month-num {
    background: var(--sc-primary);
    color: #fff;
}
.cal-week-head-day.is-today .cal-week-dow { color: var(--sc-primary); }

.cal-month-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
}
.cal-month-cell {
    position: relative;
    min-height: 118px;
    padding: 0.45rem 0.4rem 0.5rem;
    border-right: 1px solid rgba(224, 224, 224, 0.4);
    border-bottom: 1px solid rgba(224, 224, 224, 0.4);
    background: rgba(255, 255, 255, 0.28);
}
.cal-month-cell.is-weekend { background: rgba(252, 190, 0, 0.04); }
.cal-month-cell.is-muted { opacity: 0.42; }
.cal-month-cell.is-today {
    background: rgba(227, 30, 36, 0.06);
    box-shadow: inset 0 0 0 1px rgba(227, 30, 36, 0.22);
}
.cal-month-cell-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.3rem;
}
.cal-month-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    color: #1e1e1e;
    text-decoration: none;
}
.cal-day-add {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    color: #bdbdbd;
    text-decoration: none;
    opacity: 0;
    transition: opacity 120ms ease, background 120ms ease, color 120ms ease;
}
.cal-month-cell:hover .cal-day-add,
.cal-week-head-day:hover .cal-day-add,
.cal-day-add:focus {
    opacity: 1;
    color: var(--sc-primary);
    background: var(--sc-primary-soft);
}
.cal-month-events {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.cal-month-more {
    padding: 0 0.35rem;
    font-size: 10.5px;
    font-weight: 650;
    color: #828282;
    text-decoration: none;
}
.cal-month-more:hover { color: var(--sc-primary); }

.cal-chip,
.cal-event {
    display: flex;
    align-items: baseline;
    gap: 0.3rem;
    min-width: 0;
    border-radius: 7px;
    padding: 0.18rem 0.4rem 0.18rem 0.45rem;
    text-decoration: none;
    border-left: 3px solid var(--sc-primary);
    background: var(--sc-primary-soft);
    color: #1e1e1e;
}
.cal-chip.is-compact { padding: 0.12rem 0.35rem; }
.cal-chip-time {
    flex-shrink: 0;
    font-size: 10px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: inherit;
    opacity: 0.75;
}
.cal-chip-title {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 11px;
    font-weight: 600;
}
.cal-event--meeting { background: var(--sc-primary-soft); border-left-color: var(--sc-primary); color: #9f1239; }
.cal-event--call { background: #fff9cc; border-left-color: #fcbe00; color: #854d0e; }
.cal-event--reminder { background: #eef2ff; border-left-color: #6366f1; color: #3730a3; }
.cal-event.is-company { box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.35); }

.cal-sources {
    padding: 1rem 1rem 0.85rem;
    border-radius: 18px;
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.4));
    box-shadow:
        0 16px 40px rgba(30, 30, 30, 0.07),
        0 1px 0 rgba(255, 255, 255, 0.85) inset;
}
.cal-sources-title,
.cal-sources-sub {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #828282;
}
.cal-sources-title { margin-bottom: 0.55rem; font-size: 12px; color: #1e1e1e; text-transform: none; letter-spacing: 0; }
.cal-sources-sub { margin: 0.7rem 0 0.35rem; }
.cal-source {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.22rem 0;
    font-size: 12.5px;
    color: #4f4f4f;
    cursor: pointer;
}
.cal-source-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #c6cdd3;
}
.cal-source-dot.is-mine { background: var(--sc-primary); }
.cal-source-dot.is-company { background: #6366f1; }
.cal-source-dot.is-colleague { background: #fcbe00; }
.cal-sources-hint {
    margin: 0.65rem 0 0;
    font-size: 11px;
    line-height: 1.4;
    color: #bdbdbd;
}

.cal-week-allday {
    min-height: 42px;
    border-bottom: 1px solid rgba(224, 224, 224, 0.5);
    background: rgba(255, 255, 255, 0.25);
}
.cal-week-gutter-label,
.cal-week-hours span {
    font-size: 10px;
    font-weight: 600;
    color: #bdbdbd;
}
.cal-week-gutter-label {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0.35rem 0.4rem 0.35rem 0;
}
.cal-week-allday-cell {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 0.3rem;
    border-left: 1px solid rgba(224, 224, 224, 0.35);
}
.cal-week-body {
    position: relative;
    flex: 1 1 auto;
    min-height: 520px;
}
.cal-week-hours { padding-top: 0; }
.cal-week-hour,
.cal-week-hour-slot {
    display: block;
    height: 52px;
    border-bottom: 1px dashed rgba(224, 224, 224, 0.55);
    text-decoration: none;
}
.cal-board--week.is-day .cal-week-hour,
.cal-board--week.is-day .cal-week-hour-slot {
    height: 64px;
}
.cal-week-hour-slot:hover {
    background: rgba(227, 30, 36, 0.06);
}
.cal-week-hour {
    position: relative;
}
.cal-week-hour span {
    position: absolute;
    top: -0.55rem;
    right: 0.4rem;
}
.cal-week-col {
    position: relative;
    border-left: 1px solid rgba(224, 224, 224, 0.35);
    background: rgba(255, 255, 255, 0.2);
}
.cal-week-col.is-weekend { background: rgba(252, 190, 0, 0.04); }
.cal-week-col.is-today,
.cal-week-allday-cell.is-today,
.cal-week-head-day.is-today {
    background: rgba(227, 30, 36, 0.045);
}
.cal-week-block {
    position: absolute;
    left: 4px;
    right: 4px;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 1px;
    overflow: hidden;
    padding: 0.28rem 0.4rem;
    border-radius: 8px;
    box-shadow: 0 6px 14px rgba(30, 30, 30, 0.08);
}
.cal-week-block-time {
    font-size: 10px;
    font-weight: 700;
    opacity: 0.8;
}
.cal-week-block-title {
    font-size: 12px;
    font-weight: 650;
    line-height: 1.25;
    overflow: hidden;
}
.cal-week-block-meta {
    font-size: 10px;
    opacity: 0.72;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.calendar-agenda {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: min(78vh, 820px);
    overflow-y: auto;
    padding: 1rem 1rem 1.1rem;
    border-radius: 18px;
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.4));
    box-shadow:
        0 16px 40px rgba(30, 30, 30, 0.07),
        0 1px 0 rgba(255, 255, 255, 0.85) inset;
}
.cal-agenda-head { padding: 0 0.15rem; }
.cal-agenda-title { font-size: 14px; font-weight: 700; color: #1e1e1e; }
.cal-agenda-sub { margin-top: 0.15rem; font-size: 11px; color: #bdbdbd; }
.cal-agenda-group { display: flex; flex-direction: column; gap: 0.35rem; }
.cal-agenda-label {
    padding: 0 0.15rem;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #828282;
}
.cal-agenda-item {
    display: grid;
    grid-template-columns: 3.1rem minmax(0, 1fr);
    gap: 0.55rem;
    align-items: start;
    padding: 0.55rem 0.65rem;
    border-radius: 12px;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.55);
}
.cal-agenda-item:hover { background: #fff; }
.cal-agenda-time {
    font-size: 12px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    padding-top: 1px;
}
.cal-agenda-name {
    font-size: 13px;
    font-weight: 650;
    color: #1e1e1e;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cal-agenda-meta {
    margin-top: 0.12rem;
    font-size: 11px;
    color: #828282;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cal-agenda-empty {
    border: 1px dashed #e0e0e0;
    border-radius: 12px;
    padding: 1.5rem 0.85rem;
    text-align: center;
    font-size: 12.5px;
    color: #bdbdbd;
}

.cal-event-card { padding: 0 0 1.25rem; }
.cal-event-hero {
    margin: 0 1.25rem 1rem;
    border-radius: 16px;
    padding: 1.15rem 1.2rem 1.1rem;
}
.cal-event-kicker {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    opacity: 0.75;
}
.cal-event-title {
    margin: 0.35rem 0 0;
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.25;
    color: #1e1e1e;
}
.cal-event-when {
    margin-top: 0.45rem;
    font-size: 13.5px;
    color: #4f4f4f;
}
.cal-event-facts {
    margin: 0 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.cal-event-facts > div {
    display: grid;
    grid-template-columns: 7.5rem minmax(0, 1fr);
    gap: 0.75rem;
    font-size: 13.5px;
}
.cal-event-facts dt { color: #bdbdbd; font-weight: 600; }
.cal-event-facts dd { margin: 0; color: #1e1e1e; }
.cal-event-facts a { color: var(--sc-primary); text-decoration: none; }
.cal-event-facts a:hover { text-decoration: underline; }

@media (max-width: 1099px) {
    .calendar-agenda { max-height: none; }
    .cal-board--week { min-height: 560px; }
}
@media (max-width: 800px) {
    .cal-board--week { overflow-x: auto; }
    .cal-board--week:not(.is-day) .cal-week-head,
    .cal-board--week:not(.is-day) .cal-week-allday,
    .cal-board--week:not(.is-day) .cal-week-body {
        min-width: 760px;
    }
    .cal-month-cell { min-height: 92px; }
}
