html,
body {
    width: 100%;
    min-height: 100%;
    overflow-x: clip;
    overflow-y: visible;
}

body {
    margin: 0;
    background-color: #201711;
    background-image: url("./img_base/bg.png");
    background-position: center center;
    background-repeat: no-repeat;
    background-size: cover;
    background-attachment: fixed;
    color: #433120;
}

@media only screen and (max-width: 700px) {
    body {
        margin: 0 !important;
        background-attachment: scroll;
        height: auto;
        min-height: 100%;
        overflow-x: clip;
        overflow-y: visible;
    }
}

@media only screen and (max-width: 1024px) {
    .container {
        width: 100% !important;
        max-width: 100% !important;
    }
}

@media only screen and (max-width: 1399.98px) {

    .container,
    .container-sm,
    .container-md,
    .container-lg,
    .container-xl,
    .container-xxl {
        width: 100% !important;
        max-width: 100% !important;
    }
}

.main-nav {
    position: sticky;
    top: 0;
    z-index: 120;
    width: calc(100% + var(--bs-gutter-x, 1.5rem));
    margin-inline: calc(var(--bs-gutter-x, 1.5rem) / -2);
    background: linear-gradient(100deg, rgba(50, 35, 25, 0.96), rgba(82, 54, 35, 0.92));
    border: 0;
    border-bottom: 1px solid rgba(215, 155, 66, 0.48);
    padding: 3px 14px;
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: flex-start;
    box-shadow: 0 5px 14px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(6px);
}

.main-nav-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.nav-settings-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 7px;
    border: 1px solid rgba(215, 155, 66, 0.42);
    background: rgba(215, 155, 66, 0.07);
    color: #e5b85d;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    flex: 0 0 auto;
    box-shadow: none;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.58);
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.nav-settings-btn:hover {
    background: rgba(215, 155, 66, 0.16);
    border-color: rgba(229, 184, 93, 0.72);
    color: #f3c24a;
}

.nav-settings-btn:focus-visible {
    outline: 1px solid rgba(229, 184, 93, 0.8);
    outline-offset: 2px;
}

.nav-info-btn {
    font-size: 16px;
}

.main-nav-brand-cluster {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    cursor: default;
}

.main-nav-brand-cluster:hover {
    border: 0;
    box-shadow: none;
}

.main-nav-brand {
    width: 58px;
    height: 58px;
    border: 0;
    background: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 58px;
}

.main-nav-brand img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 3px 3px rgba(0, 0, 0, 0.38));
}

.main-nav-brand-text-wrap {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 2px;
    min-width: 0;
    text-align: left;
}

.main-nav-brand-text {
    color: #e5b85d;
    font-weight: 900;
    font-size: 21px;
    line-height: 1.05;
    white-space: nowrap;
    letter-spacing: 0.15px;
    text-shadow: 0 2px 3px rgba(0, 0, 0, 0.48);
}

.main-nav-brand-subtext {
    color: rgba(255, 245, 225, 0.9);
    font-size: 13px;
    font-weight: 700;
    text-transform: none;
    letter-spacing: 0.1px;
    line-height: 1.1;
    white-space: nowrap;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.nav-search-wrap {
    position: relative;
    flex: 1 1 auto;
    width: auto;
    max-width: none;
    min-width: 160px;
}

#globalSearchInput {
    width: 100%;
    background: #ead6b8;
    color: #3e2a16;
    border: 1px solid rgba(215, 155, 66, 0.72);
    border-radius: 7px;
    padding: 7px 34px 7px 12px;
    font-weight: 700;
    box-shadow: inset 0 1px 2px rgba(89, 56, 30, 0.18);
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

#globalSearchInput::placeholder {
    color: #806548;
}

#globalSearchInput:focus {
    background: #f3e3c9;
    box-shadow: 0 0 0 2px rgba(215, 155, 66, 0.25), inset 0 1px 2px rgba(89, 56, 30, 0.16);
    border-color: rgba(229, 184, 93, 0.88);
    outline: none;
}

.nav-search-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #8d6334;
    font-size: 14px;
    pointer-events: none;
}

.search-suggestions {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    background: #ead6b8;
    border: 1px solid rgba(215, 155, 66, 0.72);
    border-radius: 7px;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.28);
    display: none;
    max-height: 280px;
    overflow: auto;
    z-index: 150;
}

.search-suggestions.open {
    display: block;
}

