/* ============================================================
   BeanReview – Instagram-style feed
   ============================================================ */

:root {
    --br-bg-card: rgba(28, 20, 18, 0.92);
    --br-border: rgba(255, 255, 255, 0.09);
    --br-text: #f5ede6;
    --br-muted: #b9a79a;
    --br-accent: #d9925b;
    --br-accent-2: #f3c98b;
    --br-radius: 14px;
    --br-avatar-border: 1.5px solid #4a4340;   /* thin dark grey outline on every profile circle */
}

/* Self-contained sizing for everything in the feed (doesn't rely on Bootstrap's reset) */
.feed-page *, .feed-page *::before, .feed-page *::after {
    box-sizing: border-box;
}

/* ---------- App bar brand ---------- */
.brand {
    font-family: 'Fraunces', Georgia, serif;
    font-weight: 700;
    letter-spacing: -.01em;
    font-size: 1.45rem;
    line-height: 1;
    color: #fff !important;
    text-decoration: none !important;
    margin-left: .25rem;
    letter-spacing: .5px;
}

.appbar-link {
    color: rgba(255,255,255,.75) !important;
    text-transform: none !important;
    font-weight: 500 !important;
}

    .appbar-link.is-active {
        color: #fff !important;
        box-shadow: inset 0 -2px 0 var(--br-accent);
        border-radius: 0 !important;
    }

/* ---------- Drawer menu ---------- */
.mud-drawer.br-drawer {
    background: #1a1210 !important;
    color: var(--br-text) !important;
    border-right: 1px solid var(--br-border);
    box-shadow: 12px 0 40px rgba(0, 0, 0, .5);
}

.drawer {
    display: flex;
    flex-direction: column;
    height: 100%;
    box-sizing: border-box;
}

.drawer__head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 16px 18px;
    border-bottom: 1px solid var(--br-border);
    background:
        radial-gradient(circle at 0% 0%, hsl(28 65% 48% / .35), transparent 60%),
        linear-gradient(135deg, #2e1d19, #1a1210);
}

.drawer__logo {
    flex: 0 0 auto;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    box-sizing: border-box;
}

    .drawer__logo > span {
        display: grid;
        place-items: center;
        width: 100%;
        height: 100%;
        border-radius: 50%;
        background: #1c1412;
        border: var(--br-avatar-border);
        color: var(--br-accent-2);
    }

.drawer__brand {
    font-family: 'Fraunces', Georgia, serif;
    font-weight: 700;
    letter-spacing: -.01em;
    font-size: 1.45rem;
    line-height: 1;
    color: #fff;
}

.drawer__tagline {
    margin-top: 2px;
    font-size: .76rem;
    color: var(--br-muted);
}

.drawer__nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 10px;
    overflow-y: auto;
}

.drawer__section {
    padding: 14px 10px 6px;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--br-muted);
}

.drawer__link {
    display: flex;
    align-items: center;
    justify-content: flex-start !important;   /* the site's base button style centres content */
    gap: 14px;
    width: 100%;
    padding: 11px 12px;
    border: 0;
    border-radius: 10px;
    background: none;
    color: var(--br-text);
    font-size: .95rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
}

    .drawer__link .mud-icon-root {
        color: var(--br-muted);
    }

    .drawer__link:hover {
        background: rgba(255, 255, 255, .06);
    }

    .drawer__link.is-active {
        background: linear-gradient(90deg, rgba(217, 146, 91, .22), rgba(217, 146, 91, .06));
        box-shadow: inset 3px 0 0 var(--br-accent);
        font-weight: 700;
    }

        .drawer__link.is-active .mud-icon-root {
            color: var(--br-accent-2);
        }

.drawer__foot {
    padding: 12px 20px 16px;
    border-top: 1px solid var(--br-border);
    font-size: .74rem;
    color: var(--br-muted);
}

    .drawer__foot a {
        color: var(--br-accent-2);
    }

/* ---------- Page container ---------- */
.feed-page {
    max-width: 560px;
    margin: 0 auto;
    padding: 24px 12px 64px;
    color: var(--br-text);
}

