:root {
    --am-primary: #12664f;
    --am-primary-dark: #0a4033;
    --am-accent: #e9b949;
    --am-bg: #f8f9f6;
    --am-surface: #ffffff;
    --am-text: #17201c;
    --am-muted: #6d7772;
    --am-border: #e4e9e5;
    --am-danger: #c63d3d;
    --am-success: #188a63;
    --am-shadow: 0 10px 30px rgba(18, 102, 79, .08);
    --am-radius-sm: 10px;
    --am-radius: 16px;
    --am-radius-lg: 24px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body.am-body {
    margin: 0;
    color: var(--am-text);
    background: var(--am-bg);
    font-family: "Segoe UI", Inter, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
img { max-width: 100%; }

.am-container {
    width: min(100% - 28px, 1240px);
    margin-inline: auto;
}

.am-topbar {
    background: var(--am-primary-dark);
    color: #fff;
    font-size: .82rem;
    padding: 8px 0;
}

.am-header {
    position: sticky;
    top: 0;
    z-index: 1030;
    background: rgba(255,255,255,.96);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--am-border);
}

.am-header-row {
    min-height: 74px;
    display: grid;
    grid-template-columns: auto minmax(260px, 1fr) auto;
    gap: 24px;
    align-items: center;
}

.am-brand {
    display: inline-flex;
    gap: 10px;
    align-items: center;
    text-decoration: none;
    font-weight: 800;
    letter-spacing: -.03em;
}

.am-brand-mark {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    color: #fff;
    background: var(--am-primary);
    position: relative;
    font-weight: 900;
}

.am-brand-mark::after {
    content: "";
    position: absolute;
    width: 22px;
    height: 3px;
    bottom: 7px;
    border-radius: 99px;
    background: var(--am-accent);
}

.am-search {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f3f6f3;
    border: 1px solid var(--am-border);
    border-radius: 999px;
    padding: 10px 16px;
}

.am-search input {
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--am-text);
}

.am-header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.am-icon-button, .am-button {
    border: 1px solid var(--am-border);
    background: var(--am-surface);
    color: var(--am-text);
    border-radius: 12px;
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    font-weight: 700;
    padding: 0 14px;
}

.am-icon-button { width: 42px; padding: 0; }

.am-button-primary {
    background: var(--am-primary);
    color: #fff;
    border-color: var(--am-primary);
}

.am-button-accent {
    background: var(--am-accent);
    color: #2d2716;
    border-color: var(--am-accent);
}

.am-category-strip {
    background: #fff;
    border-bottom: 1px solid var(--am-border);
    overflow-x: auto;
    scrollbar-width: none;
}

.am-category-strip::-webkit-scrollbar { display: none; }

.am-category-links {
    min-height: 48px;
    display: flex;
    align-items: center;
    gap: 26px;
    white-space: nowrap;
}

.am-category-links a {
    text-decoration: none;
    font-size: .92rem;
    color: #43524b;
    font-weight: 600;
}

.am-category-links a:first-child { color: var(--am-primary); }

.am-main { padding-bottom: 90px; }

.am-hero {
    padding: 34px 0 14px;
}

.am-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(260px, .75fr);
    gap: 20px;
}

.am-hero-primary {
    min-height: 365px;
    border-radius: var(--am-radius-lg);
    padding: clamp(28px, 5vw, 58px);
    color: #fff;
    background:
        radial-gradient(circle at 88% 18%, rgba(233,185,73,.35), transparent 23%),
        linear-gradient(135deg, #0a4033, #12664f 62%, #1b7a61);
    box-shadow: var(--am-shadow);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.am-kicker {
    color: var(--am-accent);
    text-transform: uppercase;
    letter-spacing: .12em;
    font-size: .75rem;
    font-weight: 800;
}

.am-hero h1 {
    max-width: 720px;
    margin: 10px 0 14px;
    font-size: clamp(2rem, 5vw, 4.25rem);
    line-height: .98;
    letter-spacing: -.055em;
}

.am-hero p {
    max-width: 650px;
    color: rgba(255,255,255,.84);
    font-size: 1rem;
}

.am-hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }

.am-hero-side {
    display: grid;
    gap: 20px;
}

.am-promo-card {
    min-height: 172px;
    border-radius: var(--am-radius);
    background: #fff;
    border: 1px solid var(--am-border);
    padding: 24px;
    box-shadow: var(--am-shadow);
}

.am-promo-card.gold {
    background: #fff8df;
    border-color: #f3df9f;
}

.am-section { padding: 26px 0; }

.am-section-heading {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: end;
    margin-bottom: 18px;
}

.am-section-heading h2 {
    margin: 0;
    font-size: clamp(1.4rem, 3vw, 2rem);
    letter-spacing: -.035em;
}

.am-section-heading p {
    margin: 5px 0 0;
    color: var(--am-muted);
}

.am-category-grid {
    display: grid;
    grid-template-columns: repeat(8, minmax(0,1fr));
    gap: 12px;
}

.am-category-card {
    min-height: 126px;
    background: #fff;
    border: 1px solid var(--am-border);
    border-radius: var(--am-radius);
    text-decoration: none;
    text-align: center;
    padding: 18px 10px;
    transition: transform .18s ease, box-shadow .18s ease;
}

.am-category-card:hover { transform: translateY(-3px); box-shadow: var(--am-shadow); }

.am-category-icon {
    width: 50px;
    height: 50px;
    margin: 0 auto 12px;
    border-radius: 15px;
    display: grid;
    place-items: center;
    color: var(--am-primary);
    background: #edf6f2;
    font-size: 1.4rem;
}

.am-product-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0,1fr));
    gap: 16px;
}

.am-product-card {
    overflow: hidden;
    border-radius: var(--am-radius);
    border: 1px solid var(--am-border);
    background: #fff;
    box-shadow: 0 8px 22px rgba(0,0,0,.035);
}

.am-product-image {
    aspect-ratio: 1.1/1;
    display: grid;
    place-items: center;
    color: #789188;
    background:
        radial-gradient(circle at 50% 35%, #ffffff 0 12%, transparent 13%),
        linear-gradient(135deg, #edf6f2, #f8f3dd);
    font-size: 2.4rem;
}

.am-product-body { padding: 15px; }

.am-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border-radius: 999px;
    padding: 5px 9px;
    font-size: .72rem;
    font-weight: 800;
    background: #edf6f2;
    color: var(--am-primary);
}

.am-product-title {
    margin: 10px 0 6px;
    font-weight: 750;
    line-height: 1.35;
}

.am-price { font-size: 1.08rem; font-weight: 850; }
.am-meta { color: var(--am-muted); font-size: .82rem; margin-top: 8px; }

.am-dashboard-shell {
    display: grid;
    grid-template-columns: 250px minmax(0,1fr);
    min-height: calc(100vh - 74px);
}

.am-sidebar {
    padding: 24px 16px;
    background: #fff;
    border-right: 1px solid var(--am-border);
}

.am-sidebar-title { font-weight: 900; margin: 0 10px 16px; }

.am-sidebar nav { display: grid; gap: 4px; }

.am-sidebar a {
    display: flex;
    align-items: center;
    gap: 11px;
    text-decoration: none;
    border-radius: 11px;
    padding: 11px 12px;
    color: #495650;
    font-weight: 650;
}

.am-sidebar a.active,
.am-sidebar a:hover {
    background: #edf6f2;
    color: var(--am-primary);
}

.am-dashboard-content { padding: 28px; min-width: 0; }

.am-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0,1fr));
    gap: 14px;
}

