/* ====== Bottom nav ====== */

.nav {
    position: absolute;
    left:   0;
    right:  0;
    bottom: 0;
    height: calc(var(--nav-h) + var(--safe-bottom));
    padding-bottom: var(--safe-bottom);
    background: var(--bg-elevated);
    border-top: 1px solid var(--border);
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
}

.nav::-webkit-scrollbar { display: none; }

.nav__item {
    flex: 1 0 auto;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: var(--fs-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
    position: relative;
    transition: color 0.15s ease;
}

.nav__item[hidden] { display: none; }

.nav__item.active { color: var(--accent); }

.nav__item.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 25%;
    right: 25%;
    height: 3px;
    background: var(--accent);
    border-radius: var(--r-full) var(--r-full) 0 0;
}

.nav__item:active { color: var(--text); }

/* ====== Login ====== */

.page--login {
    align-items: center;
    justify-content: center;
}

.login-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--s-4);
    width: 100%;
    max-width: 320px;
}

.login-tag {
    color: var(--text-muted);
    font-size: var(--fs-sm);
    text-align: center;
}

.login-help {
    color: var(--text-dim);
    font-size: var(--fs-xs);
    text-align: center;
}

.action-login {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--s-3);
    width: 100%;
    height: 52px;
    border-radius: var(--r-md);
    background: var(--accent);
    color: var(--bg);
    border: none;
    font-size: var(--fs-base);
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    text-decoration: none;
    transition: background 0.15s ease;
}

.action-login:active { background: var(--accent-active); }

/* Auth lock: hide nav and non-login pages */
.is-locked #app-nav                           { display: none; }
.is-locked .page:not([data-page="login"])     { display: none !important; }
.is-locked .page--login                       { bottom: 0; }

/* ====== Inline action button ====== */

.action-inline {
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
    border-radius: var(--r-sm);
    padding: var(--s-1) var(--s-3);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    cursor: pointer;
    font-family: inherit;
}
.action-inline svg { display: block; }

.action-inline:active { background: var(--accent); color: var(--bg); }

/* ====== Toggle switch ====== */

.toggle-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    width: 40px;
    height: 22px;
    flex-shrink: 0;
    cursor: pointer;
}

.toggle-switch input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
}

.toggle-switch__track {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--r-full);
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.toggle-switch__thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: var(--text-muted);
    border-radius: var(--r-full);
    transition: transform 0.15s ease, background-color 0.15s ease;
}

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

.toggle-switch input:checked + .toggle-switch__track .toggle-switch__thumb {
    background: var(--bg);
    transform: translateX(18px);
}

.toggle-switch input:focus-visible + .toggle-switch__track {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

