:root {
    --custom-font: "Nunito Sans";
    --color: #fff;
    --font: var(--custom-font), 'Poppins', Arial, Helvetica, sans-serif !important;
    --border: 4px;
    --background: #191a1d;
    --header: transparent;
    --habit: #23262d; /* #262f3d, #1a1c21 */
    --habit_done: #1b1d21; /* #1e2229, #21242b */
    --button: #222830;
    --button-selected: #356292;
    --habit_foreground-1: #999;
    --overlay: #005ebd88; /* #0057af88 */
    --hour-percentage: 0%;
    --foreground: #2994ff;
    --h1-size: 30px;
    --h2-size: 24px;
    --h3-size: 18px;
    --p-size: 16px;
    --small-size: 10px;
    --side-padding: 16px;
    --theme-opacity: 1;
    --theme: hsla(210, 100%, 58%, var(--theme-opacity));

    --theme-bright: #0095ff; /* #2994ff */
    --theme-middle: #0f68c0;
    --theme-dark: #1f4b77;

    --theme: var(--theme-bright);
}

@media (max-width: 600px) {
    :root {
        --h1-size: 24px;
        --h2-size: 20px;
        --h3-size: 16px;
        --p-size: 14px;
        --small-size: 10px;
        --side-padding: 12px;
    }
}

* {
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    background: none;
    outline: none;
    border: none;
    color: unset;
    text-decoration: none;
    font-family: inherit;
}

html {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

html,
body {
    overscroll-behavior: contain;
}

body {
    background-color: var(--background);
    font-family: var(--font);
    position: relative;
    min-height: 100dvh;
    -ms-overflow-style: none;
    scrollbar-width: none;
    margin-bottom: 1vh;
    color: var(--color);
    max-width: 600px;
    min-width: 300px;
}

body>* {
    padding: 0 var(--side-padding);
}

body::-webkit-scrollbar {
    display: none;
}

button {
    font-family: var(--font);
}

.no-select {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.card {
    width: 100%;
    border-radius: var(--border);
    background-color: var(--habit);
    display: grid;
    font-weight: 500;
    cursor: pointer;
}

.card>* {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color);
}

.card .habit-name {
    justify-content: start;
}

.card>div {
    padding: 18px 0;
}

.title {
    text-align: center;
    font-size: var(--h2-size);
    padding: 0 30px;
    width: 100%;
    margin-bottom: 10px;
}

hr {
    background-color: #23252b88;
    height: 3px;
    margin: 20px;
}

header h1 {
    font-size: var(--h1-size);
}

header nav {
    gap: 16px;
}

header {
    background-color: var(--header);
    padding: 10px var(--side-padding);
    margin: 10px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap: 20px;
    font-weight: 800;
    width: 100%;
}

header>* {
    display: flex;
    justify-content: space-between;
    width: 100%;
}

.header-menu {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
}

.header-menu i {
    cursor: pointer;
    font-size: 24px;
}

.header-title {
    width: 100%;
}

.header-title h2 {
    font-size: 1em;
    font-weight: 500;
    color: var(--habit_foreground-1);
}

.header-title h1 img {
    display: none;
}

img.site-logo {
    height: 50px;
}

#expanded-header {
    display: none;
    margin-bottom: 10px;
}

#expanded-header.show {
    display: block;
}

#expanded-header ul {
    display: grid;
    grid-template-columns: 1fr 1fr;
    list-style-type: none;
    list-style: none;
    gap: 12px;
}

#expanded-header li {
    display: flex;
    gap: 10px;
    font-size: var(--p-size);
    color: #fff;
    font-weight: 500;
    background-color: var(--button);
    padding: 14px;
    border-radius: var(--border);
    text-align: center;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

#expanded-header li.toggle-btn {
    padding: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    border-radius: var(--border);
    background-color: var(--button);
    grid-column: span 2;
}

#expanded-header li.toggle-btn div {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--border);
    transition: .3s cubic-bezier(0.075, 0.82, 0.165, 1) background;
    padding: 14px;
}