.am-stat {
    background: #fff;
    border: 1px solid var(--am-border);
    border-radius: var(--am-radius);
    padding: 20px;
}

.am-stat strong {
    display: block;
    font-size: 1.55rem;
    margin-top: 7px;
}

.am-panel {
    background: #fff;
    border: 1px solid var(--am-border);
    border-radius: var(--am-radius);
    padding: 22px;
    margin-top: 18px;
}

.am-footer {
    background: #0d261f;
    color: rgba(255,255,255,.76);
    padding: 50px 0 110px;
}

.am-footer-grid {
    display: grid;
    grid-template-columns: 1.4fr repeat(3, 1fr);
    gap: 30px;
}

.am-footer h4 { color: #fff; }
.am-footer a { color: inherit; text-decoration: none; display: block; margin: 8px 0; }

.am-mobile-nav {
    display: none;
    position: fixed;
    z-index: 1050;
    left: 10px;
    right: 10px;
    bottom: 10px;
    background: rgba(255,255,255,.97);
    border: 1px solid var(--am-border);
    box-shadow: 0 12px 40px rgba(0,0,0,.16);
    border-radius: 18px;
    padding: 8px;
    grid-template-columns: repeat(5,1fr);
}

.am-mobile-nav a {
    display: grid;
    place-items: center;
    gap: 2px;
    text-decoration: none;
    color: #69746f;
    font-size: .68rem;
    font-weight: 700;
}

.am-mobile-nav i { font-size: 1.3rem; }
.am-mobile-nav a.active { color: var(--am-primary); }

@media (max-width: 1040px) {
    .am-category-grid { grid-template-columns: repeat(4,1fr); }
    .am-product-grid { grid-template-columns: repeat(3,1fr); }
    .am-stat-grid { grid-template-columns: repeat(2,1fr); }
}

@media (max-width: 820px) {
    .am-topbar, .am-category-strip { display: none; }
    .am-header-row { min-height: 64px; grid-template-columns: 1fr auto; gap: 10px; }
    .am-search { grid-column: 1 / -1; grid-row: 2; margin-bottom: 12px; }
    .am-header-actions .am-account-label { display: none; }
    .am-hero { padding-top: 16px; }
    .am-hero-grid { grid-template-columns: 1fr; }
    .am-hero-side { grid-template-columns: 1fr 1fr; }
    .am-dashboard-shell { grid-template-columns: 1fr; }
    .am-sidebar { display: none; }
    .am-dashboard-content { padding: 18px 14px 90px; }
    .am-footer-grid { grid-template-columns: 1fr 1fr; }
    .am-mobile-nav { display: grid; }
}

@media (max-width: 620px) {
    .am-container { width: min(100% - 20px, 1240px); }
    .am-header-actions .am-button { display: none; }
    .am-hero-primary { min-height: 330px; padding: 28px 22px; }
    .am-hero-side { grid-template-columns: 1fr; }
    .am-category-grid { grid-template-columns: repeat(4,1fr); gap: 8px; }
    .am-category-card { min-height: 102px; border-radius: 13px; padding: 13px 6px; font-size: .76rem; }
    .am-category-icon { width: 42px; height: 42px; margin-bottom: 8px; }
    .am-product-grid { grid-template-columns: repeat(2,1fr); gap: 10px; }
    .am-product-body { padding: 12px; }
    .am-stat-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .am-stat { padding: 15px; }
    .am-footer-grid { grid-template-columns: 1fr; }
}
/* Official Abuja Marketplace logo */
.am-official-logo {
    width: 72px;
    height: 72px;
    display: block;
    object-fit: contain;
    flex: 0 0 auto;
}

.amp-official-logo {
    width: 72px;
    height: 72px;
    display: block;
    object-fit: contain;
}

@media (max-width: 620px) {
    .am-official-logo {
        width: 58px;
        height: 58px;
    }

    .amp-official-logo {
        width: 56px;
        height: 56px;
    }
}


/* ==========================================================
   Mobile Messages Inbox
   ========================================================== */

.am-messaging-page {
    background: #fff;
}

.am-messaging-page .am-main {
    padding-bottom: 100px;
}


/* Compact messaging header */

.am-messages-header {
    background: #fff;
    border-bottom: 0;
}

.am-messages-header .am-header-row {
    grid-template-columns:
        minmax(0, 1fr) auto;

    min-height: 82px;
}

.am-messages-header .am-brand {
    min-width: 0;
}

.am-messages-header .am-header-actions {
    flex-wrap: nowrap;
}


/* Inbox */

.am-message-inbox {
    padding: 8px 0 50px;
}

.am-message-container {
    width: min(
        100% - 32px,
        920px
    );

    margin: 0 auto;
}

.am-message-page-head {
    padding: 8px 0 15px;
}

.am-message-page-head h1 {
    margin: 0;

    color: #07583f;

    font-size: clamp(
        2rem,
        5vw,
        2.75rem
    );

    font-weight: 850;
    letter-spacing: -.04em;
}


/* Search */

.am-conversation-search {
    width: 100%;
    min-height: 58px;

    padding: 0 18px;

    display: flex;
    align-items: center;

    gap: 12px;

    border: 1px solid #dce3df;
    border-radius: 999px;

    background: #fafcfb;
}

.am-conversation-search i {
    flex: 0 0 auto;

    color: #18241f;
    font-size: 1.35rem;
}

.am-conversation-search input {
    width: 100%;

    border: 0;
    outline: 0;

    background: transparent;

    color: #1d2924;

    font-size: 1rem;
}

.am-conversation-search input::placeholder {
    color: #7f8985;
}


/* Conversation list */

.am-inbox-list {
    margin-top: 15px;

    border-top: 1px solid #e6ebe8;
}

.am-inbox-row {
    position: relative;

    min-height: 102px;

    padding: 15px 4px;

    display: grid;
    grid-template-columns:
        58px minmax(0, 1fr);

    align-items: center;

    gap: 14px;

    border-bottom:
        1px solid #e6ebe8;

    color: inherit;
    text-decoration: none;
}

.am-inbox-row:hover {
    background: #f8fbf9;
}


/* Avatar */

.am-inbox-avatar {
    width: 58px;
    height: 58px;

    overflow: hidden;

    display: grid;
    place-items: center;

    border-radius: 50%;

    background: #e4f2ec;
    color: #076046;

    font-size: 1.25rem;
    font-weight: 850;
}

.am-inbox-avatar img {
    width: 100%;
    height: 100%;

    display: block;

    object-fit: cover;
}


/* Text */

.am-inbox-main {
    min-width: 0;

    padding-right: 6px;
}

.am-inbox-name-line {
    min-width: 0;

    display: flex;
    align-items: baseline;
    justify-content: space-between;

    gap: 10px;
}

.am-inbox-name-line strong {
    min-width: 0;

    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;

    color: #151b18;

    font-size: 1rem;
    font-weight: 850;
}

.am-inbox-name-line time {
    flex: 0 0 auto;

    color: #78837f;

    font-size: .78rem;
}

.am-inbox-context,
.am-inbox-preview {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.am-inbox-context {
    margin-top: 2px;

    color: #77817e;

    font-size: .82rem;
}

.am-inbox-preview {
    margin-top: 3px;

    color: #6e7975;

    font-size: .84rem;
}


/* Unread bubble */

.am-inbox-unread {
    position: absolute;

    right: 4px;
    bottom: 16px;

    min-width: 27px;
    height: 27px;

    padding: 0 7px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 999px;

    background: #087557;
    color: #fff;

    font-size: .75rem;
    font-weight: 800;
}


/* Empty state */

.am-inbox-empty {
    padding: 70px 20px;

    text-align: center;
}

.am-inbox-empty > i {
    color: #75827d;

    font-size: 2.5rem;
}

.am-inbox-empty h3 {
    margin: 12px 0 5px;
}

.am-inbox-empty p {
    margin: 0;

    color: #77817e;
}


/* Pagination */

.am-inbox-pagination {
    margin-top: 18px;
}


/* Bottom nav must not cover inbox */

.am-messaging-page .am-mobile-nav {
    z-index: 1050;
}


/* ==========================================================
   Mobile
   ========================================================== */

@media (max-width: 620px) {

    .am-messages-header .am-header-row {
        min-height: 75px;

        padding-left: 14px;
        padding-right: 14px;

        gap: 7px;
    }

    .am-messages-header .am-official-logo {
        width: 74px;
        height: 74px;
    }

    .am-messages-header .am-header-actions {
        gap: 6px;
    }

    .am-messages-header .am-icon-button {
        width: 43px;
        min-width: 43px;

        height: 43px;
        min-height: 43px;

        border-radius: 12px;
    }

    .am-message-container {
        width: 100%;
    }

    .am-message-page-head {
        padding:
            10px 20px 14px;
    }

    .am-message-page-head h1 {
        font-size: 2rem;
    }

    .am-conversation-search {
        width:
            calc(100% - 32px);

        min-height: 54px;

        margin: 0 16px;

        padding: 0 16px;
    }

    .am-inbox-list {
        margin-top: 13px;
    }

    .am-inbox-row {
        min-height: 94px;

        padding:
            13px 18px;

        grid-template-columns:
            54px minmax(0, 1fr);

        gap: 12px;
    }

    .am-inbox-avatar {
        width: 54px;
        height: 54px;

        font-size: 1.15rem;
    }

    .am-inbox-name-line strong {
        font-size: .94rem;
    }

    .am-inbox-name-line time {
        font-size: .73rem;
    }

    .am-inbox-context {
        font-size: .78rem;
    }

    .am-inbox-preview {
        font-size: .8rem;

        padding-right: 32px;
    }

    .am-inbox-unread {
        right: 18px;
        bottom: 16px;

        min-width: 25px;
        height: 25px;
    }

    .am-inbox-pagination {
        padding:
            0 16px 20px;
    }

    .am-messaging-page .am-main {
        padding-bottom: 104px;
    }
}


/* ==========================================================
   Products in Abuja — catalog redesign
   ========================================================== */

.am-catalog-page {
    background: #fff;
}

.am-catalog-page-content {
    padding: 22px 0 46px;
}

.am-catalog-heading {
    margin-bottom: 17px;
}

.am-catalog-heading .am-kicker {
    color: #b78313;
}

.am-catalog-heading h1 {
    margin: 5px 0 3px;

    color: #17201c;

    font-size: clamp(1.75rem, 4vw, 2.6rem);
    font-weight: 850;

    letter-spacing: -.045em;
}

.am-catalog-heading p {
    margin: 0;

    color: #74807b;

    font-size: .92rem;
}


/* Filter controls */

.am-catalog-filters {
    margin-bottom: 20px;
}

.am-catalog-filter-scroll {
    display: flex;
    align-items: center;

    gap: 9px;

    overflow-x: auto;

    padding: 1px 1px 7px;

    scrollbar-width: none;
}

.am-catalog-filter-scroll::-webkit-scrollbar {
    display: none;
}

.am-filter-pill {
    min-height: 44px;

    padding: 0 12px;

    display: inline-flex;
    align-items: center;

    gap: 6px;

    flex: 0 0 auto;

    border: 1px solid #dfe5e1;
    border-radius: 999px;

    background: #fff;
    color: #36443f;
}

.am-filter-pill i {
    color: #12664f;

    font-size: 1rem;
}

.am-filter-pill select {
    max-width: 180px;

    border: 0;
    outline: 0;

    appearance: none;

    background: transparent;

    color: inherit;

    font-size: .84rem;
    font-weight: 700;

    cursor: pointer;
}

.am-filter-reset {
    min-height: 44px;

    padding: 0 13px;

    display: inline-flex;
    align-items: center;

    gap: 5px;

    flex: 0 0 auto;

    border-radius: 999px;

    background: #f7f2df;
    color: #82610b;

    text-decoration: none;

    font-size: .82rem;
    font-weight: 800;
}


/* Product grid */

.am-catalog-product-grid {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 18px;
}

.am-catalog-product-card {
    min-width: 0;

    overflow: hidden;

    border: 1px solid #e3e8e5;
    border-radius: 15px;

    background: #fff;

    box-shadow:
        0 4px 16px rgba(18, 45, 37, .035);
}

.am-catalog-product-media {
    position: relative;

    overflow: hidden;

    aspect-ratio: 1 / .92;

    background: #f1f4f2;
}

.am-catalog-product-image-link {
    width: 100%;
    height: 100%;

    display: block;
}

.am-catalog-product-media img {
    width: 100%;
    height: 100%;

    display: block;

    object-fit: cover;
}

.am-catalog-image-placeholder {
    width: 100%;
    height: 100%;

    display: grid;
    place-items: center;

    color: #71827b;

    background:
        linear-gradient(
            135deg,
            #edf6f2,
            #faf6e8
        );

    font-size: 2rem;
}


/* Wishlist */

.am-catalog-wishlist {
    position: absolute;

    top: 9px;
    right: 9px;

    margin: 0;
}

.am-catalog-wishlist button,
.am-catalog-wishlist > span {
    width: 38px;
    height: 38px;

    padding: 0;

    display: grid;
    place-items: center;

    border: 0;
    border-radius: 50%;

    background: rgba(255,255,255,.94);
    color: #1c2924;

    box-shadow:
        0 4px 13px rgba(0,0,0,.09);
}

.am-catalog-wishlist button {
    cursor: pointer;
}

.am-catalog-wishlist i {
    font-size: 1.15rem;
}

.am-catalog-wishlist .ti-heart-filled {
    color: #12664f;
}


/* Product content */

.am-catalog-product-body {
    padding: 12px;
}

.am-catalog-product-name {
    min-height: 2.45em;

    display: -webkit-box;

    overflow: hidden;

    color: #27332f;

    text-decoration: none;

    font-size: .91rem;
    font-weight: 700;

    line-height: 1.25;

    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.am-catalog-product-price {
    margin-top: 7px;

    color: #0d4f3d;

    font-size: 1.08rem;
    font-weight: 900;

    letter-spacing: -.02em;
}

.am-catalog-product-location {
    min-width: 0;

    margin-top: 7px;

    display: flex;
    align-items: center;

    gap: 4px;

    color: #78837f;

    font-size: .74rem;
}

.am-catalog-product-location i {
    flex: 0 0 auto;
}

.am-catalog-product-location span {
    min-width: 0;

    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}


/* Pagination */

.am-catalog-pagination {
    margin-top: 28px;
}


/* Empty result */

.am-catalog-empty {
    padding: 70px 20px;

    text-align: center;

    border: 1px solid #e3e8e5;
    border-radius: 18px;

    background: #fafcfb;
}

.am-catalog-empty > i {
    color: #12664f;

    font-size: 2.5rem;
}

.am-catalog-empty h2 {
    margin: 13px 0 5px;
}

.am-catalog-empty p {
    margin-bottom: 18px;

    color: #77817e;
}


/* Mobile-only compact footer */

.am-catalog-mobile-footer {
    display: none;
}


/* Tablet */

@media (max-width: 980px) {

    .am-catalog-product-grid {
        grid-template-columns:
            repeat(3, minmax(0, 1fr));

        gap: 14px;
    }
}


/* Mobile */

@media (max-width: 620px) {

    /*
     * Catalog already has the global product search.
     * Hide unrelated bars so it sits directly beneath
     * the marketplace header.
     */

    .am-catalog-page .am-topbar,
    .am-catalog-page .am-category-strip {
        display: none !important;
    }

    .am-catalog-page .am-header {
        border-bottom: 1px solid #e8ece9;
    }

    .am-catalog-page .am-header-row {
        padding-bottom: 10px;
    }

    .am-catalog-page .am-search {
        margin-bottom: 0;
    }


    .am-catalog-page-content {
        padding:
            18px 0 110px;
    }

    .am-catalog-heading {
        margin-bottom: 12px;
    }

    .am-catalog-heading h1 {
        margin-top: 3px;

        font-size: 1.65rem;
    }

    .am-catalog-heading p {
        font-size: .82rem;
    }


    .am-catalog-filters {
        margin-bottom: 12px;
    }

    .am-catalog-filter-scroll {
        margin-left: -2px;

        gap: 7px;
    }

    .am-filter-pill {
        min-height: 40px;

        padding:
            0 10px;
    }

    .am-filter-pill select {
        max-width: 125px;

        font-size: .78rem;
    }

    .am-filter-reset {
        min-height: 40px;

        font-size: .76rem;
    }


    .am-catalog-product-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));

        gap: 9px;
    }

    .am-catalog-product-card {
        border-radius: 12px;
    }

    .am-catalog-product-media {
        aspect-ratio: 1 / .92;
    }

    .am-catalog-wishlist {
        top: 6px;
        right: 6px;
    }

    .am-catalog-wishlist button,
    .am-catalog-wishlist > span {
        width: 34px;
        height: 34px;
    }

    .am-catalog-product-body {
        padding: 9px;
    }

    .am-catalog-product-name {
        font-size: .79rem;
    }

    .am-catalog-product-price {
        margin-top: 5px;

        font-size: .94rem;
    }

    .am-catalog-product-location {
        margin-top: 5px;

        font-size: .66rem;
    }


    /*
     * Replace large catalog footer on phones.
     */

    .am-catalog-desktop-footer {
        display: none !important;
    }

    .am-catalog-mobile-footer {
        padding:
            21px 16px 105px;

        display: block;

        border-top: 1px solid #e5eae7;

        background: #f8faf9;

        text-align: center;
    }

    .am-catalog-mobile-footer-links {
        display: flex;
        align-items: center;
        justify-content: center;

        flex-wrap: wrap;

        gap: 9px 17px;
    }

    .am-catalog-mobile-footer a {
        color: #46534e;

        text-decoration: none;

        font-size: .77rem;
        font-weight: 700;
    }

    .am-catalog-mobile-footer p {
        margin:
            12px 0 0;

        color: #87908d;

        font-size: .71rem;
    }


    /*
     * Fixed bottom navigation must never obscure
     * products, pagination or footer.
     */

    .am-catalog-page .am-mobile-nav {
        z-index: 1050;
    }
}