.feed-page--wide {
    max-width: 935px;
}

/* ---------- Profile header ---------- */
.feed-profile {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 8px 4px 20px;
    max-width: 560px;
    margin: 0 auto;
}

.feed-profile__avatar {
    flex: 0 0 auto;
    width: 96px;
    height: 96px;
    border-radius: 50%;
}

    .feed-profile__avatar > span {
        display: grid;
        place-items: center;
        width: 100%;
        height: 100%;
        border-radius: 50%;
        background: #1c1412;
        border: var(--br-avatar-border);
    }

    .feed-profile__avatar .mud-icon-root {
        font-size: 2.6rem;
        color: var(--br-accent-2);
    }

.feed-profile__info {
    flex: 1;
    min-width: 0;
}

.feed-profile__top {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 16px;
}

    .feed-profile__top h1 {
        font-size: 1.5rem;
        font-weight: 600;
        margin: 0;
        text-shadow: 0 1px 8px rgba(0,0,0,.4);
    }

.feed-profile__add {
    border-radius: 999px !important;
    text-transform: none !important;
}

.feed-profile__stats {
    display: flex;
    gap: 20px;
    list-style: none;
    padding: 0;
    margin: 10px 0 4px;
    font-size: .95rem;
}

    .feed-profile__stats b {
        font-weight: 700;
    }

.feed-profile__tagline {
    margin: 0;
    color: var(--br-muted);
    font-size: .92rem;
}

/* ---------- Feed / grid tabs ---------- */
.feed-tabs {
    display: flex;
    justify-content: center;
    gap: 48px;
    border-top: 1px solid rgba(255,255,255,.18);
    margin: 0 auto 20px;
    max-width: 560px;
}

.feed-page--wide .feed-tabs {
    max-width: none;
}

.feed-tabs button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: 0;
    border-top: 1px solid transparent;
    margin-top: -1px;
    padding: 12px 2px;
    color: var(--br-muted);
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
}

    .feed-tabs button.is-active {
        color: var(--br-text);
        border-top-color: var(--br-text);
    }

/* ---------- Feed ---------- */
.feed {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.post {
    background: var(--br-bg-card);
    border: 1px solid var(--br-border);
    border-radius: var(--br-radius);
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,.35);
    backdrop-filter: blur(6px);
    animation: post-in .35s ease both;
}

@keyframes post-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
}

.post__header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
}

.post__avatar {
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    border-radius: 50%;
}

    .post__avatar > span {
        display: grid;
        place-items: center;
        width: 100%;
        height: 100%;
        border-radius: 50%;
        border: var(--br-avatar-border);
        background: hsl(var(--hue) 45% 38%);
        color: #fff;
        font-size: .8rem;
        font-weight: 700;
    }

.post__who {
    flex: 1;
    min-width: 0;
    line-height: 1.2;
}

.post__name {
    font-weight: 600;
    font-size: .92rem;
}

.post__sub {
    color: var(--br-muted);
    font-size: .78rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Beans next to the rating badge in the post header */
.post__header .tag--beans {
    flex: 0 0 auto;
    background: none;
    padding: 0;
}

.post__score {
    font-weight: 800;
    font-size: 1.05rem;
    color: #1c1412;
    background: linear-gradient(135deg, var(--br-accent-2), var(--br-accent));
    padding: 3px 10px;
    border-radius: 999px;
}

    .post__score small {
        font-weight: 600;
        font-size: .7rem;
        opacity: .7;
        margin-left: 1px;
    }

/* Photo */
.post__media {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    padding: 0;
    border: 0;
    background: #0e0a09;
    cursor: zoom-in;
    overflow: hidden;
}

    .post__media img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
        transition: transform .25s ease;
        user-select: none;
        -webkit-user-drag: none;
        -webkit-touch-callout: none;
    }

    /* Zoomed in on the spot that was tapped (see zoom.js) */
    /* Photos: one finger still scrolls the page, but two-finger pinches go to the photo (zoom.js) */
    .post__media:not(.post__media--text) {
        touch-action: pan-y;
    }

    .post__media.is-zoomed {
        cursor: zoom-out;
        touch-action: none;   /* so dragging a finger looks around instead of scrolling the page */
    }

    /* Follow the fingers exactly while pinching */
    .post__media.is-pinching img {
        transition: none;
    }