#expanded-header li.toggle-btn div.selected {
    background-color: var(--button-selected);
}

#expanded-header li.toggle-btn div span {
    display: block;
    /* display: none; */
}

#expanded-header li.toggle-btn div.selected span {
    display: block;
}

.alert {
    padding: 20px;
    background-color: #4a6d4a;
    margin: 12px var(--side-padding);
    margin-bottom: 0;
    text-align: center;
    border-radius: var(--border);
    display: none;
    text-align: center;
    font-family: 'Poppins', Arial, Helvetica, sans-serif;
    cursor: pointer;
    font-size: var(--p-size);
}

.alert.banner {
    display: flex;
    background-color: var(--theme-middle); /* #4070a4 #175890 */
    font-size: var(--p-size);
    font-weight: 500;
    margin: 0;
    padding: 14px 20px;
    margin-top: 10px;
}

.alert p {
    font-size: 1.05em;
    width: 100%;
    text-decoration: underline;
}

.alert.banner i {
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 18px;
    padding: 0 4px;
}


#habit-library {
    padding: 20px var(--side-padding);
    gap: 20px;
    flex-direction: column;
    align-items: center;
    display: none;
}

#habit-library.show {
    display: flex !important;
}

#habit-library h3 {
    text-align: center;
}

#library-wrapper-own,
#library-wrapper-public {
    padding: 0 16px;
    display: flex;
    flex-direction: column;
}

#habit-library .card {
    grid-template-columns: 60px 1fr 60px !important;
    grid-template-rows: 50px;
}

.card .habit-description {
    grid-column: span 4;
    font-size: var(--p-size);
    --color: #aaa;
    padding: 20px !important;
    padding-top: 0 !important;
    justify-content: start;
    text-align: start;
    display: none;
}

.card.expand .habit-description,
.card.habit-expand .habit-description {
    display: flex;
}

#habit-library .habit-emoji {
    color: var(--theme);
}

div.card[data-added="true"] {
    --theme: var(--theme-dark) !important;
}

div.card[data-added="true"][data-hidden="true"] .habit-add i {
    color: #fff;
}

div.card[data-added="true"]:not([data-hidden="true"]) {
    background-color: var(--habit_done) !important;
}

div.card[data-added="true"]:not([data-hidden="true"]) .habit-add {
    display: none;
}

div.card[data-added="true"]:not([data-hidden="true"]) .habit-name {
    --color: #757677 !important;
}

div.card[data-added="true"]:not([data-hidden="true"]) div.habit-description {
    --color: #ccc !important;
}

#hr_2 {
    display: none;
}

.habit-add {
    padding: 0 !important;
    display: flex;
    justify-content: center;
    align-items: center;
}

.habit-add i {
    padding: 8px;
    aspect-ratio: 1/1;
    background-color: var(--theme);
    border-radius: var(--border);
    color: #23262d;
}

#guide_container {
    padding: 20px var(--side-padding);
    gap: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#guide_container .h3_title {
    margin-top: 20px;
}

#guides {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr;
    gap: 20px;
}

#article-links .link {
    border-radius: var(--border) !important;
}

#guides>div,
#article-links .link {
    --overlayer: linear-gradient(0deg, var(--overlay), var(--overlay));
    /* aspect-ratio: 1/1;
    aspect-ratio: 5/4; */
    aspect-ratio: 5/1;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    font-size: var(--h2-size);
    background-color: var(--habit);
    border-radius: var(--border);
    background-image: var(--overlayer), var(--img);
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    text-align: center;
    cursor: pointer;
    text-shadow: 1px 1px 2px var(--habit), 0 0 1em var(--habit), 0 0 0.2em var(--habit);
    padding: 30px;
    width: 100%;
    height: 100%;
    gap: 10px;
    aspect-ratio: 3/1;
}

#article-links {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    font-size: var(--p-size);
    font-weight: 500;
    gap: 10px;
    text-align: center;
    list-style-type: none;
    width: 100%;
}