.search-suggestion-btn {
    width: 100%;
    text-align: left;
    border: 0;
    background: transparent;
    padding: 8px 10px;
    color: #433120;
    font-weight: 700;
    border-bottom: 1px solid rgba(215, 155, 66, 0.28);
}

.search-suggestion-btn:hover {
    background: rgba(243, 194, 74, 0.25);
    color: #433120;
}

.container {
    background-color: rgba(32, 23, 17, 0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);

    display: flex;
    flex-direction: column;

    height: 100vh;
    height: 100dvh;
    min-height: 0;

    margin-top: 0 !important;
    overflow: hidden;

    border-inline: 1px solid rgba(215, 155, 66, 0.24);
    box-shadow:
        inset 12px 0 18px -18px rgba(215, 155, 66, 0.42),
        inset -12px 0 18px -18px rgba(215, 155, 66, 0.42);
}

.main-scroll {
    flex: 1 1 auto;
    min-height: 0;

    width: calc(100% + var(--bs-gutter-x, 1.5rem));
    margin-inline: calc(var(--bs-gutter-x, 1.5rem) / -2);
    padding-inline: calc(var(--bs-gutter-x, 1.5rem) / 2);

    display: flex;
    flex-direction: column;

    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-x: none;
    overscroll-behavior-y: auto;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
}

.gf-modal-open .main-scroll {
    pointer-events: none;
    overflow-y: auto;
}

p {
    font-weight: 500;
}

html {
    scrollbar-width: thin;
    scrollbar-color: #9a6a45 #332318;
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #332318;
    border-left: 1px solid rgba(215, 155, 66, 0.16);
}

::-webkit-scrollbar-thumb {
    background: #9a6a45;
    border: 2px solid #332318;
    border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
    background: #b47b4f;
}

::-webkit-scrollbar-thumb:active {
    background: #c28a56;
}

.collapse-header {
    color: #e5b85d;
    font-weight: 900;
    background: transparent;
    border-radius: 0;
    margin: 0;
    font-size: 20px;
    padding: 11px 10px 7px;
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    cursor: default;
    text-shadow: 0 2px 3px rgba(0, 0, 0, 0.46);
}

.collapse-header::before {
    content: "";
    flex: 0 0 9px;
    width: 9px;
    height: 9px;
    margin-left: 3px;
    border: 2px solid #d79b42;
    transform: rotate(45deg);
    box-shadow: 0 0 5px rgba(215, 155, 66, 0.22);
}

.collapse-header::after {
    content: "";
    flex: 1 1 auto;
    height: 1px;
    margin-left: 3px;
    background: linear-gradient(90deg, rgba(215, 155, 66, 0.58), rgba(215, 155, 66, 0.08));
}

.header-title {
    min-width: 0;
}

.category-wrapper {
    background: transparent;
    padding: 6px 8px 14px;
    margin-bottom: 2px;
    border: 0;
    border-radius: 0;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

@media only screen and (max-width: 1100px) {
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media only screen and (max-width: 700px) {
    .category-grid {
        grid-template-columns: 1fr;
    }
}

.category-box {
    display: flex;
    align-items: stretch;
    background: rgba(96, 65, 44, 0.94);
    border: 1px solid rgba(215, 155, 66, 0.52);
    border-radius: 9px;
    text-decoration: none;
    color: #f7ead5;
    overflow: hidden;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045), 0 3px 8px rgba(0, 0, 0, 0.34);
    transition: background-color 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    min-height: 68px;
    position: relative;
}


.category-card-shell:hover .category-box {
    background-color: #714c31;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 5px 13px rgba(0, 0, 0, 0.3);
    border-color: rgba(225, 170, 83, 0.68);
}

@media (hover: none),
(pointer: coarse) {
    .category-card-shell:hover .category-box {
        background-color: rgba(96, 65, 44, 0.94);
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045), 0 3px 8px rgba(0, 0, 0, 0.34);
        border-color: rgba(215, 155, 66, 0.52);
    }
}

.category-icon {
    flex: 0 0 68px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border-right: 1px solid rgba(215, 155, 66, 0.42);
}

.category-icon img {
    width: 46px;
    height: 46px;
    object-fit: contain;
}

@keyframes category-icon-wiggle {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-2px); }
    50% { transform: translateX(2px); }
    75% { transform: translateX(-1px); }
}