/* Whole photo, not cropped to a square (pop-up on the Photos tab) */
.post__media--full {
    aspect-ratio: auto;
}

    .post__media--full img {
        height: auto;
        max-height: 70vh;
        object-fit: contain;
    }

/* No photo: gradient "text post" */
.post__media--text {
    aspect-ratio: 3 / 1;
    cursor: default;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-align: center;
    padding: 16px;
    background:
        /* keep the per-reviewer tint in warm coffee tones (hue 15–55) */
        radial-gradient(circle at 20% 15%, hsl(calc(15 + var(--hue) / 9) 65% 48% / .55), transparent 55%),
        radial-gradient(circle at 85% 90%, hsl(calc(5 + var(--hue) / 12) 55% 30% / .65), transparent 60%),
        linear-gradient(135deg, #3b2420, #160e0c);
}

.post__media-icon {
    font-size: 2.6rem !important;
    color: var(--br-accent-2);
    opacity: .9;
}

.post__media-title {
    font-family: 'Fraunces', Georgia, serif;
    font-weight: 700;
    letter-spacing: -.01em;
    font-size: 1.7rem;
    line-height: 1.1;
    color: #fff;
    text-shadow: 0 2px 12px rgba(0,0,0,.5);
}

/* Body */
/* Place name on the left, likes on the right */
.post__headline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

    .post__headline > :first-child {
        min-width: 0;
    }

.post__actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 2px;
}

.post__like {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    margin: -4px -8px -4px 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: none;
    color: var(--br-text);
    cursor: pointer;
    transition: transform .15s ease;
}

    .post__like:hover {
        background: rgba(255, 255, 255, .06);
    }

    .post__like:active {
        transform: scale(.85);
    }

    .post__like .mud-icon-root {
        font-size: 1.7rem;
    }

    .post__like.is-liked {
        color: #fff;
        animation: like-pop .3s ease;
    }

@keyframes like-pop {
    50% { transform: scale(1.25); }
}

.post__likes {
    font-size: .9rem;
    font-weight: 700;
}

/* Newest / Most liked */
.feed-sort {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: -6px 0 18px;
}

    .feed-sort button {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        border: 1px solid rgba(255, 255, 255, .18);
        border-radius: 999px;
        padding: 5px 14px;
        background: rgba(28, 20, 18, .7);
        color: var(--br-text);
        font-size: .8rem;
        font-weight: 600;
        cursor: pointer;
    }

        .feed-sort button .mud-icon-root {
            font-size: 1rem;
            color: #fff;
        }

        .feed-sort button.is-on {
            background: linear-gradient(135deg, var(--br-accent-2), var(--br-accent));
            border-color: transparent;
            color: #1c1412;
        }

            .feed-sort button.is-on .mud-icon-root {
                color: #1c1412;
            }

@media (prefers-reduced-motion: reduce) {
    .post__like.is-liked { animation: none; }
}

.post__body {
    padding: 12px 14px 14px;
}

.post__title {
    font-weight: 700;
    font-size: 1.02rem;
}

/* Name + city under the photo. Name: tap for every review of it. City: tap for the map. */
.post__where {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    min-width: 0;
}

.post__link {
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    text-align: left;
    font: inherit;
    cursor: pointer;
}

    .post__link:hover {
        text-decoration: underline;
        text-decoration-color: var(--br-accent);
        text-underline-offset: 3px;
    }

.post__title.post__link {
    font-weight: 700;
    font-size: 1.02rem;
}

.post__place {
    display: inline-flex;
    align-items: center;
    color: var(--br-muted);
    font-size: .84rem;
}

.post__meter {
    height: 4px;
    border-radius: 999px;
    background: rgba(255,255,255,.1);
    margin: 8px 0 10px;
    overflow: hidden;
}

    .post__meter > span {
        display: block;
        height: 100%;
        border-radius: inherit;
        background: linear-gradient(90deg, #a3462a, var(--br-accent), var(--br-accent-2));
    }

.post__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: .76rem;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 999px;
    background: rgba(255,255,255,.08);
    color: var(--br-text);
}

    .tag .mud-icon-root {
        font-size: 1rem;
        color: var(--br-muted);
    }

