/***** FONTS ******************************************************************/

@font-face {
    font-family: "Fira Sans";
    src: url("../fonts/fira-sans/FiraSans-Regular.woff2") format("woff2"), url("../fonts/fira-sans/FiraSans-Regular.woff") format("woff");
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Fira Sans";
    src: url("../fonts/fira-sans/FiraSans-Italic.woff2") format("woff2"), url("../fonts/fira-sans/FiraSans-Italic.woff") format("woff");
    font-weight: normal;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: "Fira Sans";
    src: url("../fonts/fira-sans/FiraSans-Bold.woff2") format("woff2"), url("../fonts/fira-sans/FiraSans-Bold.woff") format("woff");
    font-weight: bold;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Fira Sans";
    src: url("../fonts/fira-sans/FiraSans-BoldItalic.woff2") format("woff2"), url("../fonts/fira-sans/FiraSans-BoldItalic.woff") format("woff");
    font-weight: bold;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: "Fira Code";
    src: url("../fonts/fira-code/FiraCode-Regular.woff2") format("woff2"), url("../fonts/fira-code/FiraCode-Regular.woff") format("woff");
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/***** THEME ******************************************************************/

:root {
    font-family: "Fira Sans", sans-serif;

    --bg-page: #27292a; /* 1f2d38 */ /* 373839*/

    --bg-primary: #101010;
    --bg-primary-alt: #181818; /* striped lines */
    --bg-primary-hover: #304350;
    --border-primary: #000000;

    --bg-secondary: #303030;
    --bg-secondary-alt: #404040;
    --bg-secondary-hover: #555555;
    --border-secondary: #505050;

    --accent: #8ed2ff;
    --accent-hover: #c5e8ff;
    --border-accent: #55bbff;
    --bg-accent: #1e313e;
    --bg-selection: #103a57; /* 103a57 2781be */

    --text: #f0f0f0;
    --text-dark: #000000;
    --text-dim: #444444;
    --text-muted: #888888;

    --text-danger: #f16581;
    --border-danger: #dc143c;
    --bg-danger: #5d343d;

    --gold: #ffd700;
    --mark: #ffff00;
    --warning: #ff6e1a; /*ff6e1a e65400*/
    --success: #4bce5c; /*4bce5c 30b041*/
}

::selection {
    background-color: var(--bg-selection);
}

/***** BODY *******************************************************************/

html {
    height: 100%;
}

body {
    padding: 0;
    margin: 0;
    background: var(--bg-page);
    color: var(--text);
}

body.fullscreen {
    background-color: var(--bg-primary);
    height: 100%;
}

/***** COLUMNS ****************************************************************/

.columns {
    display: flex;
    position: relative;
}

.column {
    display: flex;
    flex-direction: column;
    gap: .8rem;
}

.column-spacer {
    flex-grow: .2;
    flex-basis: 0;
}

.column-main {
    box-sizing: border-box;
    flex-basis: 40rem;
    flex-shrink: 0;
    padding: 0 .8rem;
    width: 0;
    margin-bottom: .8rem;
}

.column-side {
    box-sizing: border-box;
    position: sticky;
    top: 0;
    flex-shrink: 1;
    flex-grow: 0;
    flex-basis: 24rem;
    padding-top: .8rem;
    padding-right: .8rem;
    max-height: 100vh;
    width: min(24rem, 100%);
    overflow: auto;
    z-index: 1;
}

.column-side-sticky {
    width: 100%;
}

@media (max-width: 800px) {

    .columns {
        flex-direction: column;
    }

    .column-main {
        width: 100%;
        flex-basis: unset;
        padding: 0 .4rem;
    }

    .column-side {
        padding: .8rem .4rem;
        position: unset;
        height: unset;
        overflow: unset;
        flex-basis: auto;
    }

    .column-side-sticky {
        width: unset;
    }

}

/***** LINKS ******************************************************************/

a {
    color: var(--accent);
}

a:hover {
    color: var(--accent-hover);
}

.link-hidden {
    color: inherit;
    text-decoration: none;
}

.link-tenuous {
    text-decoration: none;
}

.link-tenuous:hover,
.link-hidden:hover {
    text-decoration: underline;
}

a:focus-visible {
    outline: 1px solid var(--accent);
}

/***** DETAILS ****************************************************************/

summary {
    width: fit-content;
    user-select: none;
}

summary:focus-visible {
    outline: 1px solid var(--accent);
}

/***** FORMS, INPUTS **********************************************************/

form:focus,
form:has(:focus) {
    outline: none !important;
}

input,
select,
textarea {
    box-sizing: border-box;
    font-family: inherit;
    font-size: inherit;
    color: var(--text);
    border: 1px solid var(--border-secondary);
    padding: .4rem;
    border-radius: .2rem;
    background-color: var(--bg-secondary);
    width: 100%;
}

input[type=checkbox] {
    width: unset;
}

input:not(input[type=checkbox]):focus,
select:focus,
textarea:focus {
    outline: 1px solid var(--accent);
}

input[type=checkbox],
input[type=range] {
    accent-color: var(--accent);
}

.input-slim {
    padding: .1rem .2rem;
}

input:disabled,
select:disabled,
textarea:disabled {
    opacity: .5;
    pointer-events: none;
}

.input-inline {
    display: block;
    border: none;
    border-radius: inherit;
    background: none;
    padding: 0;
    font-weight: inherit;
}

/***** BUTTONS ****************************************************************/

button,
.button,
input[type=submit] {
    box-sizing: border-box;
    font-family: inherit;
    font-size: inherit;
    color: var(--text);
    border: 1px solid var(--border-secondary);
    padding: .4rem;
    border-radius: .2rem;
    background-color: var(--bg-secondary);
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    width: fit-content;
    flex-shrink: 0;
    position: relative;
}

button:focus,
.button:focus,
input[type=submit]:focus {
    outline: none !important;
}

button:hover,
.button:hover,
input[type=submit]:hover,
button:focus-visible,
.button:focus-visible,
input[type=submit]:focus-visible {
    color: var(--text);
    background-color: var(--bg-secondary-hover);
    outline: none;
}

button:disabled,
.button.disabled {
    opacity: .5;
    pointer-events: none;
}

button.active,
.button.active,
input[type=submit].active {
    color: var(--accent);
    border-color: var(--border-accent);
}

button.active:hover,
.button.active:hover,
input[type=submit].active:hover {
    background-color: var(--accent);
    color: var(--text-dark)
}

button span,
.button span {
    margin-left: .2rem;
}

@media (max-width: 800px) {

    button span,
    .button span {
        display: none;
    }

}

.button-inline {
    background: none;
    border: none;
    padding: 0;
    border-radius: .2rem;
    color: var(--accent);
}

.button-inline:hover {
    color: var(--accent-hover);
    background: none;
}

.button-primary {
    background-color: var(--bg-primary);
    border-color: var(--border-primary);
}

.button-primary:hover {
    background-color: var(--bg-primary-hover);
}

.button-accent {
    color: var(--text-dark) !important;
    background-color: var(--accent) !important;
    border-color: var(--border-accent) !important;
}

.button-accent:hover {
    background-color: var(--accent-hover) !important;
}

.button-danger {
    color: var(--text-danger) !important;
    border-color: var(--border-danger) !important;
}

.button-danger:hover {
    background-color: var(--bg-danger) !important;
}

.button-slim {
    padding: .1rem .2rem;
}

.button-badge {
    box-sizing: border-box;
    display: inline-block;
    position: absolute;
    margin: 0 !important;
    width: 0;
    top: 0;
    right: 0;
    background: none;
    color: inherit;
    font-size: x-small;
    text-align: center;
}

/***** LABELS *****************************************************************/

.label {
    position: relative;
    background: var(--bg-accent);
    padding: .1rem .3rem;
    border-radius: .2rem;
    text-decoration: none;
    color: var(--accent);
    white-space: nowrap;
}

.label-inline {
    padding-top: 0;
    padding-bottom: 0;
}

button.label,
.button.label {
    border: none;
}

.label-grey {
    background-color: hsl(204, 0%, 18%);
    color: hsl(204, 0%, 78%);
}

a.label-grey:hover,
button.label-grey:hover {
    background-color: hsl(204, 0%, 18%);
    color: hsl(204, 0%, 88%);
}

.label-success {
    background-color: hsl(120, 35%, 18%);
    color: hsl(120, 100%, 78%);
}

a.label-success:hover,
button.label-success:hover {
    background-color: hsl(120, 35%, 18%);
    color: hsl(120, 100%, 88%);
}

.label-red,
.label.error {
    background-color: hsl(0, 34%, 18%);
    color: hsl(0, 100%, 78%);
}

a.label-red:hover,
button.label-red:hover,
a.label.error:hover,
button.label.error:hover {
    background-color: hsl(0, 34%, 18%);
    color: hsl(0, 100%, 88%);
}

.label-pink {
    background-color: hsl(288, 35%, 18%);
    color: hsl(288, 100%, 78%);
}

a.label-pink:hover,
button.label-pink:hover {
    background-color: hsl(288, 35%, 18%);
    color: hsl(288, 100%, 88%);
}

.label-purple {
    background-color: hsl(255, 35%, 18%);
    color: hsl(255, 100%, 78%);
}

a.label-purple:hover,
button.label-purple:hover {
    background-color: hsl(255, 35%, 18%);
    color: hsl(255, 100%, 88%);
}

/***** CODE *******************************************************************/

pre {
    position: relative;
}

pre > button {
    position: absolute;
    top: 0;
    right: 0;
    background-color: var(--bg-secondary-alt);
    font-size: small;
    border-top-left-radius: 0;
    border-bottom-right-radius: 0;
}

code,
code * {
    font-family: "Fira Code", monospace;
}

/***** QUOTES *****************************************************************/

blockquote {
    border-left: 0.2rem solid var(--border-secondary);
    background: var(--bg-secondary);
    margin-left: 1.6rem;
    padding: .8rem;
    border-top-right-radius: .2rem;
    border-bottom-right-radius: .2rem;
}

blockquote p {
    margin: 0;
}

blockquote p + p {
    margin-top: .8rem;
}

blockquote ul li::marker {
    content: "— ";
}

/***** TABLE ******************************************************************/

table {
    background: var(--bg-secondary);
    border-collapse: separate;
    border: 1px solid var(--border-secondary);
    border-radius: .2rem;
    border-spacing: 0;
}

th,
td {
    padding: .2rem .8rem;
    border-bottom: 1px solid var(--border-secondary);
}

th {
    text-transform: uppercase;
}

tr:last-child td {
    border-bottom: none;
}

thead tr {
    background: var(--bg-secondary);
}

tbody tr:nth-child(odd) {
    background-color: var(--bg-secondary-alt);
}

tbody tr:hover {
    background-color: var(--bg-secondary-hover);
}

/***** IFRAMES ****************************************************************/

iframe {
    box-sizing: border-box;
    border: none;
    padding: 0;

    width: 100%;
    max-height: 80vh;
    height: 24rem;
}

.iframe-container {
    position: relative;
    display: flex;
    border: 1px solid var(--border-secondary);
    border-radius: .2rem;
    overflow: hidden;
}

.iframe-actions {
    position: absolute;
    bottom: 0;
    left: 0;
    display: flex;
    font-size: small;
}

.iframe-actions > .button {
    padding: .2rem .4rem;
    border-bottom: none;
    border-left: none;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    background-color: var(--bg-secondary-alt);
}

/***** MINITITLE **************************************************************/

.minititle {
    font-size: small;
    font-weight: bold;
}

summary.minititle::marker {
    content: none;
}

/***** TOGGLE SWITCH **********************************************************/

.toggle {
    display: flex;
    align-items: center;
    margin: .4rem 0;
    width: fit-content;
}

.toggle input {
    position: absolute;
    visibility: hidden;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: relative;
    cursor: pointer;
    width: 2.4rem;
    height: 1.6rem;
    background-color: var(--bg-secondary);
    transition: .2s ease-in-out;
    border-radius: .8rem;
    margin-right: .4rem;
    border: 1px solid var(--border-secondary);
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 1.2rem;
    width: 1.2rem;
    left: .2rem;
    bottom: .2rem;
    background-color: var(--text);
    transition: .2s ease-in-out;
    border-radius: 50%;
    box-shadow: 0 0 2px black;
}

.toggle-text {
    color: var(--text-muted);
    transition: .2s ease-in-out;
}

input:checked+.toggle-slider {
    background-color: var(--accent);
    border-color: var(--border-accent);
}

input:checked+.toggle-slider:before {
    transform: translateX(.8rem);
}

input:checked+.toggle-slider+.toggle-text {
    color: inherit;
}

/***** ACTIONBAR **************************************************************/

.actionbar {
    display: flex;
    border-radius: .2rem;
    border: 1px solid var(--border-secondary);
    background-color: var(--bg-secondary);
    width: fit-content;
    overflow: hidden;
    flex-shrink: 0;
}

.actionbar > * {
    border-radius: 0 !important;
    border-left: none;
    border-top: none;
    border-bottom: none;
    border-color: var(--border-secondary) !important;
}

.actionbar label {
    padding: .4rem;
    color: var(--text-muted);
}

.actionbar > *:first-child {
    border-top-left-radius: .2rem;
    border-bottom-left-radius: .2rem;
}

.actionbar > *:last-child {
    border-top-right-radius: .2rem;
    border-bottom-right-radius: .2rem;
    border-right: none;
}

.actionbar--vertical {
    flex-direction: column;
}

.actionbar--vertical > * {
    border-radius: 0 !important;
    border-right: none;
    border-bottom: 1px solid var(--border-secondary);
}

.actionbar > *:first-child {
    border-bottom-left-radius: 0;
    border-top-right-radius: .2rem;
}

.actionbar > *:last-child {
    border-top-right-radius: 0;
    border-bottom-left-radius: .2rem;
    border-bottom: none;
}

.actionbar :focus {
    outline: none;
}

.actionbar:has(:focus) {
    outline: 1px solid var(--accent);
}

/***** SEARCH *****************************************************************/

.search {
    box-sizing: border-box;
    position: relative;
    border-radius: .2rem;
}

.search:has(.search-input:focus) {
    outline: 1px solid var(--accent);
}

.search-bar {
    display: flex;
    overflow: hidden;
    border-radius: .2rem;
    border: 1px solid var(--border-secondary);
}

.search-bar:has(+*:not(:empty)) {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.search-input,
.search-button {
    border: none;
    border-radius: 0;
}

.search-input:focus {
    outline: none !important;
}

.search-icon {
    position: absolute;
    top: 50%;
    right: 2rem;
    transform: translateY(-50%);
    font-style: normal;
    visibility: hidden;
    cursor: pointer;
}

.search:hover .search-icon,
.search-input:focus + .search-icon {
    visibility: visible;
}

.search-pin {
    width: 100%;
    border: none;
    border-radius: 0;
    text-align: left;
    background-color: var(--bg-accent);
    color: var(--accent);
    border-left: 1px solid var(--border-secondary);
    border-right: 1px solid var(--border-secondary);
    border-bottom: 1px solid var(--border-secondary);
    border-bottom-left-radius: .2rem;
    border-bottom-right-radius: .2rem;
}

.search-pin:has(+*:not(:empty)) {
    border-radius: 0;
}

.menu.search-suggestions {
    box-sizing: border-box;
    width: 100%;
    position: absolute;
    left: 0;
    bottom: 0;
    transform: translateY(calc(100% - 1px));
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    box-shadow: none;
    overflow: hidden;
    z-index: 3;
}

.search-current {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    background: var(--accent);
    color: var(--text-dark);
    height: 100%;
    padding: .4rem;
    box-sizing: border-box;
    border-radius: .2rem;
}

.search-current-button {
    background: none;
    padding: 0;
    border: none;
    position: absolute;
    right: .4rem;
    color: var(--text-dark);
}

.search-current:not(.show) {
    display: none;
}

/***** CATEGORIES INPUT *******************************************************/

.input-tags {
    display: flex;
    width: fit-content;
    border-radius: .2rem;
    max-width: 100%;
}

.input-tags-current {
    display: flex;
    overflow: auto;
}

.input-tags-current button {
    border-radius: 0;
    border-right: none;
}

.input-tags-current button:first-child {
    border-top-left-radius: .2rem;
    border-bottom-left-radius: .2rem;
}

.input-tags .search {
    flex-shrink: 0;
}

.input-tags .search,
.input-tags .search-bar,
.input-tags .search-input {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.input-tags .input-tags-current:empty + .search,
.input-tags .input-tags-current:empty + .search .search-bar,
.input-tags .input-tags-current:empty + .search .search-input {
    border-top-left-radius: .2rem;
    border-bottom-left-radius: .2rem;
}

.input-tags .search:has(.search-input:focus) {
    outline: none;
}

.input-tags:has(:focus) {
    outline: 1px solid var(--accent);
}

/***** NAVBAR *****************************************************************/

#column-main.readonly .navbar {
    display: none;
}

.navbar {
    display: flex;
    justify-content: space-between;
    padding: .4rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-primary);
    border-top: none;
    border-bottom-left-radius: .4rem;
    border-bottom-right-radius: .4rem;
}

.navbar .button {
    background: none;
    border-color: var(--bg-primary);
}

.navbar .dropdown-toggle.button.active:hover {
    color: var(--text);
}

.navbar .button:hover,
.navbar .button:not(.dropdown-toggle):focus {
    background-color: var(--bg-primary-hover);
    border-color: var(--border-primary);
}

.navbar .button:not(.dropdown-toggle).active {
    border-color: var(--border-accent);
}

.navbar .button:not(.dropdown-toggle).active:hover {
    background-color: var(--accent-hover);
}

.navbar .search-bar {
    width: 14rem;
}

.navbar:not(:has(.search-input:focus)) .search-bar:not(:hover) {
    border-color: var(--bg-primary);
}

.navbar:not(:has(.search-input:focus)) .search-input,
.navbar:not(:has(.search-input:focus)) .search-button {
    background: none;
}

#navbarSearchButton {
    display: none;
    border: none;
    background: none;
}

