:root {
    --pico-font-size: 100%;
    --color-cyan: #00ffff;
    --color-gold: #da9100;
    --color-silver: #aaaaaa;
    --color-orange: #ff9500;
    --color-green: #4cd964;
    --color-red: hwb(3 25% 19%);
    --color-yellow: #ffcc00;
    --header-height: 60px;
    --footer-height: 80px;

    /* Pico Overrides */
    --pico-background-color: #000000;
    --pico-card-background-color: #111111;
    --pico-primary: #e6e6e6;
    --pico-secondary: var(--color-cyan);
    --pico-primary-background: #e6e6e6;
    --pico-primary-hover: #ffffff;
}

body {
    overflow: hidden;
    height: 100dvh;
    margin: 0;
    background-color: var(--pico-background-color);
}

/* Layout */
.app-layout {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    width: 100%;
    background: var(--pico-background-color);
    position: relative;
    overflow: hidden;
    touch-action: pan-y;
}

@media (min-width: 600px) {
    body {
        display: flex;
        align-items: center;
        justify-content: center;
        background-color: #080808;
        /* Darker background for desktop gutters */
    }

    .app-layout {
        width: 600px;
        max-width: 100%;
        height: 90dvh;
        border: 1px solid var(--pico-muted-border-color);
        border-radius: 16px;
        box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
    }
}

header {
    height: var(--header-height);
    padding: 0.5rem 1rem;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    border-bottom: 1px solid var(--pico-muted-border-color);
    background: var(--pico-background-color);
    z-index: 10;
    border-top-left-radius: inherit;
    border-top-right-radius: inherit;
}

header>div:last-child {
    display: flex;
    justify-content: flex-end;
}

header .view-title {
    font-size: 1.2rem;
    color: var(--pico-secondary);
}

main {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    padding-bottom: calc(var(--footer-height) + 1rem);
}

footer {
    height: var(--footer-height);
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--pico-background-color);
    border-top: 1px solid var(--pico-muted-border-color);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 20;
    border-bottom-left-radius: inherit;
    border-bottom-right-radius: inherit;
}

@media (min-width: 600px) {
    footer {
        position: absolute;
    }
}

/* Typography & Icons */
h1,
h2,
h3,
h4,
h5,
h6 {
    margin-bottom: 0.5rem;
}

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

.text-white {
    color: #ffffff !important;
}

.text-secondary {
    color: var(--pico-secondary);
}

.text-success {
    color: var(--pico-ins-color);
}

.text-warning {
    color: var(--pico-mark-color);
}

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

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

.text-error {
    color: var(--color-red);
}

.font-bold {
    font-weight: bold;
}

.icon-btn {
    background: none;
    border: none;
    padding: 0.5rem;
    color: var(--pico-primary);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    outline: none;
    box-shadow: none;
}

.icon-btn:focus {
    box-shadow: none;
}

footer .icon-btn {
    flex: 1;
}

.icon-btn.active {
    color: var(--pico-secondary);
}

.icon-btn h1 {
    color: inherit;
    margin-bottom: 0;
}

/* Bordered Footer Buttons (Form) */
.btn-bordered-cyan {
    border: 1px solid var(--color-cyan) !important;
    color: var(--color-cyan) !important;
    background: transparent !important;
    width: 50%;
    font-size: 1.25rem;
    font-weight: bold;
}

/* Task List */
.task-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    border: 1px solid var(--pico-muted-border-color);
    border-radius: 12px;
    margin-bottom: 0.75rem;
    background: var(--pico-background-color);
}

.task-checkbox {
    margin-right: 1rem;
    cursor: pointer;
    min-width: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pulse {
    animation: pulse-animation 2s infinite;
}

@keyframes pulse-animation {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }

    100% {
        opacity: 1;
    }
}

.task-content {
    flex: 1;
}

.task-meta {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.icon-seal {
    width: 1.5em;
    height: 1.5em;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Profile Menu */
.profile-menu-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid var(--pico-muted-border-color);
    border-radius: 12px;
    margin-bottom: 0.75rem;
    background: var(--pico-background-color);
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.profile-menu-item:active {
    background-color: var(--pico-card-background-color);
}

.profile-menu-item.text-muted {
    cursor: not-allowed;
    opacity: 0.5;
}

.profile-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

/* Sticky Headers for Forms and Details */
.sticky-stack {
    position: sticky;
    top: -1rem;
    z-index: 5;
    background-color: var(--pico-background-color);
}