.tag--beans {
    gap: 0;
    padding: 2px 6px;
}

    .tag--beans .bean {
        color: rgba(255,255,255,.25);
    }

    .tag--beans .bean--on {
        color: var(--br-accent-2);
    }

.tag--light { background: #c9955c; color: #1c1412; }
.tag--medium { background: #8a5432; color: #fff; }
.tag--dark { background: #3a1f14; color: #f3c98b; border: 1px solid rgba(243,201,139,.3); }

.post__caption {
    margin: 0 0 6px;
    font-size: .92rem;
    line-height: 1.4;
    white-space: pre-line;
    word-break: break-word;
}

    .post__caption b {
        font-weight: 700;
        margin-right: 4px;
    }

/* Date, and the poster's own "Edit" link while it's allowed */
.post__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.post__edit {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border: 1px solid rgba(243, 201, 139, .35);
    border-radius: 999px;
    background: rgba(243, 201, 139, .08);
    color: var(--br-accent-2);
    font-size: .74rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

    .post__edit .mud-icon-root {
        font-size: .95rem;
    }

    .post__edit:hover {
        background: rgba(243, 201, 139, .16);
    }

.post__time {
    display: block;
    color: var(--br-muted);
    font-size: .6rem;
    letter-spacing: .6px;
    text-transform: uppercase;
}

/* ---------- Photo grid ---------- */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
}

.photo-grid__tile {
    position: relative;
    aspect-ratio: 1 / 1;
    padding: 0;
    border: 0;
    overflow: hidden;
    background: #0e0a09;
    cursor: zoom-in;
}

    .photo-grid__tile img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

.photo-grid__overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px;
    background: rgba(0,0,0,.45);
    color: #fff;
    opacity: 0;
    transition: opacity .2s ease;
}

.photo-grid__tile:hover .photo-grid__overlay,
.photo-grid__tile:focus-visible .photo-grid__overlay {
    opacity: 1;
}

.photo-grid__score {
    font-size: 1.6rem;
    font-weight: 800;
}

.photo-grid__title {
    font-size: .85rem;
    font-weight: 600;
    text-align: center;
}

/* ---------- Empty state ---------- */
.feed-empty {
    text-align: center;
    padding: 48px 16px;
    color: var(--br-muted);
    background: var(--br-bg-card);
    border: 1px solid var(--br-border);
    border-radius: var(--br-radius);
}

    .feed-empty .mud-icon-root {
        font-size: 3rem;
        color: var(--br-accent-2);
    }

    .feed-empty p {
        margin: 8px 0 0;
    }

/* ---------- About ---------- */
.about-card {
    background: var(--br-bg-card);
    border: 1px solid var(--br-border);
    border-radius: var(--br-radius);
    padding: 24px;
    color: var(--br-text);
    line-height: 1.6;
}

    .about-card h1 {
        font-family: 'Fraunces', Georgia, serif;
    font-weight: 700;
    letter-spacing: -.01em;
        font-size: 2rem;
                margin: 0 0 8px;
    }

    .about-card a {
        color: var(--br-accent-2);
        font-weight: 600;
    }

    .about-card__fine {
        margin: 16px 0 0;
        padding-top: 12px;
        border-top: 1px solid var(--br-border);
        font-size: .78rem;
        color: var(--br-muted);
    }

/* ---------- Search tab ---------- */
.br-dark-inputs {
    --mud-palette-surface: #1c1412;
    --mud-palette-text-primary: #f5ede6;
    --mud-palette-text-secondary: #b9a79a;
    --mud-palette-action-default: #b9a79a;
    --mud-palette-lines-default: rgba(255, 255, 255, .12);
    --mud-palette-lines-inputs: rgba(255, 255, 255, .28);
    --mud-palette-primary: #e0935a;
    --mud-palette-primary-rgb: 224, 147, 90;
    --mud-palette-primary-text: #1c1412;
    --mud-palette-primary-hover: rgba(224, 147, 90, .12);
}

.search {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
}

.search__box {
    flex: 1 1 260px;
    margin: 0 !important;
    background: rgba(28, 20, 18, .85);
    border-radius: 4px;
}

.search__map {
    flex: 0 0 auto;
    border-radius: 999px !important;
    text-transform: none !important;
    background: rgba(28, 20, 18, .85) !important;
}

.search__count {
    margin: 0 0 10px;
    color: var(--br-muted);
    font-size: .85rem;
}

.search__hint p {
    max-width: 320px;
    margin-left: auto;
    margin-right: auto;
}

/* All-reviews map */
.allmap {
    height: min(70vh, 560px);
}

.allmap-pop b {
    display: block;
    font-size: .95rem;
}

.allmap-pop div {
    font-size: .82rem;
    color: #555;
}

.allmap-key {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--br-muted);
    font-size: .78rem;
    white-space: nowrap;
}

.allmap-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid #1c1412;
    background: #e0935a;
    margin-left: 6px;
}

