.timesheet-scroll {
    max-height: min(70vh, 760px);
}

.timesheet-calendar {
    --hour-height: 40px;
    min-width: 720px;
}

.timesheet-header,
.timesheet-grid {
    display: grid;
    grid-template-columns: 3.5rem repeat(7, minmax(0, 1fr));
}

.timesheet-header {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #f8fafc;
    border-bottom: 1px solid #cbd5e1;
}

.timesheet-day-heading {
    min-width: 0;
    border-left: 1px solid #e2e8f0;
}

.timesheet-heading-date {
    --today-color: #0277b5;
    display: flex;
    min-height: 64px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
}

.timesheet-heading-weekday {
    color: #475569;
    font-size: 12px;
    line-height: 14px;
    font-weight: 600;
}

.timesheet-heading-number {
    display: grid;
    width: 32px;
    height: 32px;
    place-items: center;
    color: #1e293b;
    font-size: 20px;
    line-height: 1;
    font-weight: 600;
    font-variant-numeric: lining-nums tabular-nums;
}

.timesheet-heading-number > span {
    text-box: trim-both cap alphabetic;
}

.timesheet-heading-date[aria-current="date"] .timesheet-heading-weekday {
    color: var(--today-color);
}

.timesheet-heading-date[aria-current="date"] .timesheet-heading-number {
    border-radius: 50%;
    background: var(--today-color);
    color: white;
}

.timesheet-hours,
.timesheet-day {
    display: grid;
    grid-template-rows: repeat(24, var(--hour-height));
}

.timesheet-hours {
    background: #f8fafc;
}

.timesheet-hours > span {
    align-self: start;
    margin-block-start: -6px;
    padding-inline-end: 8px;
    color: #64748b;
    font-size: 12px;
    line-height: 1;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.timesheet-day {
    position: relative;
    min-width: 0;
    border-left: 1px solid #e2e8f0;
}

.timesheet-slot {
    border-bottom: 1px solid #e2e8f0;
    cursor: default;
    text-align: left;
    user-select: none;
}

.timesheet-slot:focus-visible {
    background: #dbeafe;
}

.timesheet-selection {
    position: absolute;
    inset-inline: 0;
    z-index: 1;
    background: rgb(59 130 246 / 30%);
    pointer-events: none;
}

.timesheet-entry {
    position: absolute;
    z-index: 1;
    box-sizing: border-box;
    padding-block: 0;
    cursor: pointer;
    user-select: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.timesheet-entry[data-log-id] {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    container-type: size;
    text-align: left;
}

.timesheet-entry-label {
    flex: none;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 14px;
}

.timesheet-entry-comment {
    min-block-size: 0;
    max-block-size: round(down, calc(100cqh - 14px), 13px);
    overflow: hidden;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
    font-size: 11px;
    line-height: 13px;
    font-weight: normal;
}

@container (height < 27px) {
    .timesheet-entry-comment {
        display: none;
    }
}

.timesheet-entry-dragging {
    opacity: 0.35;
}

.timesheet-dragging .timesheet-slot,
.timesheet-dragging .timesheet-entry {
    cursor: grabbing;
}

.timesheet-entry-preview {
    inset-inline: 2px;
    z-index: 2;
    pointer-events: none;
    background: #93c5fd;
    border-radius: 0.25rem;
    color: #1e3a8a;
    font-size: 0.75rem;
    text-align: center;
}

.timesheet-entry.timesheet-entry-role {
    background-color: color-mix(in srgb, var(--timesheet-role-color) 25%, white);
    border-color: color-mix(in srgb, var(--timesheet-role-color) 65%, white);
    color: #0f172a;
}

.timesheet-entry.timesheet-entry-role:hover,
.timesheet-entry.timesheet-entry-role.timesheet-entry-preview {
    background-color: color-mix(in srgb, var(--timesheet-role-color) 40%, white);
}

.timesheet-entry.timesheet-entry-compact {
    border-block-width: 0;
    font-size: 0;
}

.timesheet-untimed {
    max-height: 8rem;
    overflow: auto;
    padding: 0 8px 8px;
    color: #475569;
    font-size: 12px;
}

#modal-start-options {
    scrollbar-width: none;
}

#modal-start-options::-webkit-scrollbar {
    display: none;
}

#modal-comment:empty::before {
    color: #9ca3af;
    content: attr(aria-placeholder);
    pointer-events: none;
}

#modal-comment a {
    color: #1d4ed8;
    text-decoration: underline;
}