@media (max-width: 800px) {
    .navbar #navbarSearchForm {
        display: none;
    }
    .navbar #navbarSearchButton {
        display: block;
    }
}

/***** LINE *******************************************************************/

.line {
    position: relative;
    display: flex;
    align-items: baseline;
    background: var(--bg-primary);
    padding: .4rem 1rem .4rem .4rem;
    flex-wrap: wrap;
    gap: .4rem;
}

.line:nth-child(even) {
    background: var(--bg-primary-alt);
}

.line:hover {
    background: var(--bg-primary-hover);
}

.line button[popovertarget] {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    border: none;
    background: none;
    color: var(--text-muted);
}

.line button[popovertarget]:hover {
    color: var(--text);
}

.line:first-child {
    border-top-left-radius: .4rem;
    border-top-right-radius: .4rem;
}

.line:last-child {
    border-bottom-left-radius: .4rem;
    border-bottom-right-radius: .4rem;
}

/***** TOAST ******************************************************************/

.toast {
    min-width: 5rem;
    border: 1px solid var(--border-accent);
    background-color: var(--bg-accent);
    text-align: center;
    border-radius: .2rem;
    padding: .4rem;
    color: inherit;
}

.toast.error {
    border-color: var(--border-danger);
    background-color: var(--bg-danger);
}