.allmap-dot--city {
    background: #b9a79a;
}

@media (max-width: 600px) {
    .search {
        padding: 0 10px;
    }

    .search__map {
        width: 100%;
    }
}

/* ---------- Edit mode in the post dialogs ---------- */
.np-photo-actions {
    display: flex;
    justify-content: flex-end;
    padding: 8px 16px 0;
}

.np-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 0;
    border: 0;
    background: none;
    color: var(--br-accent-2);
    font-size: .82rem;
    font-weight: 600;
    cursor: pointer;
}

    .np-link:hover {
        text-decoration: underline;
    }

.np-edit-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--br-border);
}

.np-delete {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border: 1px solid rgba(229, 83, 61, .45);
    border-radius: 999px;
    background: rgba(229, 83, 61, .1);
    color: #ff9b8a;
    font-size: .82rem;
    font-weight: 600;
    cursor: pointer;
}

    .np-delete:hover:not(:disabled) {
        background: rgba(229, 83, 61, .2);
    }

    .np-delete.is-armed {
        background: #c8402b;
        border-color: #c8402b;
        color: #fff;
    }

    .np-delete:disabled {
        opacity: .5;
        cursor: default;
    }

/* ---------- Search: matching names, and one picked name ---------- */
.name-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: -4px 0 16px;
}

    .name-chips .np-chip {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        background: rgba(28, 20, 18, .85);
    }

.name-chips__count {
    min-width: 18px;
    padding: 0 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .12);
    font-size: .72rem;
    text-align: center;
}

.name-summary {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: -4px 0 18px;
    padding: 12px 14px;
    border: 1px solid var(--br-border);
    border-radius: var(--br-radius);
    background: var(--br-bg-card);
    color: var(--br-text);
}

.name-summary__icon {
    flex: 0 0 auto;
    color: var(--br-accent-2);
}

.name-summary__text {
    flex: 1;
    min-width: 0;
}

.name-summary__title {
    font-family: 'Fraunces', Georgia, serif;
    font-weight: 700;
    font-size: 1.2rem;
    line-height: 1.2;
}

.name-summary__meta {
    color: var(--br-muted);
    font-size: .84rem;
}

.name-summary__back {
    flex: 0 0 auto;
}

@media (max-width: 600px) {
    .name-chips, .name-summary {
        margin-left: 10px;
        margin-right: 10px;
    }
}

