:root {
    font-family: 'Segoe UI', system-ui, sans-serif;
    color-scheme: light;
    --bg: #f5f7fb;
    --text: #111;
    --accent: #005bbb;
    --accent-contrast: #fff;
    --card-bg: #fff;
    --border: #cfd8e3;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    display: flex;
    flex-direction: column;
    font-size: 1.1rem;
}

.app-header,
.app-footer {
    background: var(--card-bg);
    border-bottom: 4px solid var(--accent);
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.app-footer {
    border-top: 4px solid var(--accent);
    border-bottom: none;
    margin-top: auto;
}

.app-nav {
    display: flex;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: #e8edf6;
    font-size: 1.25rem;
}

.app-nav a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}

.app-nav a:hover,
.app-nav a:focus {
    text-decoration: underline;
}

.desktop-only {
    display: none;
}

.app-main {
    flex: 1;
    padding: 2rem;
    display: flex;
    justify-content: center;
}

.card {
    width: min(640px, 100%);
    background: var(--card-bg);
    border-radius: 12px;
    border: 3px solid var(--border);
    padding: 2rem;
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
}

.stack {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

label {
    font-size: 1.1rem;
    font-weight: 600;
}

input,
button {
    font-size: 1.3rem;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    border: 2px solid var(--border);
}

input:focus,
button:focus {
    outline: 3px solid var(--accent);
}

button {
    background: var(--accent);
    color: var(--accent-contrast);
    border-color: var(--accent);
    font-weight: 700;
}

.alert {
    background: #ffe4d1;
    color: #7a1c00;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 2px solid #ffae80;
}

.alert:empty {
    display: none;
}

.alert.error {
    background: #ffd1d1;
    border-color: #ff7a7a;
    color: #7a0000;
}

.steps {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.step {
    padding: 0.75rem 1rem;
    background: #eef2ff;
    border: 2px solid var(--border);
    border-radius: 10px;
    text-align: center;
    font-weight: 700;
}

.step.active {
    border-color: var(--accent);
    background: #dfe9ff;
    color: var(--accent);
}

.muted {
    color: #555;
    margin-bottom: 1rem;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
}

.form-field small {
    font-weight: 400;
    color: #555;
}

.actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.5rem;
}

.table th,
.table td {
    border: 1px solid var(--border);
    padding: 0.75rem;
    text-align: left;
}

.table th { 
    background: #e8edf6;
}

.table tr:nth-child(even) td {
    background: #f5f7fb;
}

.table-wrapper {
    overflow-x: auto;
}

.badge {
    background: #0f172a;
    color: #f8fafc;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.95rem;
}

.checkbox {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 700;
}

.crossed {
    text-decoration: line-through;
    color: #4b5563;
    opacity: 0.75;
}

.price-cell input,
.item-location,
.item-pounds,
.item-price,
.item-store {
    width: 100%;
}

#shopping-list-status {
    margin-top: 0.5rem;
    font-weight: 700;
    color: var(--accent);
}

.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.tile {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1.5rem;
    background: #e2ecff;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 700;
    color: var(--accent);
    font-size: 1.3rem;
}

.user-info {
    display: flex;
    gap: 1rem;
    align-items: center;
    font-size: 1.1rem;
}

@media (max-width: 600px) {
    body {
        font-size: 1rem;
    }
    .app-nav {
        flex-wrap: wrap;
    }
}

@media (min-width: 601px) {
    .desktop-only {
        display: inline-block;
    }
}