/* Very small phones */

@media (max-width: 380px) {

    .am-catalog-page-content {
        padding-top: 14px;
    }

    .am-catalog-product-grid {
        gap: 7px;
    }

    .am-catalog-product-body {
        padding: 8px;
    }

    .am-catalog-product-price {
        font-size: .88rem;
    }

}


/* Dynamic category navigation */
.am-category-links {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 26px;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.am-category-links::-webkit-scrollbar {
    display: none;
}

.am-category-links a {
    flex: 0 0 auto;
}

.am-category-links a.active {
    color: var(--am-primary);
    font-weight: 800;
}


/* ==========================================================
   Product conversation workspace
   ========================================================== */

.am-messaging-page {
    background: #fff;
}

.am-chat-workspace {
    background: #fff;
}

.am-chat-shell {
    width: min(100% - 28px, 900px);
    margin: 0 auto;
    padding-bottom: 190px;
}


/* Conversation header */

.am-chat-header {
    min-height: 72px;

    display: grid;
    grid-template-columns: 42px 48px minmax(0, 1fr) 42px;

    gap: 10px;
    align-items: center;

    border-bottom: 1px solid #edf0ee;
}

.am-chat-back,
.am-chat-menu > summary {
    width: 42px;
    height: 42px;

    display: grid;
    place-items: center;

    border: 0;
    border-radius: 50%;

    background: transparent;
    color: #17201c;

    cursor: pointer;
    text-decoration: none;

    list-style: none;
}

.am-chat-avatar {
    width: 48px;
    height: 48px;

    display: grid;
    place-items: center;

    border-radius: 50%;

    background: #07583f;
    color: #fff;

    font-weight: 850;
}

.am-chat-identity {
    min-width: 0;

    display: grid;
}

.am-chat-identity strong {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;

    font-size: .98rem;
}

.am-chat-identity span {
    color: #74807b;
    font-size: .76rem;
}


.am-chat-menu {
    position: relative;
}

.am-chat-menu > summary::-webkit-details-marker {
    display: none;
}

.am-chat-menu-popover {
    position: absolute;
    z-index: 1100;

    top: 48px;
    right: 0;

    width: 220px;

    padding: 7px;

    border: 1px solid #e2e7e4;
    border-radius: 12px;

    background: #fff;

    box-shadow: 0 12px 35px rgba(15, 42, 33, .14);
}

.am-chat-menu-popover a,
.am-chat-menu-popover button {
    width: 100%;

    padding: 10px;

    display: flex;
    align-items: center;

    gap: 8px;

    border: 0;
    border-radius: 8px;

    background: transparent;

    color: #33413c;
    text-decoration: none;

    font-size: .8rem;

    cursor: pointer;
}

.am-chat-menu-popover a:hover,
.am-chat-menu-popover button:hover {
    background: #f5f8f6;
}


/* Product context */

.am-chat-product {
    min-height: 82px;

    margin-top: 9px;
    padding: 10px;

    display: grid;

    grid-template-columns:
        62px minmax(0, 1fr) auto;

    gap: 11px;
    align-items: center;

    border: 1px solid #e5eae7;
    border-radius: 12px;

    background: #fafcfb;
}

.am-chat-product-image {
    width: 62px;
    height: 62px;

    overflow: hidden;

    display: grid;
    place-items: center;

    border-radius: 9px;

    background: #edf1ef;
}

.am-chat-product-image img {
    width: 100%;
    height: 100%;

    display: block;
    object-fit: cover;
}

.am-chat-product-copy {
    min-width: 0;

    display: grid;
    gap: 4px;
}

.am-chat-product-copy strong {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;

    font-size: .88rem;
}

.am-chat-product-copy span {
    color: #12664f;

    font-size: .82rem;
    font-weight: 800;
}

.am-chat-view-product {
    min-height: 40px;

    padding: 0 10px;

    display: inline-flex;
    align-items: center;

    gap: 4px;

    color: #12664f;
    text-decoration: none;

    font-size: .76rem;
    font-weight: 800;
}


/* Messages */

.am-chat-stream {
    height: min(58vh, 620px);

    margin-top: 12px;
    padding: 12px 3px 22px;

    overflow-y: auto;
    overscroll-behavior: contain;

    scroll-behavior: smooth;
}

.am-chat-empty {
    height: 100%;

    display: grid;
    place-items: center;
    align-content: center;

    gap: 5px;

    color: #818b87;
    text-align: center;
}


/*
 Existing messages.partials.message remains authoritative.
 These rules make common Bootstrap message wrappers less crowded.
 */

.am-chat-stream .am-panel {
    max-width: 78%;

    margin-top: 7px;
    padding: 10px 13px !important;

    border: 0;
    border-radius: 15px;

    box-shadow: none;
}

.am-chat-stream p {
    overflow-wrap: anywhere;
}


/* Seller offer creator */

.am-chat-offer-maker {
    margin: 7px 0;
}

.am-chat-offer-maker > summary {
    min-height: 45px;

    display: flex;
    align-items: center;
    justify-content: center;

    gap: 7px;

    border: 1px solid #12664f;
    border-radius: 9px;

    background: #fff;
    color: #12664f;

    font-size: .82rem;
    font-weight: 850;

    cursor: pointer;
    list-style: none;
}

.am-chat-offer-maker > summary::-webkit-details-marker {
    display: none;
}

.am-chat-offer-sheet {
    margin-top: 8px;
    padding: 14px;

    border: 1px solid #e2e7e4;
    border-radius: 13px;

    background: #fff;

    box-shadow: 0 8px 25px rgba(14, 39, 31, .08);
}

.am-chat-offer-title {
    margin-bottom: 12px;

    display: grid;
}

.am-chat-offer-title span {
    color: #78827e;
    font-size: .75rem;
}

.am-chat-offer-sheet label {
    display: grid;

    gap: 5px;

    margin-bottom: 10px;

    font-size: .78rem;
    font-weight: 800;
}

.am-chat-offer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;

    gap: 9px;
}