/* ---------- Small screens ---------- */
@media (max-width: 600px) {
    .feed-page {
        padding: 12px 0 48px;
    }

    .feed-profile {
        gap: 16px;
        padding: 8px 14px 16px;
    }

    .feed-profile__avatar {
        width: 72px;
        height: 72px;
    }

        .feed-profile__avatar .mud-icon-root {
            font-size: 2rem;
        }

    .feed-profile__stats {
        gap: 14px;
        font-size: .85rem;
    }

    /* A little breathing room either side of the posts */
    .feed {
        gap: 28px;
        padding: 0 10px;
    }

    .photo-grid {
        gap: 2px;
    }

    .feed-empty, .about-card {
        margin: 0 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .post { animation: none; }
    .post__media img { transition: none; }
}

/* ============================================================
   "New post" dialog (both review types) – the .np classes
   ============================================================ */

/* Re-colour the MudBlazor dialog, and the inputs inside it, to match the dark feed */
.mud-dialog:has(.np),
.np-popover {
    --mud-palette-surface: #1c1412;
    --mud-palette-background: #1c1412;
    --mud-palette-text-primary: #f5ede6;
    --mud-palette-text-secondary: #b9a79a;
    --mud-palette-text-disabled: rgba(245, 237, 230, .38);
    --mud-palette-action-default: #b9a79a;
    --mud-palette-action-default-hover: rgba(255, 255, 255, .06);
    --mud-palette-action-disabled: rgba(245, 237, 230, .3);
    --mud-palette-action-disabled-background: rgba(255, 255, 255, .08);
    --mud-palette-lines-default: rgba(255, 255, 255, .12);
    --mud-palette-lines-inputs: rgba(255, 255, 255, .28);
    --mud-palette-divider: rgba(255, 255, 255, .1);
    --mud-palette-primary: #e0935a;
    --mud-palette-primary-rgb: 224, 147, 90;
    --mud-palette-primary-text: #1c1412;
    --mud-palette-primary-hover: rgba(224, 147, 90, .12);
    background-color: #1c1412 !important;
    color: #f5ede6 !important;
}

.mud-dialog:has(.np) {
    border: 1px solid var(--br-border);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .6);
}

    /* Our own top bar replaces MudBlazor's title row */
    .mud-dialog:has(.np) .mud-dialog-title {
        display: none;
    }

    .mud-dialog:has(.np) .mud-dialog-content {
        padding: 0 !important;
        margin: 0 !important;
    }

.np-popover {
    border: 1px solid var(--br-border);
}

.np, .np *, .np *::before, .np *::after {
    box-sizing: border-box;
}

.np {
    color: var(--br-text);
}

/* Top bar: Cancel | title | Share (stays put while the form scrolls) */
.np__bar {
    position: sticky;
    top: 0;
    z-index: 5;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 8px;
    background: #1c1412;
    border-bottom: 1px solid var(--br-border);
}

    .np__bar h2 {
        margin: 0;
        font-size: 1rem;
        font-weight: 700;
        text-align: center;
    }

.np__bar-btn {
    justify-self: start;
    background: none;
    border: 0;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: .92rem;
    color: var(--br-text);
    cursor: pointer;
}

    .np__bar-btn:hover:not(:disabled) {
        background: rgba(255, 255, 255, .07);
    }

    .np__bar-btn:disabled {
        opacity: .4;
        cursor: default;
    }

.np__bar-btn--share {
    justify-self: end;
    font-weight: 700;
    color: var(--br-accent-2);
}

/* Photo area */
.np-upload,
.np-upload > div,
.np-upload .mud-input-control,
.np-upload .mud-input-control-input-container {
    display: block;
    width: 100%;
    margin: 0 !important;
    padding: 0 !important;
}