@media (hover: hover) and (pointer: fine) {
    .category-card-shell:hover .category-icon img {
        animation: category-icon-wiggle 620ms ease-in-out both;
    }

    .category-card-shell:has(.category-box.disabled):hover .category-icon img {
        animation: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .category-card-shell:hover .category-icon img {
        animation: none;
    }
}

.category-box h3 {
    margin: 0;
    padding: 0 8px;
    font-size: 16px;
    font-weight: bold;
    color: #f7ead5;
    text-align: left;
    line-height: 1.2;
    width: 100%;
    box-sizing: border-box;
}

.category-content {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.category-card-shell {
    position: relative;
}

.category-box.disabled {
    filter: grayscale(40%) blur(1px);
    opacity: 0.55;
    pointer-events: none;
    cursor: not-allowed;
    transition: all 0.3s ease;
}

.now-grid::-webkit-scrollbar {
    height: 8px;
}

.now-grid::-webkit-scrollbar-thumb {
    background-color: #9a6a45;
    border-radius: 999px;
}

.now-grid::-webkit-scrollbar-thumb:hover {
    background-color: #b47b4f;
}

@media only screen and (max-width: 700px) {

    .now-grid::-webkit-scrollbar {
        height: 4px;
    }
}

.now-grid {
    display: flex;
    flex-wrap: nowrap;
    gap: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    overscroll-behavior-x: contain;
    padding-bottom: 4px;
}

.now-card {
    background-color: rgb(145, 98, 65);
    border: 2px solid white;
    border-radius: 16px;
    padding: 10px 12px;
    min-height: 120px;
    flex: 0 0 clamp(240px, 30vw, 360px);
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
}

.now-card.status-active {
    border-color: rgba(142, 236, 167, 0.95);
}

.now-card.status-paused {
    border-color: rgba(240, 185, 124, 0.95);
}

.now-card.status-planned {
    border-color: rgba(146, 188, 246, 0.95);
}

.now-card.status-done {
    border-color: rgba(174, 231, 182, 0.95);
}

.now-card-head {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    margin-bottom: 8px;
    padding-bottom: 0;
    min-height: 0;
}

.now-card-head h3 {
    margin: 0;
    color: white;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.15;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    width: 100%;
}

.now-card p {
    margin: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.35);
    padding-top: 8px;
    margin-left: -12px;
    margin-right: -12px;
    padding-left: 12px;
    padding-right: 12px;
    color: white;
    font-size: 14px;
    line-height: 1.25;
}

.now-card.status-active p {
    border-top-color: rgba(142, 236, 167, 0.55);
}

.now-card.status-paused p {
    border-top-color: rgba(240, 185, 124, 0.55);
}

.now-card.status-planned p {
    border-top-color: rgba(146, 188, 246, 0.55);
}

.now-card.status-done p {
    border-top-color: rgba(174, 231, 182, 0.55);
}

@media only screen and (max-width: 700px) {

    body {
        margin: 0 !important;
        background-attachment: scroll;
        height: auto;
        min-height: 100%;
        overflow-x: clip;
        overflow-y: visible;
    }

    .now-card {
        flex-basis: min(86vw, 360px);
    }

    .container {
        position: relative;
        height: auto;
        min-height: 100vh;
        min-height: 100dvh;
        overflow: visible;
        padding-bottom: calc(55px + env(safe-area-inset-bottom, 0px));
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    .main-nav {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        top: auto;

        width: 100%;
        margin-inline: 0;

        padding: 8px 8px calc(8px + env(safe-area-inset-bottom, 0px));
        gap: 8px;

        border-bottom: none;
        border-top: 1px solid rgba(215, 155, 66, 0.48);

        z-index: 300;
    }

    .main-scroll {
        display: flex;
        flex-direction: column;

        flex: 0 0 auto;
        min-height: auto;

        overflow-x: hidden;
        overflow-y: visible;

        padding-bottom: 10px;
    }

    .main-nav-left {
        display: none;
    }

    .nav-settings-btn {
        width: 36px;
        height: 36px;
        padding-inline: 0;
        flex-basis: auto;
    }

    .main-nav-brand {
        display: inline-flex;
        margin-bottom: 0;
    }

    .main-nav-brand-cluster {
        padding: 0;
        border-radius: 0;
        border-color: transparent;
        background: transparent;
        box-shadow: none;
    }

    .main-nav-brand-text-wrap {
        display: none;
    }

    .nav-search-wrap {
        flex: 1 1 auto;
        width: auto;
        min-width: 0;
    }

    .search-suggestions {
        top: auto;
        bottom: calc(100% + 6px);
    }

    .category-wrapper {
        padding: 6px 0 14px;
    }
}