.am-chat-send-offer {
    width: 100%;
    min-height: 44px;

    border: 0;
    border-radius: 9px;

    background: #12664f;
    color: #fff;

    font-weight: 850;
}


/* Composer */

.am-chat-composer-wrap {
    position: sticky;
    z-index: 1040;

    bottom: 86px;

    padding: 8px 0;

    background: rgba(255,255,255,.97);

    backdrop-filter: blur(12px);
}

.am-chat-composer {
    min-height: 56px;

    display: grid;

    grid-template-columns:
        48px minmax(0, 1fr) 50px;

    gap: 8px;
    align-items: end;
}

.am-chat-plus,
.am-chat-send {
    width: 48px;
    height: 48px;

    border-radius: 50%;
}

.am-chat-plus {
    border: 1px solid #dfe5e2;

    background: #f6f8f7;
    color: #48544f;
}

.am-chat-send {
    border: 0;

    background: #087557;
    color: #fff;

    font-size: 1.2rem;
}

.am-chat-send:disabled {
    opacity: .45;
}

.am-chat-composer textarea {
    width: 100%;
    min-height: 48px;
    max-height: 120px;

    padding: 13px 16px;

    resize: none;

    border: 1px solid #dfe5e2;
    border-radius: 25px;

    outline: none;

    background: #fafbfa;

    line-height: 1.35;
}

