.objectives {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border-primary);
    border-radius: .4rem;
}

.objectives:has(.objectives-body:empty) {
    display: none;
}

.objectives-container {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    background: var(--bg-primary);
    border-radius: .4rem;
    padding: .4rem .4rem .8rem .4rem;
}

.objectives-header {
    margin-bottom: .4rem;
    user-select: none;
}

.objectives-header {
    position: relative;
    height: 16px;
}

.objectives-objective {
    display: flex;
    flex-direction: row;
}

.objectives-header-day {
    position: absolute;
    box-sizing: border-box;
    width: 32px;
    height: 16px;
    font-size: small;
    line-height: 16px;
    text-align: center;
}

.objectives-header-day::before {
    position: absolute;
    left: -1px;
    width: 2px;
    content: " ";
    height: 10px;
    top: 3px;
    background: var(--border-secondary);
    border-radius: .2rem;
}

.objectives-header-week::before {
    background: white;
    height: 16px;
    top: 0;
}

.objectives-header-day:hover::after,
.objectives-header-today::after {
    position: absolute;
    left: 0px;
    top: -.4rem;
    content: "";
    background: var(--bg-primary-hover);
    width: 32px;
    height: 500px;
}

.objectives-header-today::after {
    background: var(--bg-accent);
}

.objective {
    position: relative;
    height: 32px;
}

.objective-slot {
    position: absolute;
    box-sizing: border-box;
    flex-shrink: 0;
    height: 32px;
    display: flex;
    flex-direction: row;
    justify-content: center;
}

.objective-slot-bg {
    margin: 1px;
    width: 100%;
    display: flex;
    flex-direction: row;
    justify-content: center;
    border-radius: .2rem;
}

.objective-slot button {
    border: none;
    color: black;
    cursor: pointer;
    width: 100%;
    padding: 0;
    background: #ccc;
    height: 100%;
    border-radius: .2rem;
}

.objective-slot button:hover {
    background: #fff;
}

.objective-slot button.early {
    background: #8ccd94;
}

.objective-slot button.early:hover {
    background: #c3ffca;
}

.objective-slot button.late {
    background: #e69d73;
}

.objective-slot button.late:hover {
    background: #ffc8a8;
}

.objective-slot button:focus-visible {
    outline: 1px solid var(--accent);
}

.objective-name {
    position: absolute;
    left: .4rem;
    padding: .2rem .4rem;
}

.objective-name.archived {
    --bg-secondary: #111149;
    --bg-secondary-hover: #13137d;
    --border-secondary: #111149;
}

.objective-completion {
    box-sizing: border-box;
    position: absolute;
    height: 100%;
    width: 4px;
    overflow: hidden;
    top: 0;
    padding-top: .2rem;
    padding-bottom: .2rem;
    cursor: help;
}

.objective-completion::after {
    display: block;
    content: " ";
    background: #389b45;
    border-radius: 2px;
    height: 100%;
    opacity: 0;
}

.objectives:hover .objective-completion::after {
    opacity: 1;
}

.bg-error {
    background: var(--warning);
}

.bg-success {
    background: var(--success);
}

.bg-cooldown {
    background: #aaa;
}

.bg-future {
    background: #222;
}

.bg-future-complete {
    background: #2e6f36;
}