#guides-title {
    margin-bottom: 10px;
    
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 22px;

    /* */
    padding: 0 var(--side-padding);
    justify-content: space-between;
}

#guides-title a {
    text-decoration: underline;
    text-transform: none;
}

#guide_container {
    --p-font-s: 16px;
    --h-font-w: 600;
}

#guides h3,
#article-links h3 {
    font-size: var(--h2-size);
    font-weight: 600;
}

#article-links p,
#guides p {
    font-size: var(--p-size);
}

.flex,
.habit-expand .target-menu,
.more-button,
.add-habit,
#add-habit-title,
.header-logo {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flex-col,
#habits,
.habit-streak,
.add-habit button,
[data-type="measurable"] .habit-check {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#habits {
    position: relative;
}

#habits .card {
    width: 100%;
    border-radius: var(--border);
    background-color: var(--habit);
    display: grid;
    grid-template-columns: 60px 1fr 60px 60px;
    font-weight: 500;
    cursor: pointer;
}

.habit-emoji,
.habit-check,
.habit-streak {
    font-size: 24px;
}

.habit-emoji,
.habit-check,
.habit-streak,
.habit-days {
    justify-content: center;
    user-select: none;
    -moz-user-select: none;
    -webkit-user-select: none;
}

.habit-name {
    width: 100%;
    font-size: var(--p-size);
}

[data-type="measurable"] .habit-check .habit-number {
    line-height: 16px;
    font-size: var(--p-size);
    font-weight: 600;
}

[data-type="measurable"] .habit-check .habit-number-type {
    font-size: 12px;
}


.habit-check {
    color: var(--habit_foreground-1);
    transition: color .4s cubic-bezier(0.075, 0.82, 0.165, 1);
}

.card[data-done="true"] .habit-check {
    color: var(--theme) !important;
}

#habits .fa-chevron-down,
.fa-chevron-up {
    margin-left: 10px;
    color: #555;
}

.habit-streak {
    text-align: center;
    gap: 4px;
    font-weight: 600;
    border-radius: 50%;
    outline-offset: -8px;
    color: var(--theme);
}

.habit-streak span {
    --color: #666 !important;
    color: var(--color);
}

.habit-streak .habit-days {
    font-size: var(--small-size);
    position: relative;
}

[data-done="true"] .habit-streak .habit-days {
    font-size: calc(var(--small-size) * 1.25);
}

[data-done="true"] .habit-streak .line {
    display: none;
}

div.card[data-done="true"] {
    background-color: var(--habit_done) !important;
    --theme: var(--theme-dark) !important;
}

div.card[data-done="true"] .habit-name {
    --color: #757677 !important;
    /* text-decoration:line-through; */
}

div.card[data-done="true"] div.habit-description {
    --color: #ccc !important;
}

.habit-expand .target-menu {
    display: grid;
}

.target-menu {
    display: none;
    padding: 0 !important;
    padding-left: 12px !important;
    margin-bottom: 12px;
    gap: 10px;
    cursor: default;
    font-size: 14px;
    grid-template-rows: 40px;
    --border: 4px;
    --theme: var(--theme-dark);
    --color: #ccc;
    grid-column: span 3 !important;
    width: 100% !important;
    grid-template-columns: 1fr 1fr;
}

.target-menu:blank {
    display: none;
}

.target-menu>* {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.target-menu input,
.target-menu button {
    font: unset;
    font-family: var(--font) !important;
}

.target-menu .target-input {
    background-color: var(--theme);
    padding: 6px 12px;
    font-size: var(--p-size);
    border-radius: var(--border);
    position: relative;
}

.target-menu .target-input i {
    padding: 4px;
    cursor: pointer;
}

.target-menu .target-input.dropdown i {
    font-size: 10px;
    padding: 0;
}

.target-menu input {
    width: min-content;
    min-width: 5px;
    width: min-content;
    text-align: center;
    font-family: var(--font) !important;
    --color: #ddd;
    color: var(--color);
}

.target-menu input::-webkit-outer-spin-button,
.target-menu input::-webkit-inner-spin-button {
    -webkit-appearance: none;
}

.target-menu .target-input {
    --color: #ddd;
    color: var(--color);
    outline-offset: -2px;
}

#habits .target-menu .fa-chevron-down,
#habits .target-menu .fa-chevron-up {
    --color: #fff;
    color: var(--color);
}