.np-photo {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    aspect-ratio: 16 / 10;
    padding: 24px;
    border: 0;
    overflow: hidden;
    cursor: pointer;
    color: var(--br-text);
    text-align: center;
    background:
        radial-gradient(circle at 20% 15%, hsl(28 65% 48% / .45), transparent 55%),
        radial-gradient(circle at 85% 90%, hsl(12 55% 30% / .6), transparent 60%),
        linear-gradient(135deg, #3b2420, #160e0c);
}

    .np-photo:disabled {
        cursor: progress;
    }

.np-photo--filled {
    aspect-ratio: 1 / 1;
    max-height: 46vh;
    padding: 0;
    background: #0e0a09;
}

.np-photo img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.np-photo__icon {
    font-size: 2.8rem !important;
    color: var(--br-accent-2);
}

.np-photo__title {
    font-family: 'Fraunces', Georgia, serif;
    font-weight: 700;
    letter-spacing: -.01em;
    font-size: 1.5rem;
    line-height: 1.1;
}

.np-photo__hint {
    max-width: 280px;
    font-size: .8rem;
    color: var(--br-muted);
}

.np-photo__change {
    position: absolute;
    right: 10px;
    bottom: 10px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(0, 0, 0, .6);
    backdrop-filter: blur(4px);
    color: #fff;
    font-size: .8rem;
    font-weight: 600;
}

.np-photo__busy {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: rgba(0, 0, 0, .6);
    color: #fff;
    font-weight: 600;
}

/* Form */
.np__body {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 16px;
}

.np-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.np-avatar {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

    .np-avatar > span {
        display: grid;
        place-items: center;
        width: 100%;
        height: 100%;
        border-radius: 50%;
        border: var(--br-avatar-border);
        background: #8a5432;
        color: #fff;
        font-size: .8rem;
        font-weight: 700;
    }

.np-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.np-label {
    font-size: .9rem;
    font-weight: 600;
}

.np-hint {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .78rem;
    color: var(--br-muted);
}

.np-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
}

.np-line .np-chips {
    margin-top: 0;
}

.np-chip {
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 999px;
    padding: 5px 12px;
    background: rgba(255, 255, 255, .06);
    color: var(--br-text);
    font-size: .8rem;
    font-weight: 600;
    cursor: pointer;
}

    .np-chip:hover {
        background: rgba(255, 255, 255, .12);
    }

    .np-chip.is-on {
        background: linear-gradient(135deg, var(--br-accent-2), var(--br-accent));
        border-color: transparent;
        color: #1c1412;
    }

    /* Roast choices use the same colours as the roast tags on the posts */
    .np-chip--light.is-on { background: #c9955c; color: #1c1412; }
    .np-chip--medium.is-on { background: #8a5432; color: #fff; }
    .np-chip--dark.is-on { background: #3a1f14; color: #f3c98b; border-color: rgba(243, 201, 139, .5); }

.np-alert {
    margin: 12px 16px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(243, 201, 139, .12);
    border: 1px solid rgba(243, 201, 139, .3);
    color: var(--br-accent-2);
    font-size: .88rem;
}

.np__body .np-alert {
    margin: 0;
}

.np-alert--error {
    background: rgba(229, 83, 61, .14);
    border-color: rgba(229, 83, 61, .4);
    color: #ff9b8a;
}

/* Phones: use nearly the whole screen width */
@media (max-width: 600px) {
    .mud-dialog:has(.np) {
        width: calc(100% - 16px) !important;
        max-width: none !important;
        max-height: calc(100% - 16px) !important;
        margin: 8px !important;
    }
}

/* ---------- Map dialog ---------- */
.mapdlg__frame {
    display: block;
    width: 100%;
    height: min(60vh, 460px);
    border: 0;
    background: #2a211e;
}

.mapdlg__msg {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 180px;
    padding: 24px;
    color: var(--br-muted);
    text-align: center;
}

.mapdlg__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    font-size: .86rem;
}

    .mapdlg__foot span {
        display: inline-flex;
        align-items: center;
        gap: 4px;
    }

    .mapdlg__foot a {
        color: var(--br-accent-2);
        font-weight: 600;
        white-space: nowrap;
    }

/* ---------- Post pop-up (Photos tab) ---------- */
.postdlg .post {
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: none;
    backdrop-filter: none;
    animation: none;
}

/* Close button: top-left on desktop, bottom-right (thumb reach) on phones */
.postdlg__foot {
    display: none;
}

@media (max-width: 600px) {
    .postdlg .np__bar-btn {
        visibility: hidden;
    }

    .postdlg__foot {
        position: sticky;
        bottom: 0;
        z-index: 5;
        display: flex;
        justify-content: flex-end !important;
        padding: 10px 12px;
        background: #1c1412;
        border-top: 1px solid var(--br-border);
    }

    .postdlg__close {
        border: 0;
        border-radius: 999px;
        padding: 10px 26px;
        background: linear-gradient(135deg, var(--br-accent-2), var(--br-accent));
        color: #1c1412;
        font-size: .95rem;
        font-weight: 700;
        cursor: pointer;
    }
}