.am-chat-composer textarea:focus {
    border-color: #12664f;

    box-shadow: 0 0 0 3px rgba(18,102,79,.09);
}

.am-chat-blocked {
    padding: 12px;

    border-radius: 9px;

    background: #fff3cd;
    color: #735c0f;

    font-size: .8rem;
}


/* Mobile */

@media (max-width: 620px) {

    .am-chat-shell {
        width: 100%;

        padding:
            0 14px 190px;
    }

    .am-chat-header {
        grid-template-columns:
            38px 46px minmax(0, 1fr) 38px;
    }

    .am-chat-back,
    .am-chat-menu > summary {
        width: 38px;
        height: 38px;
    }

    .am-chat-avatar {
        width: 46px;
        height: 46px;
    }

    .am-chat-product {
        grid-template-columns:
            58px minmax(0, 1fr) auto;
    }

    .am-chat-product-image {
        width: 58px;
        height: 58px;
    }

    .am-chat-view-product {
        padding: 0 4px;

        font-size: .7rem;
    }

    .am-chat-stream {
        height: calc(100dvh - 390px);
        min-height: 310px;
    }

    .am-chat-offer-grid {
        grid-template-columns: 1fr 1fr;
    }

    .am-chat-composer-wrap {
        bottom: 82px;
    }

}


/* Desktop */

@media (min-width: 821px) {

    .am-chat-shell {
        max-width: 900px;
    }

    .am-chat-stream {
        padding-left: 18px;
        padding-right: 18px;
    }

}


/* Keyboard focus */

.am-chat-workspace button:focus-visible,
.am-chat-workspace a:focus-visible,
.am-chat-workspace textarea:focus-visible,
.am-chat-workspace select:focus-visible,
.am-chat-workspace input:focus-visible {
    outline: 3px solid rgba(213,161,45,.38);
    outline-offset: 2px;
}


/* ==========================================================
   Conversation bubbles + negotiated offers
   ========================================================== */

.am-chat-message-row {
    width: 100%;
    margin: 8px 0;

    display: flex;
    align-items: flex-end;

    gap: 8px;
}

.am-chat-message-row.is-mine {
    justify-content: flex-end;
}

.am-chat-message-row.is-theirs {
    justify-content: flex-start;
}


.am-chat-message-avatar {
    width: 40px;
    height: 40px;

    flex: 0 0 40px;

    display: grid;
    place-items: center;

    border-radius: 50%;

    background: #07583f;
    color: #fff;

    font-size: .72rem;
    font-weight: 850;
}


.am-chat-message-column {
    max-width: min(76%, 540px);

    display: flex;
    flex-direction: column;
}

.am-chat-message-row.is-mine .am-chat-message-column {
    align-items: flex-end;
}

.am-chat-message-row.is-theirs .am-chat-message-column {
    align-items: flex-start;
}


/* Message bubbles */

.am-chat-bubble {
    padding: 10px 13px;

    border-radius: 15px;

    font-size: .88rem;
    line-height: 1.42;

    overflow-wrap: anywhere;
}

.am-chat-bubble.mine {
    border-bottom-right-radius: 5px;

    background: #dcf4e9;
    color: #1c2924;
}

