.cal-layout {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}
.cal-side {
    position: sticky;
    top: 84px;
    display: flex;
    flex-direction: column;
    gap: 22px;
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-1);
}
.cal-mini-title {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink);
    margin-bottom: 10px;
}
.cal-mini-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}
.cal-mini-dow {
    font-family: var(--font-mono);
    font-size: 9.5px;
    color: var(--ink-soft);
    text-align: center;
    padding: 4px 0;
}
.cal-mini-day {
    position: relative;
    height: 28px;
    border: none;
    background: none;
    color: var(--ink);
    font-family: var(--font-mono);
    font-size: 11px;
    cursor: pointer;
    border-radius: 4px;
}
.cal-mini-day:hover {
    background: var(--surface-alt);
}
.cal-mini-day.is-out {
    color: var(--ink-soft);
    opacity: 0.45;
}
.cal-mini-day.is-inweek {
    background: color-mix(in srgb, var(--brand-fg) 16%, var(--surface));
}
.cal-mini-day.is-today {
    background: var(--accent);
    color: #fff;
    font-weight: 600;
    opacity: 1;
}
.cal-mini-day.has-posts::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 3px;
    width: 4px;
    height: 4px;
    margin-left: -2px;
    border-radius: 50%;
    background: var(--brand-fg);
}
.cal-mini-day.is-today.has-posts::after {
    background: #fff;
}
.cal-filter-head {
    font-family: var(--font-mono);
    font-size: 10.5px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-soft);
    padding-bottom: 8px;
    margin-bottom: 4px;
    border-bottom: 1px solid var(--line);
}
.cal-check {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    cursor: pointer;
    font-size: 13px;
    color: var(--ink);
}
.cal-check input {
    appearance: none;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border: 1.5px solid var(--ink-soft);
    border-radius: 3px;
    background: var(--surface);
    flex-shrink: 0;
    cursor: pointer;
    display: grid;
    place-content: center;
    margin: 0;
}
.cal-check input:checked {
    background: var(--primary);
    border-color: var(--brand-fg);
}
.cal-check input:checked::after {
    content: "";
    width: 8px;
    height: 4px;
    border-left: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: rotate(-45deg) translateY(-1px);
}
.cal-check-label {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cal-check-count {
    margin-left: auto;
    font-family: var(--font-mono);
    font-size: 10.5px;
    color: var(--ink-soft);
}
.cal-badge {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 2px 9px;
    border-radius: 10px;
    border: 1px solid currentColor;
}
.cal-filter-empty {
    font-size: 12.5px;
    color: var(--ink-soft);
    padding: 6px 0;
}
.cal-main {
    min-width: 0;
}
.cal-grid {
    background: var(--surface);
    border: 1px solid var(--line);
    border-top: 4px solid var(--accent);
    box-shadow: var(--shadow-1);
}
.cal-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(
        180deg,
        color-mix(in srgb, var(--brand-fg) 8%, var(--surface)),
        var(--surface)
    );
}
.cal-head-title {
    font-family: var(--font-editorial);
    font-weight: 700;
    font-size: 24px;
    letter-spacing: -0.005em;
    color: var(--heading);
}
.cal-head-title::before {
    content: "Editorial Calendar";
    display: block;
    font-family: var(--font-mono);
    font-weight: 400;
    font-size: 10px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent-fg);
    margin-bottom: 5px;
}
.cal-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.cal-seg {
    display: inline-flex;
    border: 1px solid var(--line);
    background: var(--surface-alt);
    padding: 2px;
    border-radius: 6px;
}
.cal-seg button {
    border: none;
    background: none;
    padding: 6px 14px;
    font-family: var(--font-body);
    font-size: 12.5px;
    color: var(--ink-soft);
    cursor: pointer;
    border-radius: 4px;
}
.cal-seg button:hover {
    color: var(--ink);
}
.cal-seg button.is-active {
    background: var(--surface);
    color: var(--ink);
    font-weight: 600;
    box-shadow: var(--shadow-1);
}
.cal-nav {
    display: flex;
    gap: 6px;
    align-items: center;
}
.cal-weekhead,
.cal-cells {
    display: grid;
    grid-template-columns: 40px repeat(7, minmax(0, 1fr));
}
.cal-weekhead {
    border-bottom: 1px solid var(--line);
}
.cal-weekhead span {
    font-family: var(--font-mono);
    font-size: 10.5px;
    letter-spacing: 0.08em;
    color: var(--ink-soft);
    text-align: center;
    padding: 10px 0;
    text-transform: uppercase;
}
.cal-weekhead span:first-child {
    opacity: 0.7;
}
.cal-weekhead span:nth-child(7),
.cal-weekhead span:nth-child(8) {
    color: var(--accent-fg);
}
.cal-week-no {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 10px 0;
    font-family: var(--font-mono);
    font-size: 10.5px;
    color: var(--ink-soft);
    background: var(--surface-alt);
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}
.cal-cell {
    position: relative;
    min-width: 0;
    min-height: 124px;
    padding: 6px 6px 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    transition:
        box-shadow var(--dur-fast) var(--ease),
        background var(--dur-fast) var(--ease);
}
.cal-cell:nth-child(8n) {
    border-right: none;
}
.cal-cell:hover {
    box-shadow: inset 0 2px 0 var(--brand-fg);
}
.cal-cell.is-weekend {
    background: color-mix(in srgb, var(--ink) 2.5%, var(--surface));
}
.cal-cell.is-out {
    background: var(--surface-alt);
}
.cal-cell.is-out .cal-date {
    opacity: 0.5;
}
.cal-cell.is-out .cal-pill {
    opacity: 0.55;
}
.cal-cell.is-today {
    background: color-mix(in srgb, var(--brand-fg) 8%, var(--surface));
}
.cal-cell.is-today .cal-date {
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    opacity: 1;
}
.cal-cell-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 24px;
}
.cal-date {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 5px;
    margin-left: auto;
    border-radius: 5px;
    font-family: var(--font-mono);
    font-size: 11.5px;
    color: var(--ink-soft);
}
.cal-add {
    opacity: 0;
    width: 22px;
    height: 22px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink-soft);
    border-radius: 5px;
    font-size: 10px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition:
        opacity var(--dur-fast) var(--ease),
        background var(--dur-fast) var(--ease);
}
.cal-cell:hover .cal-add,
.cal-add:focus-visible {
    opacity: 1;
}
.cal-add:hover {
    background: var(--ink);
    color: var(--surface);
    border-color: var(--ink);
}
.cal-pill {
    display: block;
    padding: 4px 8px;
    border-left: 3px solid currentColor;
    border-radius: 0 4px 4px 0;
    font-family: var(--font-body);
    font-size: 11.5px;
    font-weight: 500;
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    transition:
        transform var(--dur-fast) var(--ease),
        box-shadow var(--dur-fast) var(--ease);
}
.cal-pill:hover {
    transform: translateX(3px);
    box-shadow: var(--shadow-1);
}
.cal-pill.status-pending,
.cal-badge.status-pending {
    background: color-mix(in srgb, var(--warn) 16%, var(--surface));
    color: var(--warn-fg);
}
.cal-pill.status-scheduled,
.cal-badge.status-scheduled {
    background: color-mix(in srgb, var(--primary) 16%, var(--surface));
    color: var(--brand-fg);
}
.cal-pill.status-live,
.cal-badge.status-live {
    background: color-mix(in srgb, var(--good) 16%, var(--surface));
    color: var(--good-fg);
}
.cal-pill.status-revision,
.cal-badge.status-revision {
    background: color-mix(in srgb, var(--accent) 16%, var(--surface));
    color: var(--accent-fg);
}
.cal-more {
    align-self: flex-start;
    border: none;
    background: none;
    padding: 2px 4px;
    font-family: var(--font-mono);
    font-size: 10.5px;
    color: var(--brand-fg);
    cursor: pointer;
}
.cal-more:hover {
    text-decoration: underline;
}
.cal-cells.is-week .cal-cell {
    min-height: 340px;
}
.cal-cells.is-heat .cal-cell {
    cursor: pointer;
}
.cal-cells.is-heat .cal-cell[data-heat="1"] {
    background: color-mix(in srgb, var(--accent) 14%, var(--surface));
}
.cal-cells.is-heat .cal-cell[data-heat="2"] {
    background: color-mix(in srgb, var(--accent) 26%, var(--surface));
}
.cal-cells.is-heat .cal-cell[data-heat="3"] {
    background: color-mix(in srgb, var(--accent) 38%, var(--surface));
}
.cal-cells.is-heat .cal-cell[data-heat="4"] {
    background: color-mix(in srgb, var(--accent) 52%, var(--surface));
}
.cal-cells.is-heat .cal-cell[data-heat="5"] {
    background: color-mix(in srgb, var(--accent) 66%, var(--surface));
}
.cal-heat-count {
    margin: auto;
    font-family: var(--font-editorial);
    font-weight: 800;
    font-size: 26px;
    color: var(--ink);
}
.cal-heat-legend {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-top: 1px solid var(--line);
    font-family: var(--font-mono);
    font-size: 10.5px;
    color: var(--ink-soft);
}
.cal-heat-legend[hidden] {
    display: none;
}
.cal-heat-legend i {
    width: 22px;
    height: 10px;
    border-radius: 2px;
    display: inline-block;
}
.cal-heat-legend i:nth-of-type(1) {
    background: color-mix(in srgb, var(--accent) 14%, var(--surface));
}
.cal-heat-legend i:nth-of-type(2) {
    background: color-mix(in srgb, var(--accent) 26%, var(--surface));
}
.cal-heat-legend i:nth-of-type(3) {
    background: color-mix(in srgb, var(--accent) 38%, var(--surface));
}
.cal-heat-legend i:nth-of-type(4) {
    background: color-mix(in srgb, var(--accent) 52%, var(--surface));
}
.cal-heat-legend i:nth-of-type(5) {
    background: color-mix(in srgb, var(--accent) 66%, var(--surface));
}
.cal-day-list {
    display: flex;
    flex-direction: column;
}
.cal-day-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px 4px;
    border-bottom: 1px solid var(--line);
    cursor: pointer;
}
.cal-day-row:hover {
    background: var(--surface-alt);
}
.cal-day-row:last-child {
    border-bottom: none;
}
.cal-day-row-title {
    font-family: var(--font-editorial);
    font-weight: 700;
    font-size: 15.5px;
    color: var(--ink);
}
.cal-day-row-meta {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--ink-soft);
    margin-top: 3px;
}
@media (max-width: 1100px) {
    .cal-layout {
        grid-template-columns: 1fr;
    }
    .cal-side {
        position: static;
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 20px;
    }
}
@media (max-width: 880px) {
    .cal-side {
        grid-template-columns: 1fr;
    }
    .cal-head {
        padding: 14px 16px;
    }
    .cal-head-title {
        font-size: 19px;
    }
    .cal-weekhead,
    .cal-cells {
        grid-template-columns: 26px repeat(7, minmax(0, 1fr));
    }
    .cal-cell {
        min-height: 70px;
        padding: 3px;
        gap: 3px;
    }
    .cal-cells.is-week .cal-cell {
        min-height: 150px;
    }
    .cal-date {
        min-width: 20px;
        height: 20px;
        font-size: 10.5px;
    }
    .cal-add {
        display: none;
    }
    .cal-pill {
        font-size: 9px;
        padding: 2px 4px;
        border-left-width: 2px;
    }
    .cal-week-no {
        font-size: 9px;
        padding-top: 6px;
    }
    .cal-heat-count {
        font-size: 18px;
    }
}
