* { box-sizing: border-box; margin: 0; padding: 0; }
        body {
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
            background: #0f0f0f;
            color: #e0e0e0;
            line-height: 1.5;
            padding: 0 0 2rem 0;
        }
        a { color: #6cb4ee; text-decoration: none; }
        a:hover { text-decoration: underline; }

        .nav {
            background: #1a1a2e;
            border-bottom: 1px solid #333;
            padding: 0.75rem 1rem;
            display: flex;
            gap: 1.5rem;
            align-items: center;
            flex-wrap: wrap;
            position: sticky;
            top: 0;
            z-index: 100;
        }
        .nav .brand {
            font-weight: 700;
            font-size: 1.1rem;
            color: #fff;
            margin-right: auto;
        }
        .nav a { color: #aaa; font-size: 0.9rem; }
        .nav a:hover { color: #fff; text-decoration: none; }

        .container { max-width: 1200px; margin: 0 auto; padding: 1rem; }

        .stats {
            display: flex;
            gap: 1rem;
            margin-bottom: 1.5rem;
            flex-wrap: wrap;
        }
        .stat-card {
            background: #1a1a2e;
            border: 1px solid #333;
            border-radius: 8px;
            padding: 1rem 1.25rem;
            flex: 1;
            min-width: 140px;
        }
        .stat-card .label { font-size: 0.8rem; color: #888; text-transform: uppercase; }
        .stat-card .value { font-size: 1.8rem; font-weight: 700; color: #fff; }

        .btn {
            display: inline-block;
            padding: 0.5rem 1.25rem;
            border: none;
            border-radius: 6px;
            font-size: 0.9rem;
            cursor: pointer;
            text-decoration: none;
            font-weight: 500;
        }
        .btn:hover { text-decoration: none; opacity: 0.9; }
        .btn-primary { background: #2563eb; color: #fff; }
        .btn-danger { background: #dc2626; color: #fff; }
        .btn-sm { padding: 0.3rem 0.75rem; font-size: 0.8rem; }

        .form-group { margin-bottom: 1rem; }
        .form-group label { display: block; font-size: 0.85rem; color: #aaa; margin-bottom: 0.3rem; }
        .form-group input, .form-group select, .form-group textarea {
            width: 100%;
            padding: 0.6rem 0.8rem;
            background: #1a1a2e;
            border: 1px solid #333;
            border-radius: 6px;
            color: #e0e0e0;
            font-size: 1rem;
        }
        .form-group textarea { min-height: 80px; resize: vertical; }
        .form-row { display: flex; gap: 1rem; }
        .form-row .form-group { flex: 1; }

        .alert { padding: 0.75rem 1rem; border-radius: 6px; margin-bottom: 1rem; }
        .alert-error { background: #3a1a1a; border: 1px solid #dc2626; color: #f87171; }
        .alert-success { background: #1a3a1a; border: 1px solid #22c55e; color: #4ade80; }

        .page-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 1.5rem;
            flex-wrap: wrap;
            gap: 0.5rem;
        }
        .page-header h1 { font-size: 1.5rem; color: #fff; }

        .empty-state {
            text-align: center;
            padding: 3rem 1rem;
            color: #666;
        }
        .empty-state p { margin-bottom: 1rem; }

        @media (max-width: 480px) {
            .stat-card .value { font-size: 1.4rem; }
            .form-row { flex-direction: column; gap: 0; }
        }

        /* --- static-app additions --- */
        .view { display: none; }
        .view.active { display: block; }
        .loading { text-align: center; color: #888; padding: 2rem; }
        .nav a.active { color: #fff; }
        .badge { background:#2563eb; color:#fff; border-radius:10px; padding:0 .4rem; font-size:.75rem; }

/* ---- login gate (see auth.js) ---- */
.login-gate {
    position: fixed;
    inset: 0;
    background: var(--bg, #111);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}
.login-box {
    width: 100%;
    max-width: 22rem;
    display: flex;
    flex-direction: column;
    gap: .5rem;
}
.login-box h1 { margin: 0 0 .5rem; font-size: 1.25rem; }
.login-box label { font-size: .8rem; opacity: .75; }
.login-box input {
    padding: .6rem .7rem;
    font-size: 1rem; /* >=16px stops iOS zooming the page on focus */
    border-radius: .4rem;
    border: 1px solid rgba(128,128,128,.4);
    background: rgba(128,128,128,.08);
    color: inherit;
}
.login-box button {
    margin-top: .5rem;
    padding: .65rem;
    font-size: 1rem;
    border-radius: .4rem;
    cursor: pointer;
}
.login-box button[disabled] { opacity: .6; cursor: default; }
.login-error { color: #e5484d; min-height: 1.2em; margin: .25rem 0 0; font-size: .85rem; }

/* ---- pint tracker ---- */
.beer-card {
    background: #1a1a2e;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 0.75rem;
    margin-bottom: 0.6rem;
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
}
.beer-card .thumb {
    width: 84px;
    height: 84px;
    flex: 0 0 84px;
    object-fit: cover;
    border-radius: 6px;
    background: #111;
    cursor: zoom-in;
}
.beer-card .thumb-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    cursor: default;
}
.beer-body { flex: 1; min-width: 0; }
.beer-head { display: flex; align-items: baseline; gap: 0.6rem; flex-wrap: wrap; }
.beer-card .name { font-weight: 600; color: #fff; font-size: 1.05rem; }
.beer-card .meta { font-size: 0.85rem; color: #888; }
.beer-card .notes { font-size: 0.85rem; color: #aaa; margin-top: 0.3rem; word-wrap: break-word; }

.stars { color: #f0a92a; font-size: 0.9rem; letter-spacing: 1px; }
.stars .dim { color: #3a3a3a; }

.brand-row {
    background: #1a1a2e;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 0.7rem 1rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: inherit;
}
.brand-row:hover { text-decoration: none; border-color: #f0a92a; }
.brand-row .name { font-weight: 600; color: #fff; flex: 1; min-width: 0; }
.brand-row .count { color: #f0a92a; font-weight: 600; }
.brand-row .avg { color: #f0a92a; font-size: 0.85rem; min-width: 3.5rem; text-align: right; }
.brand-row .meta { font-size: 0.8rem; color: #777; min-width: 8rem; text-align: right; }

/* The upload preview is a local blob, so it can be any orientation/size. */
.photo-preview {
    margin-top: 0.6rem;
    max-width: 100%;
    max-height: 260px;
    border-radius: 6px;
    display: block;
}

.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 900;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    cursor: zoom-out;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 6px; }

@media (max-width: 480px) {
    .brand-row .meta { display: none; }
    .beer-card .thumb { width: 64px; height: 64px; flex-basis: 64px; }
}