.am-chat-bubble.theirs {
    border-bottom-left-radius: 5px;

    background: #f1f3f2;
    color: #222d29;
}


.am-chat-message-time {
    margin-top: 3px;

    display: flex;
    align-items: center;

    gap: 3px;

    color: #7f8985;

    font-size: .67rem;
}

.am-chat-message-time i {
    color: #087557;

    font-size: .85rem;
}


/* Date separator */

.am-chat-date-separator {
    width: 100%;

    margin: 15px 0 9px;

    display: flex;
    justify-content: center;
}

.am-chat-date-separator span {
    padding: 4px 12px;

    border-radius: 999px;

    background: #f2f4f3;
    color: #75807c;

    font-size: .68rem;
    font-weight: 700;
}


/* Offer card */

.am-chat-offer-card {
    width: min(430px, 74vw);

    margin-top: 4px;
    padding: 12px;

    border: 1px solid #dfe7e3;
    border-radius: 13px;

    background:
        linear-gradient(
            135deg,
            #fff,
            #fbfdfc
        );

    color: #1b2823;

    box-shadow:
        0 3px 13px rgba(16,54,42,.045);
}

.am-chat-offer-card-head {
    margin-bottom: 10px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 8px;
}

.am-chat-offer-label {
    display: flex;
    align-items: center;

    gap: 5px;

    color: #12664f;

    font-size: .78rem;
}

.am-chat-offer-label i {
    font-size: 1rem;
}

.am-chat-offer-card-head > span {
    color: #7d8783;

    font-size: .67rem;
}


.am-chat-offer-product {
    display: grid;

    grid-template-columns:
        62px minmax(0,1fr);

    gap: 10px;
}

.am-chat-offer-image {
    width: 62px;
    height: 62px;

    overflow: hidden;

    display: grid;
    place-items: center;

    border-radius: 9px;

    background: #eef1ef;
}

.am-chat-offer-image img {
    width: 100%;
    height: 100%;

    display: block;

    object-fit: cover;
}


.am-chat-offer-product-copy {
    min-width: 0;

    display: grid;
    align-content: center;

    gap: 2px;
}

.am-chat-offer-product-copy > strong {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;

    font-size: .84rem;
}

.am-chat-offer-product-copy > span {
    color: #74807b;

    font-size: .69rem;
}


.am-chat-offer-pricing {
    margin-top: 3px;

    display: flex;
    align-items: center;

    gap: 9px;
}

.am-chat-offer-pricing del {
    color: #858f8b;

    font-size: .78rem;
}

.am-chat-offer-pricing strong {
    color: #087557;

    font-size: 1rem;
}


/* Offer status */

.am-chat-offer-status-row {
    min-height: 30px;

    margin-top: 10px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 8px;
}

.am-offer-status {
    padding: 4px 8px;

    display: inline-flex;
    align-items: center;

    gap: 4px;

    border-radius: 999px;

    background: #eef1ef;
    color: #56625e;

    font-size: .67rem;
    font-weight: 800;
}

.am-offer-status.pending {
    background: #fff5dc;
    color: #9b6d03;
}

.am-offer-status.accepted {
    background: #e2f5eb;
    color: #087557;
}

.am-offer-status.declined,
.am-offer-status.withdrawn {
    background: #f1f2f1;
    color: #67716e;
}

.am-offer-status.expired,
.am-offer-status.unavailable {
    background: #fff0e8;
    color: #a64b20;
}


.am-chat-offer-text-action {
    padding: 4px;

    border: 0;

    background: transparent;
    color: #12664f;

    font-size: .69rem;
    font-weight: 800;

    cursor: pointer;
}


/* Buyer offer actions */

.am-chat-offer-actions {
    margin-top: 10px;

    display: grid;
    grid-template-columns: 1fr 1fr;

    gap: 7px;
}

.am-chat-offer-actions form {
    margin: 0;
}

.am-chat-offer-accept,
.am-chat-offer-decline {
    width: 100%;
    min-height: 38px;

    border-radius: 8px;

    font-size: .75rem;
    font-weight: 850;
}

.am-chat-offer-accept {
    border: 0;

    background: #12664f;
    color: #fff;
}

.am-chat-offer-decline {
    border: 1px solid #d8dfdc;

    background: #fff;
    color: #4d5955;
}


.am-chat-offer-result,
.am-chat-offer-unavailable {
    margin-top: 9px;
    padding: 8px 10px;

    border-radius: 8px;

    background: #f3f5f4;
    color: #66716d;

    font-size: .7rem;
}

.am-chat-offer-result.accepted {
    background: #e7f6ee;
    color: #087557;
}


/* Mobile */

@media (max-width: 620px) {

    .am-chat-message-column {
        max-width: 82%;
    }

    .am-chat-message-avatar {
        width: 38px;
        height: 38px;

        flex-basis: 38px;
    }

    .am-chat-bubble {
        font-size: .84rem;
    }

    .am-chat-offer-card {
        width: min(100%, 390px);
    }

}


/* Small phones */

@media (max-width: 380px) {

    .am-chat-message-column {
        max-width: 84%;
    }

    .am-chat-offer-card {
        padding: 10px;
    }

    .am-chat-offer-product {
        grid-template-columns:
            54px minmax(0,1fr);
    }

    .am-chat-offer-image {
        width: 54px;
        height: 54px;
    }

}


/* ==========================================================
   Conversation bubbles + negotiated offers
   ========================================================== */

.am-chat-message-row {
    width: 100%;
    margin: 8px 0;

    display: flex;
    align-items: flex-end;

    gap: 8px;
}

.am-chat-message-row.is-mine {
    justify-content: flex-end;
}

.am-chat-message-row.is-theirs {
    justify-content: flex-start;
}


.am-chat-message-avatar {
    width: 40px;
    height: 40px;

    flex: 0 0 40px;

    display: grid;
    place-items: center;

    border-radius: 50%;

    background: #07583f;
    color: #fff;

    font-size: .72rem;
    font-weight: 850;
}


.am-chat-message-column {
    max-width: min(76%, 540px);

    display: flex;
    flex-direction: column;
}

.am-chat-message-row.is-mine .am-chat-message-column {
    align-items: flex-end;
}

.am-chat-message-row.is-theirs .am-chat-message-column {
    align-items: flex-start;
}


/* Message bubbles */

.am-chat-bubble {
    padding: 10px 13px;

    border-radius: 15px;

    font-size: .88rem;
    line-height: 1.42;

    overflow-wrap: anywhere;
}

.am-chat-bubble.mine {
    border-bottom-right-radius: 5px;

    background: #dcf4e9;
    color: #1c2924;
}

.am-chat-bubble.theirs {
    border-bottom-left-radius: 5px;

    background: #f1f3f2;
    color: #222d29;
}


.am-chat-message-time {
    margin-top: 3px;

    display: flex;
    align-items: center;

    gap: 3px;

    color: #7f8985;

    font-size: .67rem;
}

.am-chat-message-time i {
    color: #087557;

    font-size: .85rem;
}


/* Date separator */

.am-chat-date-separator {
    width: 100%;

    margin: 15px 0 9px;

    display: flex;
    justify-content: center;
}

