:root{
    --bg:#f5f5f7;
    --accent:#007aff;
    --text:#1d1d1f;
    --ink:#1a1208;
    --muted:#8a7a65;
    --border:#d4c9b5;
    --card:#fffdf8;
    --highlight:#fff3e0;
}

*{
    margin:0;
    padding:0;
    box-sizing:border-box;
}

html{
    font-size:16px;
}


body{
    min-height:100dvh;
    display:block;
}

.page-wrapper{
    min-height:100dvh;
    display:flex;
    flex-direction:column;
}

main{
    flex:1;
}
/* ---------- Layout ---------- */

.container{
    display:flex;
    flex-direction:column;

    width:100%;

    min-height:100dvh; /* FIX: prevents Chrome squish */
    height:auto;

    gap:16px;
    padding:12px;
}

/* ---------- Sidebar ---------- */

.sidebar{
    width:100%;

    background:rgba(255,255,255,.85);
    backdrop-filter:blur(20px);

    border-radius:20px;

    box-shadow:
        0 8px 24px rgba(0,0,0,.08);

    overflow:hidden;
}

.logo{
    padding:20px;
    border-bottom:1px solid rgba(0,0,0,.06);
}

.nav{
    display:flex;
    flex-wrap:wrap;
    gap:8px;
    padding:12px;
}

.nav a{
    flex:1 1 140px;

    display:block;

    padding:14px;

    text-decoration:none;
    color:var(--text);

    border-radius:12px;

    background:white;

    transition:.2s ease;
}

.nav a:hover{
    transform:translateY(-2px);
}

/* ---------- Content ---------- */

.content{
    width:100%;
}

.page{
    padding:0;
}

.page h1{
    margin-bottom:16px;
    font-size:clamp(1.5rem, 5vw, 2.25rem);
}

.card{
    width:100%;
    max-width:900px;
    margin:0 auto;
    
    background:white;

    border-radius:20px;

    padding:20px;

    box-shadow:
        0 4px 20px rgba(0,0,0,.05);
}

/* ---------- Forms ---------- */

label{
    font-weight:500;
}

/* only apply spacing to normal form labels, NOT checkbox labels */
label:not(.checkbox-item){
    display:block;
    margin-top:14px;
    margin-bottom:6px;
}

input:not([type="checkbox"]),
select,
textarea{
    width:100%;
    padding:14px;
    border-radius:12px;
    border:1px solid #ddd;
    font-size:16px;
    background:white;
}

input,
select,
textarea{
    width:100%;

    padding:14px;

    border-radius:12px;

    border:1px solid #ddd;

    font-size:16px;

    background:white;
}

input:focus,
select:focus,
textarea:focus{
    outline:none;
    border-color:var(--accent);

    box-shadow:
        0 0 0 4px rgba(0,122,255,.15);
}

select{
    appearance:none;
    -webkit-appearance:none;
    -moz-appearance:none;

    cursor:pointer;

    padding-right:42px;

    background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20'%3E%3Cpath fill='%23666' d='M5.5 7.5L10 12l4.5-4.5'/%3E%3C/svg%3E");

    background-repeat:no-repeat;
    background-position:right 14px center;
}

/* ---------- Buttons ---------- */

button{
    width:100%;

    margin-top:20px;

    padding:16px;

    border:none;

    border-radius:12px;

    background:var(--accent);

    color:white;

    font-size:1rem;
    font-weight:600;

    cursor:pointer;

    transition:.2s;
}

button:hover{
    opacity:.95;
}

button:active{
    transform:scale(.98);
}

/* ---------- Tablet ---------- */

@media (min-width:768px){

    .container{
        flex-direction:row;
        padding:20px;
    }

    .sidebar{
        width:280px;
        flex-shrink:0;
    }

    .nav{
        display:block;
    }

    .nav a{
        margin-bottom:8px;
    }

    .content{
        flex:1;
    }

    .card{
        max-width:900px;
        padding:30px;
    }

    button{
        width:auto;
        padding:14px 24px;
    }
}

.checkbox-grid,
.fuel-grid{
    display:grid;
    grid-template-columns:repeat(auto-fit, minmax(180px, 1fr));
    gap:8px 16px;
    width:100%;
    align-items:start;
}

@media (max-width:600px){
    .checkbox-grid,
    .fuel-grid{
        grid-template-columns:1fr;
    }
}

.checkbox-grid label,
.fuel-grid label,
.checkbox-item{
    display:flex;
    align-items:center;
    justify-content:flex-start;
    gap:8px;

    margin:0;
    padding:0;

    font-weight:400;
    line-height:1.2;

    cursor:pointer;
}

.checkbox-grid input[type="checkbox"],
.fuel-grid input[type="checkbox"],
.checkbox-item input[type="checkbox"]{
    width:18px;
    height:18px;

    margin:0;
    padding:0;

    flex:0 0 18px;

    display:inline-block;
    vertical-align:middle;
}

@supports (height: 100dvh){
    body, .container{
        min-height:100dvh;
    }
}

body{
    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    background:linear-gradient(135deg,#f8f9fb,#eceff3);
    color:var(--text);

    min-height:100dvh;
    overflow-x:hidden;
}

/* ===== APP SHELL ===== */

.container{
    display:grid;
    grid-template-columns:1fr;
    min-height:100dvh;
}

/* ===== SIDEBAR (mobile-first = top bar) ===== */

.sidebar{
    position:sticky;
    top:0;
    z-index:1000;

    width:100%;

    background:rgba(255,255,255,.92);
    backdrop-filter:blur(20px);

    border-bottom:1px solid rgba(0,0,0,.08);

    box-shadow:0 2px 10px rgba(0,0,0,.05);
}

/* make nav horizontal on mobile */
.nav{
    display:flex;
    gap:8px;
    padding:10px;
    overflow-x:auto;
    -webkit-overflow-scrolling:touch;
}

.nav a{
    flex:0 0 auto;

    padding:10px 14px;
    border-radius:12px;

    background:white;
    color:var(--text);

    text-decoration:none;
    white-space:nowrap;
}

/* ===== CONTENT ===== */

.content{
    width:100%;
    padding:12px;
}

.page{
    width:100%;
}

.card{
    width:100%;
    max-width:900px;
    margin:0 auto;

    background:white;
    border-radius:20px;

    padding:20px;

    box-shadow:0 4px 20px rgba(0,0,0,.05);
}

@media (min-width:768px){

    .container{
        grid-template-columns:280px 1fr;
    }

    .sidebar{
        position:sticky;
        top:0;
        height:100dvh;

        border-bottom:none;
        border-right:1px solid rgba(0,0,0,.08);
    }

    .nav{
        flex-direction:column;
        overflow-x:visible;
        padding:16px;
    }

    .nav a{
        width:100%;
    }

    .content{
        padding:20px;
    }
}

html, body{
    height:auto;
    min-height:100dvh;
}

.content{
    scroll-behavior:smooth;
}