:popover-open {
    position: fixed;
    inset: unset;
    right: 1rem;
    bottom: 1rem;
}

/***** CARDS ******************************************************************/

.card {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-primary);
    background-color: var(--bg-primary);
    border-radius: .4rem;
}

.card-header {
    margin: 0;
    padding: .8rem;
}

.card-body {
    padding: 0 .8rem .8rem .8rem;
}

.card-body:first-child {
    padding-top: .8rem;
}

.card-actions {
    display: flex;
    background: var(--bg-primary-alt);
    border-top: 1px solid var(--border-secondary);
    border-bottom-left-radius: .4rem;
    border-bottom-right-radius: .4rem;
    align-items: center;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.card-actions button,
.card-actions .button,
.card-actions input[type=submit] {
    border: none;
    border-radius: 0;
    padding: .6rem;
}

.card-actions button:not(:hover,:focus),
.card-actions .button:not(:hover,:focus),
.card-actions input[type=submit]:not(:hover,:focus) {
    background: none;
}

.card--nobottom {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-bottom: none;
}

.card-actions--sticky {
    position: sticky;
    top: -1px;
    border-left: 1px solid var(--border-primary);
    border-right: 1px solid var(--border-primary);
    border-bottom: 1px solid var(--border-primary);
    background: var(--bg-secondary-alt);
    z-index: 2;
}

.card-actions form {
    display: flex;
}

/***** MENUS AND DROPDOWNS ****************************************************/

.contextmenu {
    position: fixed;
    z-index: 2;
}

.menu {
    position-area: bottom span-right;
    inset: auto;
    background: var(--bg-secondary);
    border-radius: .2rem;
    padding: 0;
    margin: 0;
    list-style: none;
    box-shadow: 0 0 4px black;
    line-height: 1;
    border: 1px solid var(--border-secondary);
    user-select: none;
    max-width: 32rem;
    max-height: 25rem;
    overflow-y: auto;
    color: inherit;
}

.menu .menu,
.menu-secondary {
    position-area: inline-end span-block-end;
}

.menu:empty {
    border: none;
}

.menu-item {
    cursor: pointer;
}

.menu-item:hover,
.menu-item.hover {
    background: var(--bg-secondary-hover);
}

.menu a,
.menu button,
.menu .dropdown-toggle {
    color: inherit;
    text-decoration: inherit;
    box-sizing: border-box;
    display: block;
    border: none;
    padding: .4rem;
    background: none;
    white-space: nowrap;
    width: 100%;
    text-align: left;
    border-radius: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dropdown-toggle.active {
    background: var(--bg-secondary-hover);
}

.dropdown-toggle:focus-visible {
    outline: 1px solid var(--accent);
}

.menu-item:first-child > * {
    border-top-left-radius: .2rem;
    border-top-right-radius: .2rem;
}

.menu-item:last-child > * {
    border-bottom-left-radius: .2rem;
    border-bottom-right-radius: .2rem;
}

.menu hr {
    width: 100%;
    margin: 0;
    border: none;
    border-top: 1px solid var(--border-secondary);
}

.dropdown {
    position: relative;
}

.dropdown > .menu {
    display: none;
}

.dropdown > .menu.show {
    display: flex;
}

.menu-item .dropdown {
    width: 100%;
}

.menu-item button[popovertarget]::after {
    content: ">";
    float: right;
    height: 0;
}

/***** DIALOGS ****************************************************************/

dialog {
    box-sizing: border-box;
    color: var(--text);
    background: none;
    border: none;
    width: 36rem;
    padding: 0;
    height: fit-content;
    overflow: visible;
}

dialog::backdrop {
    background: black;
    opacity: 0.4;
}

dialog:focus {
    outline: none;
}

dialog > .card {
    box-shadow: 0 0 2px black;
}

.dialog--bottom {
    position: fixed;
    bottom: .8rem;
    max-width: 100%;
    z-index: 1001;
}

/***** CALENDAR ***************************************************************/

.calendar {
    display: flex;
    flex-direction: column;
    align-items: center;
    --cellsize: 14px;
    --level-0: #161b22;
    --level-1: #0E4429; /* #39d353 */
    --level-2: #07582D; /* #83d941 */
    --level-3: #006D32; /* #b5eb64 */
    --level-4: #138A3A; /* #e6f590 */
    --level-5: #26A641; /* #feffe2 */
    --level-6: #30BD4A; /* #feffe2 */
    --level-7: #39D353; /* #feffe2 */
    --level-8: #2CE24A; /* #feffe2 */
    --level-9: #1EF141; /* #feffe2 */
    --level-more: #feffe2; /* #ffffff */
}

.calendar--weekly {
    --cellsize: .56rem;
}

.calendar--monthly {
    --cellsize: 5rem;
}

.calendar-header {
    display: flex;
    justify-content: center;
    margin-bottom: .4rem;
    align-items: baseline;
    gap: .4rem;
}

.calendar-year {
    width: 6rem;
    font-weight: bold;
    font-size: large;
    text-align: center;
    user-select: none;
    white-space: nowrap;
}

.calendar-button {
    padding-top: 0;
    padding-bottom: 0;
}

.calendar-body {
    display: flex;
    flex-direction: column;
}

.calendar-row {
    display: flex;
    align-items: center;
}

.calendar-day-number {
    writing-mode: sideways-lr;
    width: var(--cellsize);
    margin: 1px;
    line-height: 12px;
    font-size: small;
}

.calendar--monthly .calendar-day-number {
    writing-mode: unset;
    text-align: center;
}

.calendar-day-number:first-child,
.calendar-month-name {
    text-align: right;
    width: 28px;
    margin-right: 2px;
    font-size: small;
}

.calendar--monthly .calendar-day-number:first-child {
    width: var(--cellsize);
    text-align: center;
}

.calendar-day {
    width: var(--cellsize);
    height: var(--cellsize);
    margin: 1px;
    background: var(--level-0); /*#161b22*/
    border-radius: .125rem;
}

.calendar-day.disabled {
    background: none;
}

.calendar-day.filled-1 {background-color: var(--level-1)}
.calendar-day.filled-2 {background-color: var(--level-2)}
.calendar-day.filled-3 {background-color: var(--level-3)}
.calendar-day.filled-4 {background-color: var(--level-4)}
.calendar-day.filled-5 {background-color: var(--level-5)}
.calendar-day.filled-6 {background-color: var(--level-6)}
.calendar-day.filled-7 {background-color: var(--level-7)}
.calendar-day.filled-8 {background-color: var(--level-8)}
.calendar-day.filled-9 {background-color: var(--level-9)}
.calendar-day.filled-more {background-color: var(--level-more)}

.calendar--monthly .calendar-day {
    overflow: auto;
}

.calendar--monthly .calendar-day-body {
    display: flex;
    flex-direction: column;
    font-size: small;
    padding: .2rem;
    gap: .1rem;
}

.calendar--monthly .calendar-day.filled-6,
.calendar--monthly .calendar-day.filled-7,
.calendar--monthly .calendar-day.filled-8,
.calendar--monthly .calendar-day.filled-9,
.calendar--monthly .calendar-day.filled-more {
    color: var(--text-dark);
}

.calendar-popover {
    position: absolute;
    background: var(--bg-secondary);
    display: flex;
    flex-direction: column;
    gap: .2rem;
    padding: .4rem;
    border-radius: .4rem;
    border: 1px solid var(--border-secondary);
    max-width: min(100%, 24rem);
}

.calendar-popover button,
.calendar-popover .button {
    background-color: var(--bg-secondary-alt);
}

.calendar-day-body i + span {
    margin-left: .1rem;
}

.calendar-popover i + span {
    margin-left: .2rem;
}

@media (max-width: 800px) {

    .calendar--yearly {
        height: 35rem;
    }

    .calendar--yearly .calendar-body {
        transform: rotate(90deg) translateX(10rem);
        flex-direction: column-reverse;
    }

    .calendar--weekly {
        --cellsize: 1rem;
        height: 62rem;
    }

    .calendar--weekly .calendar-body {
        transform: rotate(90deg) translateX(26rem);
        flex-direction: column-reverse;
    }

    .calendar--monthly {
        --cellsize: 2.6rem;
    }

}

/***** EVENTS *****************************************************************/

.event-dot {
    display: inline-block;
    margin-top: .1rem;
    width: .5rem;
    height: .5rem;
    background: var(--accent);
    border-radius: 50%;
}

/***** TASKS ******************************************************************/

.task {
    display: flex;
}

.task-overdue {
    color: var(--warning);
}

.task-button-complete {
    margin-right: .2rem;
    width: 1.18rem;
    height: 1.18rem;
    padding: 0;
}

.task-button-complete:not(:hover) i {
    visibility: hidden;
}

/***** UTILITY CLASSES ********************************************************/

.row {
    display: flex;
    gap: .2rem;
    align-items: center;
    flex-wrap: wrap;
    width: fit-content;
}

.row:empty {
    display: none;
}

.row--nowrap {
    flex-wrap: nowrap;
}

.col,
.coll,
.colll {
    display: flex;
    flex-direction: column;
    gap: .2rem;
}

.coll {
    gap: .4rem;
}

.colll {
    gap: .8rem;
}

.hidden {
    display: none !important;
}

.muted {
    color: var(--text-muted);
}

.hint {
    font-size: small;
    color: var(--text-muted);
}

.gold {
    color: var(--gold);
}

.dim {
    color: var(--text-dim);
}

.x-hint {
    font-size: x-small;
    color: var(--text-muted);
}

.plain {
    border: none;
    padding: 0;
    border-radius: 0;
}

.ellipsis {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.invert {
    filter: invert();
}

.small {
    font-size: small;
}

.spaced-lines {
    line-height: 1.6;
}