.am-chat-date-separator span {
    padding: 4px 12px;

    border-radius: 999px;

    background: #f2f4f3;
    color: #75807c;

    font-size: .68rem;
    font-weight: 700;
}


/* Offer card */

.am-chat-offer-card {
    width: min(430px, 74vw);

    margin-top: 4px;
    padding: 12px;

    border: 1px solid #dfe7e3;
    border-radius: 13px;

    background:
        linear-gradient(
            135deg,
            #fff,
            #fbfdfc
        );

    color: #1b2823;

    box-shadow:
        0 3px 13px rgba(16,54,42,.045);
}

.am-chat-offer-card-head {
    margin-bottom: 10px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 8px;
}

.am-chat-offer-label {
    display: flex;
    align-items: center;

    gap: 5px;

    color: #12664f;

    font-size: .78rem;
}

.am-chat-offer-label i {
    font-size: 1rem;
}

.am-chat-offer-card-head > span {
    color: #7d8783;

    font-size: .67rem;
}


.am-chat-offer-product {
    display: grid;

    grid-template-columns:
        62px minmax(0,1fr);

    gap: 10px;
}

.am-chat-offer-image {
    width: 62px;
    height: 62px;

    overflow: hidden;

    display: grid;
    place-items: center;

    border-radius: 9px;

    background: #eef1ef;
}

.am-chat-offer-image img {
    width: 100%;
    height: 100%;

    display: block;

    object-fit: cover;
}


.am-chat-offer-product-copy {
    min-width: 0;

    display: grid;
    align-content: center;

    gap: 2px;
}

.am-chat-offer-product-copy > strong {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;

    font-size: .84rem;
}

.am-chat-offer-product-copy > span {
    color: #74807b;

    font-size: .69rem;
}


.am-chat-offer-pricing {
    margin-top: 3px;

    display: flex;
    align-items: center;

    gap: 9px;
}

.am-chat-offer-pricing del {
    color: #858f8b;

    font-size: .78rem;
}

.am-chat-offer-pricing strong {
    color: #087557;

    font-size: 1rem;
}


/* Offer status */

.am-chat-offer-status-row {
    min-height: 30px;

    margin-top: 10px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 8px;
}

.am-offer-status {
    padding: 4px 8px;

    display: inline-flex;
    align-items: center;

    gap: 4px;

    border-radius: 999px;

    background: #eef1ef;
    color: #56625e;

    font-size: .67rem;
    font-weight: 800;
}

.am-offer-status.pending {
    background: #fff5dc;
    color: #9b6d03;
}

.am-offer-status.accepted {
    background: #e2f5eb;
    color: #087557;
}

.am-offer-status.declined,
.am-offer-status.withdrawn {
    background: #f1f2f1;
    color: #67716e;
}

.am-offer-status.expired,
.am-offer-status.unavailable {
    background: #fff0e8;
    color: #a64b20;
}


.am-chat-offer-text-action {
    padding: 4px;

    border: 0;

    background: transparent;
    color: #12664f;

    font-size: .69rem;
    font-weight: 800;

    cursor: pointer;
}


/* Buyer offer actions */

.am-chat-offer-actions {
    margin-top: 10px;

    display: grid;
    grid-template-columns: 1fr 1fr;

    gap: 7px;
}

.am-chat-offer-actions form {
    margin: 0;
}

.am-chat-offer-accept,
.am-chat-offer-decline {
    width: 100%;
    min-height: 38px;

    border-radius: 8px;

    font-size: .75rem;
    font-weight: 850;
}

.am-chat-offer-accept {
    border: 0;

    background: #12664f;
    color: #fff;
}

.am-chat-offer-decline {
    border: 1px solid #d8dfdc;

    background: #fff;
    color: #4d5955;
}


.am-chat-offer-result,
.am-chat-offer-unavailable {
    margin-top: 9px;
    padding: 8px 10px;

    border-radius: 8px;

    background: #f3f5f4;
    color: #66716d;

    font-size: .7rem;
}

.am-chat-offer-result.accepted {
    background: #e7f6ee;
    color: #087557;
}


/* Mobile */

@media (max-width: 620px) {

    .am-chat-message-column {
        max-width: 82%;
    }

    .am-chat-message-avatar {
        width: 38px;
        height: 38px;

        flex-basis: 38px;
    }

    .am-chat-bubble {
        font-size: .84rem;
    }

    .am-chat-offer-card {
        width: min(100%, 390px);
    }

}


/* Small phones */

@media (max-width: 380px) {

    .am-chat-message-column {
        max-width: 84%;
    }

    .am-chat-offer-card {
        padding: 10px;
    }

    .am-chat-offer-product {
        grid-template-columns:
            54px minmax(0,1fr);
    }

    .am-chat-offer-image {
        width: 54px;
        height: 54px;
    }

}


/* Chat height correction */
@media (max-width: 620px) {
    .am-chat-stream {
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        overflow-y: visible !important;
        padding-bottom: 16px !important;
    }

    .am-chat-shell {
        min-height: 0 !important;
        padding-bottom: 175px !important;
    }

    .am-chat-composer-wrap {
        position: sticky;
        bottom: 82px;
    }
}


/* ==========================================================
   Chat composer + attachment final fixes
   ========================================================== */

.am-chat-attachment-preview {
    grid-column: 1 / -1;

    display: flex;
    gap: 6px;

    overflow-x: auto;

    padding: 3px 2px;
}

.am-chat-selected-file {
    max-width: 230px;

    padding: 6px 9px;

    flex: 0 0 auto;

    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;

    border-radius: 8px;

    background: #eef5f2;
    color: #43514c;

    font-size: .67rem;
}


.am-chat-attachments {
    width: 100%;

    margin-top: 6px;

    display: grid;

    gap: 6px;
}


.am-chat-image-attachment img {
    display: block;

    width: min(260px, 68vw);
    max-height: 300px;

    object-fit: cover;

    border-radius: 12px;
}


.am-chat-video-attachment {
    display: block;

    width: min(300px, 72vw);
    max-height: 320px;

    border-radius: 12px;

    background: #000;
}


.am-chat-document-attachment {
    width: min(320px, 72vw);

    min-height: 56px;

    padding: 9px 11px;

    display: grid;

    grid-template-columns:
        34px minmax(0,1fr) 24px;

    align-items: center;

    gap: 8px;

    border: 1px solid #dfe5e2;
    border-radius: 10px;

    background: #fff;

    color: #33413c;
    text-decoration: none;
}

.am-chat-document-attachment > i:first-child {
    color: #12664f;

    font-size: 1.35rem;
}

.am-chat-document-attachment span {
    min-width: 0;

    display: grid;
}

.am-chat-document-attachment strong {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;

    font-size: .73rem;
}

.am-chat-document-attachment small {
    color: #7d8783;

    font-size: .62rem;
}


/*
 * Remove the artificial blank conversation height.
 */

