* {
    box-sizing: border-box;
    font-family:
        system-ui,
        -apple-system,
        "Segoe UI",
        Roboto,
        "Helvetica Neue",
        "Noto Sans",
        "Liberation Sans",
        Arial,
        sans-serif,
        "Apple Color Emoji",
        "Segoe UI Emoji",
        "Segoe UI Symbol",
        "Noto Color Emoji";
}

.w-100 {
    width: 100% !important;
}

.pusher {
    flex-grow: 1;
}

.drawer {
    display: flex;
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 99;
}

.drawer__backdrop {
    flex-grow: 1;
    background: #111;
    opacity: 0.7;
}

.drawer__content {
    background: #111;
    border-left: 1px solid #333;
}

label {
    margin-bottom: 0.5rem;
}

input[type="text"],
select {
    display: block;
    width: 100%;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: #dee2e6;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-color: #212529;
    background-clip: padding-box;
    border: 1px solid #495057;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
    transition:
        border-color 0.15s ease-in-out,
        box-shadow 0.15s ease-in-out;
}

input[type="text"]:focus,
select:focus {
    color: #dee2e6;
    background-color: #212529;
    border-color: #86b7fe;
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

button {
    display: inline-block;
    padding: 6px 12px;
    cursor: pointer;
    background: none;
    border: 1px solid #333;
    color: #ccc;
    border-radius: 6px;
}

button.action {
    background: #66ff00;
    color: #333;
}

html {
    color: white;
    font-size: 16px;
    background: #111;
}

#app {
    min-height: 100vh;
    padding: 0.5rem;
    max-width: 960px;
    margin: 0 auto;
}

.app__header {
    margin: 0 0.5rem;
    display: flex;
}

.app__title {
    font-size: 1.5rem;
    color: white;
}

.app__new-habit-launcher {
    width: 1rem;
    height: 1rem;
    cursor: pointer;
    color: #66ff00;
    align-self: center;
}

.app__habits {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 4rem;
}

.habit-yearly,
.habit-monthly,
.habit-weekly {
    background: black;
    border: 1px solid #333;
    padding: 0.5rem;
    border-radius: 0.25rem;
}

.habit-weekly__wrapper,
.habit-monthly__wrapper {
    flex: 0 0 auto;
    width: 50%;
}

.habit-yearly__wrapper {
    flex: 0 0 auto;
    width: 100%;
}

.habit-yearly,
.habit-monthly,
.habit-weekly {
    margin: 0.5rem;
}

.habit-yearly__header,
.habit-monthly__header,
.habit-weekly__header {
    color: #ccc;
    display: flex;
}

.habit-yearly__name,
.habit-monthly__name,
.habit-weekly__name {
    align-self: center;
    padding-bottom: 0.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    text-wrap: nowrap;
}

.habit-menu-launcher {
    position: relative;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
}

.habit-menu-launcher__icon {
    color: #ccc;
    width: 18px;
    height: 18px;
}

.habit-menu {
    position: absolute;
    background: #ccc;
    border-radius: 4px;
    color: #333;
    z-index: 99;
    list-style-type: none;
    margin: 0;
    padding: 0.5rem 0;
}

.habit-menu li {
    cursor: pointer;
    padding: 0 1rem;
}

.habit-menu li.separator {
    cursor: auto;
    margin: 0.5rem 0;
    height: 1px;
    background: #999;
}

.habit-weekly__days,
.habit-monthly__days {
    display: flex;
    flex-wrap: wrap;
    flex-direction: column;
}

.habit-yearly__days {
    max-width: 100%;
    overflow-x: scroll;
    overflow-y: hidden;
    scrollbar-width: none;
}

.habit-yearly__days table,
.habit-monthly__days table,
.habit-weekly__days table {
    border-collapse: separate;
    width: max-content;
    border-spacing: 4px;
    overflow: hidden;
    position: relative;
    margin: 0 auto;
}

.habit-monthly__days table,
.habit-weekly__days table {
    margin: 0.5rem auto;
}

.habit-yearly__days tr {
    height: 12px;
    line-height: 12px;
}

.habit-monthly__days tr,
.habit-weekly__days tr {
    height: 18px;
    line-height: 18px;
}

.habit-yearly__days td {
    width: 12px;
    padding: 0;
}

.habit-monthly__days td,
.habit-weekly__days td {
    width: 18px;
    padding: 0;
}

.habit-yearly__days input[type="checkbox"],
.habit-monthly__days input[type="checkbox"],
.habit-weekly__days input[type="checkbox"] {
    margin-right: 0.75rem;
    transform: scale(1.5);
}

.habit-yearly__days input[type="checkbox"],
.habit-monthly__days input[type="checkbox"],
.habit-weekly__days input[type="checkbox"] {
    flex: 1 0 auto;
    margin: 0;
    transform: none;
}

.habit-check {
    cursor: pointer;
}

.habit-check span {
    display: inline-block;
    width: 12px;
    max-width: 12px;
    height: 12px;
    border-radius: 2px;
}

.habit-monthly__days .habit-check span,
.habit-weekly__days .habit-check span {
    display: inline-block;
    width: 18px;
    max-width: 18px;
    height: 18px;
    border-radius: 2px;
}

.habit-check .checked {
    background: #66ff00;
}

.habit-check .unchecked {
    background: #343a40;
    opacity: 0.15;
}

.daily-check {
    cursor: pointer;
}

.daily-check svg {
    display: inline-block;
    width: 28px;
    max-width: 28px;
    height: 28px;
}

.daily-check .checked {
    color: #66ff00;
}

.daily-check .unchecked {
    color: #343a40;
    opacity: 0.5;
}

.habit-form {
    width: 80vw;
    padding: 1rem;
}

.habit-form label {
    display: block;
}

.view-switcher {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    text-align: center;
    padding: 1rem;
}

.view-switcher button {
    border-radius: 0;
    background: #111;
}

.view-switcher button:first-child {
    border-radius: 6px 0 0 6px;
    border-right: none;
}

.view-switcher button:last-child {
    border-radius: 0 6px 6px 0;
    border-left: none;
}

.view-switcher button.active {
    background: #333;
}

.habit-colors {
}

.habit-colors__color {
    display: inline-block;
    border-radius: 0.25rem;
    width: 2rem;
    height: 2rem;
    margin-right: 0.75rem;
    margin-bottom: 0.75rem;
    cursor: pointer;
    border: 2px solid #333;
}

.habit-colors__color.selected {
    border-color: #86b7fe;
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

@media (max-width: 375px) {
    .habit-yearly__days table {
        border-spacing: 3px;
    }

    .habit-monthly__days table,
    .habit-weekly__days table {
        border-spacing: 2px;
    }
}

@media (min-width: 768px) {
    /* styles for desktops */
    .habit-form {
        width: 40vw;
    }

    .habit-weekly__wrapper,
    .habit-monthly__wrapper {
        flex: 0 0 auto;
        width: 33.33333333%;
    }

    .habit-yearly__wrapper {
        flex: 0 0 auto;
        width: 50%;
    }
}