.target-menu .target-input.dropdown {
    cursor: pointer;
}

.line {
    width: 50px;
    margin-top: 2px;
    height: 3px;
    background-color: #111;
    border-radius: 12px;
    position: relative;
}

.line::before {
    width: var(--hour-percentage);
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 3px;
    background-color: var(--theme);
    border-radius: 12px;
    opacity: 0.5;
}

#new-habit {
    margin-top: 10px;
    width: 100%;
}

.more-button {
    font-weight: 900;
    text-transform: uppercase;
    font-size: var(--p-size);
    color: #888;
    cursor: pointer;
    gap: 8px;
    display: inline-flex;
}

.more-button#add-habit_btn {
    width: fit-content;
    display: flex;
    padding: 16px 24px;
    /* background-color: var(--theme-dark); */
    color: #fff;
    margin: var(--side-padding);
    width: calc(100% - (var(--side-padding) * 2));
    border-radius: var(--border);

    background-color: var(--button);
}

.habit-name i {
    display: none;
}

[data-status="1"]:not([data-done="true"]) .habit-streak {
    --theme: var(--habit_foreground-1);
}

[data-streak-warning] .card:not([data-done="true"]) .habit-streak {
    --theme: #cd7676;
}

#habits .habit-description {
    --color: #fff;
    font-size: var(--p-size);
}

[data-link="discord"] {
    background-color: #5865f2 !important;
    grid-column: span 2;
}

.dropdown-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

[data-unit-2="undefined"] .dropdown-icon {
    display: none;
}

.target-menu .target-input[data-unit-2="undefined"] {
    opacity: 0.6;
    cursor: default;
}

.target-resetter {
    display: none;
    cursor: pointer;
    text-decoration: underline;
    grid-column: span 2;
    text-align: start;
    height: 0;
    margin: 16px 0;
}

.target-resetter.value-show,
.target-resetter.unit-show {
    display: flex;
}

.habit-expand .hide-btn {
    display: flex !important;
}

.hide-btn {
    display: none !important;
    height: 40px;
    width: 40px;
    margin: 0 auto;
    grid-column-start: 4;
    color: #999;
    margin-bottom: 10px;
}

@media (max-width: 600px) {
    body {
        width: 100% !important;
    }

    .card {
        grid-template-columns: 55px 1fr 50px 50px !important;
    }

    #guides {
        gap: 12px !important;
        grid-template-columns: 1fr !important;
        grid-template-rows: 120px !important;
        width: 100%;
    }

    #guides .guide {
        height: 120px;
    }

    .target-menu {
        grid-column: span 3 !important;
        width: 100% !important;
        justify-content: center;
        align-items: center;
        grid-template-columns: 1fr 1fr;
    }

    header {
        padding: 20px var(--side-padding);
        padding-bottom: 0;
        gap: 10px;
        margin-top: 0;
    }

    header nav {
        padding: 0 8px;
        padding-bottom: 8px;
    }

    #expanded-header ul {
        gap: 10px 8px;
    }

    #expanded-header li.toggle-btn {
        gap: inherit;
    }

    .card .habit-emoji {
        font-size: 1.2em;
    }

    .target-resetter {
        margin: 10px 0;
    }
    
    #article-links .link {
        aspect-ratio: 7/3;
    }

    /* img.site-logo {
        height: 25px;
    }

    .header-title h1 img {
        display: flex;
    }

    .header-title h1 {
        display: flex;
        justify-content: start;
        align-items: center;
        gap: 6px;
    }

    .header-logo {
        display: none;
    } */
    

    .alert.banner {
        border-radius: 0;
        margin: 0;
    }
}

.habit-emoji {
    color: var(--theme);
}