@media (max-width: 620px) {

    .am-chat-workspace {
        padding-bottom: 0;
    }

    .am-chat-shell {
        min-height: 0 !important;

        padding-bottom:
            calc(170px + env(safe-area-inset-bottom)) !important;
    }

    .am-chat-stream {
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;

        overflow: visible !important;

        padding-bottom: 12px !important;
    }


    /*
     * Composer stays directly above mobile navigation.
     */

    .am-chat-composer-wrap {
        position: fixed !important;

        z-index: 1045;

        left: 50%;
        right: auto;

        bottom:
            calc(82px + env(safe-area-inset-bottom));

        transform: translateX(-50%);

        width: min(
            calc(100% - 24px),
            900px
        );

        padding: 7px 0;

        background: rgba(255,255,255,.98);
    }


    /*
     * Seller Create Special Offer button sits above composer.
     */

    .am-chat-offer-maker {
        position: fixed;

        z-index: 1044;

        left: 50%;

        bottom:
            calc(145px + env(safe-area-inset-bottom));

        transform: translateX(-50%);

        width: min(
            calc(100% - 28px),
            900px
        );

        margin: 0;

        background: #fff;
    }


    .am-chat-offer-maker[open]
    .am-chat-offer-sheet {
        position: fixed;

        z-index: 1060;

        left: 50%;

        bottom:
            calc(198px + env(safe-area-inset-bottom));

        transform: translateX(-50%);

        width: min(
            calc(100% - 28px),
            520px
        );

        max-height: 68vh;

        overflow-y: auto;
    }

}


/* ==========================================================
   Chat image lightbox
   ========================================================== */

.am-chat-image-attachment {
    padding: 0;
    border: 0;
    background: transparent;
    cursor: zoom-in;
}

.am-chat-lightbox[hidden] {
    display: none !important;
}

.am-chat-lightbox {
    position: fixed;
    z-index: 5000;

    inset: 0;

    padding:
        max(22px, env(safe-area-inset-top))
        14px
        max(22px, env(safe-area-inset-bottom));

    display: flex;
    align-items: center;
    justify-content: center;

    background: rgba(8, 15, 12, .92);

    backdrop-filter: blur(7px);
}

.am-chat-lightbox img {
    display: block;

    max-width: min(94vw, 1000px);
    max-height: 88dvh;

    width: auto;
    height: auto;

    object-fit: contain;

    border-radius: 10px;
}

.am-chat-lightbox-close {
    position: absolute;

    top: max(18px, env(safe-area-inset-top));
    right: 18px;

    width: 44px;
    height: 44px;

    display: grid;
    place-items: center;

    border: 1px solid rgba(255,255,255,.25);
    border-radius: 50%;

    background: rgba(0,0,0,.4);
    color: #fff;

    font-size: 1.35rem;
}

body.am-chat-lightbox-open {
    overflow: hidden;
}


/* Optimistic chat sending */
.am-chat-message-pending {
    opacity: .72;
}

.am-chat-message-failed {
    opacity: .82;
}

.am-chat-send-failed {
    color: #a54b38;
}

.am-chat-pending-files {
    margin-top: 5px;
    display: grid;
    gap: 3px;
}

.am-chat-pending-files span {
    padding: 5px 8px;
    border-radius: 7px;
    background: rgba(18,102,79,.08);
    color: #53605b;
    font-size: .68rem;
}


/* Chat attachment removal */
.am-chat-attachment-preview-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.am-chat-preview-file {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
}

.am-chat-preview-file span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.am-chat-attachment-remove {
    width: 26px;
    height: 26px;
    border: 0;
    border-radius: 50%;
    background: rgba(0,0,0,.08);
    display: grid;
    place-items: center;
    cursor: pointer;
    flex: 0 0 auto;
}


/* Pending uploads */
.am-chat-pending-message {
    opacity: .82;
}

.am-chat-pending-attachments {
    display: grid;
    gap: 5px;
    margin-top: 6px;
}

.am-chat-pending-attachment {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .75rem;
}

.am-chat-upload-status {
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: .68rem;
    opacity: .8;
}

.am-chat-upload-status progress {
    width: 90px;
    height: 5px;
}

.am-chat-message-failed {
    opacity: .65;
}


/* Selected chat attachment preview */
.am-chat-attachment-preview {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    padding: 7px 2px;
}

.am-chat-attachment-preview[hidden] {
    display: none !important;
}

.am-chat-attachment-preview-item {
    position: relative;
    flex: 0 0 auto;
    min-width: 58px;
}

.am-chat-attachment-preview-item.is-image {
    width: 68px;
    height: 68px;
    border-radius: 10px;
    overflow: hidden;
    background: #f3f5f4;
}

.am-chat-attachment-preview-item.is-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.am-chat-attachment-preview-item.is-image .am-chat-attachment-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    background: rgba(0,0,0,.7);
    color: #fff;
}

.am-chat-attachment-remove {
    border: 0;
    border-radius: 50%;
    cursor: pointer;
    display: grid;
    place-items: center;
}


/* Chat selected-file tray */
.am-chat-composer {
    position: relative !important;
    overflow: visible !important;
}

.am-chat-attachment-preview {
    position: absolute !important;
    left: 8px;
    right: 8px;
    bottom: calc(100% + 8px);

    display: flex;
    align-items: center;
    gap: 8px;

    padding: 8px;

    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, .10);
    border-radius: 14px;

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

    overflow-x: auto;
    z-index: 1100;
}

.am-chat-attachment-preview[hidden] {
    display: none !important;
}

.am-chat-attachment-preview-item {
    position: relative;
    flex: 0 0 auto;
}

.am-chat-attachment-preview-item.is-image {
    width: 72px;
    height: 72px;
    border-radius: 10px;
    overflow: hidden;
    background: #f2f3f3;
}

.am-chat-attachment-preview-item.is-image img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.am-chat-attachment-preview-item.is-image .am-chat-attachment-remove {
    position: absolute;
    top: 4px;
    right: 4px;

    width: 24px;
    height: 24px;

    border: 0;
    border-radius: 50%;

    background: rgba(0, 0, 0, .72);
    color: #ffffff;

    display: grid;
    place-items: center;

    z-index: 2;
}

.am-chat-preview-file {
    min-width: 130px;
    max-width: 220px;

    display: flex;
    align-items: center;
    gap: 7px;

    padding: 10px 36px 10px 10px;

    background: #f5f7f6;
    border-radius: 10px;
}

.am-chat-preview-file span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


/* ==========================================================
   Messaging desktop refinement
   ========================================================== */

@media (min-width: 821px) {

    .am-chat-workspace {
        padding: 18px 0 40px;
    }

    .am-chat-shell {
        width: min(calc(100% - 48px), 900px) !important;
        max-width: 900px !important;

        margin-left: auto !important;
        margin-right: auto !important;
    }

    .am-chat-stream {
        width: 100% !important;

        min-height: 430px;
        max-height: calc(100vh - 330px);

        margin-top: 14px;

        padding: 20px 22px 26px !important;

        overflow-y: auto;

        border: 1px solid #eef1ef;
        border-radius: 16px;

        background: #fff;
    }

    .am-chat-offer-maker {
        width: 100%;
        margin-top: 12px;
    }

    .am-chat-composer-wrap {
        width: 100%;
        margin-top: 8px;

        position: sticky;
        bottom: 0;

        padding: 10px 0;

        background: rgba(255,255,255,.98);
    }

    .am-chat-composer {
        width: 100%;
    }

    .am-chat-message-column {
        max-width: min(70%, 520px);
    }

    .am-chat-offer-card {
        width: min(430px, 100%);
    }

}

