/* ==================================================
   SELF-MARKET STYLES
   Scoped styles and enhancements for self-market.html
================================================== */

/* Layout Shell */
.self-market-dashboard-page .owner-market-main {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 24px 0 54px;
}

/* ==================================================
   DASHBOARD TOPBAR
================================================== */
.self-market-topbar-heading {
    display: flex;
    align-items: center;
    gap: 13px;
}

.self-market-topbar-heading h1 {
    margin: 0;
    font-size: clamp(24px, 3vw, 34px);
    font-weight: 700;
}

.self-market-topbar-heading p {
    margin-top: 4px;
    color: #6b7280;
    font-size: 14px;
}

.mobile-sidebar-button {
    display: none;
    place-items: center;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    background: #ffffff;
    color: #111827;
    border: 0;
    border-radius: 50%;
    box-shadow: 0 5px 16px rgba(15, 23, 42, 0.1);
    cursor: pointer;
    font-size: 20px;
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    z-index: 90;
    background: rgba(3, 10, 6, 0.48);
    border: 0;
    opacity: 0;
    transition: opacity 220ms ease;
}

.sidebar-overlay.show {
    opacity: 1;
}

.self-market-dashboard-page .dashboard-topbar .user-profile {
    color: #111827;
    text-decoration: none;
}

.topbar-quick-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* ==================================================
   SUMMARY SECTION
================================================== */
.owner-summary-section {
    width: 100%;
}

.create-listing-button,
.create-listing-btn,
.empty-create-btn {
    min-height: 46px;
    padding: 0 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex: 0 0 auto;
    color: #ffffff;
    background:  #17653D;
    border: 1px solid rgba(254, 254, 254, 0.92);
    border-radius: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.create-listing-button:hover,
.create-listing-btn:hover,
.empty-create-btn:hover {
    background: #102f20;
    border: 1px solid rgba(254, 254, 254, 0.92);
    transform: translateY(-1px);
}

.listing-summary-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.listing-summary-card {
    display: grid;
    grid-template-rows: auto auto 1fr;
    gap: 12px;
    min-width: 0;
    min-height: 180px;
    padding: 22px;
    border: 1px solid #e7e9e7;
    border-radius: 22px;
    background: #ffffff;
    color: #171b18;
    text-align: left;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(22, 35, 27, 0.05);
    transition:
        transform 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background-color 0.2s ease;
}

.listing-summary-card:hover {
    transform: translateY(-2px);
    border-color: #cfd8d1;
    box-shadow: 0 12px 26px rgba(22, 35, 27, 0.09);
}

.listing-summary-card:focus-visible {
    outline: 3px solid rgba(24, 63, 44, 0.24);
    outline-offset: 3px;
}

.listing-summary-card.is-active {
    border-color: #17653D;
    background: #17653D;
    color: #ffffff;
    box-shadow: 0 12px 28px rgba(15, 51, 34, 0.2);
}

.listing-summary-title {
    font-size: 0.95rem;
    font-weight: 600;
}

.desktop-summary-title {
    display: inline;
}

.mobile-summary-title {
    display: none;
}

.owner-listing-grid[hidden],
#owner-listing-loading[hidden] {
    display: none !important;
}

.listing-summary-number {
    font-size: clamp(1.85rem, 2.5vw, 2.6rem);
    line-height: 1;
    font-weight: 700;
}

.listing-summary-footer {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    margin-top: auto;
    color: #7b827d;
    font-size: 0.85rem;
}

.listing-summary-card.is-active .listing-summary-footer {
    color: rgba(255, 255, 255, 0.82);
}

.listing-summary-change {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 12px;
    background: #eaf8f0;
    color: #138653;
    font-weight: 600;
    white-space: nowrap;
}

.listing-summary-card.is-active .listing-summary-change {
    background: #ffffff;
    color: #183f2c;
}

/* ==================================================
   FILTER & SEARCH SECTION
================================================== */
.self-market-dashboard-page .owner-filter-section {
    position: relative;
    z-index: 5;
    margin-top: 20px;
    overflow: visible;
}

.self-market-dashboard-page .owner-filter-section .dashboard-filter-toolbar {
    position: relative;
    z-index: 2;
    width: 100%;
    display: flex !important;
    flex-flow: row wrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 10px !important;
    padding: 6px 0 !important;
    margin: 0;
    overflow: visible;
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

.self-market-dashboard-page .owner-filter-section .dashboard-filter-search-slot {
    position: relative !important;
    flex: 0 0 48px !important;
    width: 48px !important;
    min-width: 48px !important;
    max-width: 48px !important;
    height: 48px !important;
    min-height: 48px !important;
    z-index: 30;
    margin: 0;
    transition: width 0.3s ease, flex-basis 0.3s ease, max-width 0.3s ease;
}

.self-market-dashboard-page .owner-filter-section .dashboard-filter-search-slot:hover,
.self-market-dashboard-page .owner-filter-section .dashboard-filter-search-slot:focus-within {
    flex: 0 0 240px !important;
    flex-basis: 240px !important;
    width: 240px !important;
    max-width: 240px !important;
}

.self-market-dashboard-page .owner-filter-section .dashboard-filter-search {
    position: absolute !important;
    inset: 0 auto auto 0 !important;
    display: flex !important;
    align-items: center !important;
    width: 48px !important;
    min-width: 48px !important;
    max-width: none !important;
    height: 48px !important;
    min-height: 48px !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    color: #ffffff !important;
    background: #111111 !important;
    border: 0 !important;
    border-radius: 999px !important;
    box-shadow: 0 8px 20px rgba(17, 17, 17, 0.15) !important;
    transition: width 0.3s ease, background-color 0.2s ease, box-shadow 0.2s ease !important;
}

.self-market-dashboard-page .owner-filter-section .dashboard-filter-search-slot:hover .dashboard-filter-search,
.self-market-dashboard-page .owner-filter-section .dashboard-filter-search-slot:focus-within .dashboard-filter-search {
    width: 240px !important;
    background: #1c1c1c !important;
    box-shadow: 0 10px 24px rgba(17, 17, 17, 0.18) !important;
}

.self-market-dashboard-page .owner-filter-section .dashboard-filter-search-button {
    flex: 0 0 46px !important;
    width: 46px !important;
    min-width: 46px !important;
    height: 46px !important;
    min-height: 46px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: 0 !important;
    border-radius: 50% !important;
    background: transparent !important;
    color: #ffffff !important;
    cursor: pointer;
    font-size: 15px;
}

.self-market-dashboard-page .owner-filter-section #listing-search-input {
    display: block !important;
    flex: 1 1 auto !important;
    width: 0 !important;
    min-width: 0 !important;
    height: 46px !important;
    padding: 0 16px 0 2px !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    caret-color: #ffffff !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    outline: 0 !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transform: translateX(8px) !important;
    font: inherit;
    font-size: 13px;
    transition: width 0.3s ease, opacity 0.2s ease 0.05s, transform 0.3s ease !important;
}

.self-market-dashboard-page .owner-filter-section .dashboard-filter-search-slot:hover #listing-search-input,
.self-market-dashboard-page .owner-filter-section .dashboard-filter-search-slot:focus-within #listing-search-input {
    width: 180px !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transform: translateX(0) !important;
}

.self-market-dashboard-page .owner-filter-section #listing-search-input::placeholder {
    color: rgba(255, 255, 255, 0.75) !important;
    -webkit-text-fill-color: rgba(255, 255, 255, 0.75) !important;
    opacity: 1 !important;
}

/* Custom Dropdowns & Capsules (Desktop / Base Sizing) */
.self-market-dashboard-page .owner-filter-section .dashboard-filter-capsule,
.self-market-dashboard-page .owner-filter-section [data-custom-dropdown].dashboard-filter-capsule,
.self-market-dashboard-page .owner-filter-section .custom-dropdown.dashboard-filter-capsule {
    position: relative;
    z-index: 1;
    flex: 0 0 auto !important;
    flex-grow: 0 !important;
    flex-shrink: 0 !important;
    width: auto !important;
    min-width: 140px !important;
    max-width: 220px !important;
    margin: 0;
}

/* Individual Filter Sizing for balanced, natural desktop display */
.self-market-dashboard-page .owner-filter-section .dashboard-filter-capsule:nth-of-type(2) {
    width: 165px !important;
    min-width: 165px !important;
}

.self-market-dashboard-page .owner-filter-section .dashboard-filter-capsule:nth-of-type(3) {
    width: 160px !important;
    min-width: 160px !important;
}

.self-market-dashboard-page .owner-filter-section .dashboard-filter-capsule:nth-of-type(4) {
    width: 180px !important;
    min-width: 180px !important;
}

.self-market-dashboard-page .owner-filter-section .dashboard-filter-capsule:nth-of-type(5) {
    width: 155px !important;
    min-width: 155px !important;
}

.self-market-dashboard-page .owner-filter-section .dashboard-filter-capsule.is-open {
    z-index: 200;
}

.self-market-dashboard-page .owner-filter-section .dashboard-filter-capsule > .custom-dropdown-toggle {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 44px;
    height: 44px;
    padding: 0 14px;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    background: #f5f5f5;
    color: #242424;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(17, 17, 17, 0.04);
    transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.self-market-dashboard-page .owner-filter-section .dashboard-filter-capsule > .custom-dropdown-toggle:hover,
.self-market-dashboard-page .owner-filter-section .dashboard-filter-capsule > .custom-dropdown-toggle:focus-visible,
.self-market-dashboard-page .owner-filter-section .dashboard-filter-capsule.is-open > .custom-dropdown-toggle {
    background: #ebebeb;
    border-color: #d8d8d8;
    box-shadow: 0 6px 16px rgba(17, 17, 17, 0.08);
}

.self-market-dashboard-page .owner-filter-section .dashboard-filter-capsule .custom-dropdown-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.self-market-dashboard-page .owner-filter-section .dashboard-filter-capsule .custom-dropdown-chevron {
    flex: 0 0 auto;
    font-size: 11px;
    color: #6b7280;
    transition: transform 0.2s ease;
}

.self-market-dashboard-page .owner-filter-section .dashboard-filter-capsule.is-open .custom-dropdown-chevron {
    transform: rotate(180deg);
}

.self-market-dashboard-page .owner-filter-section .dashboard-filter-capsule .custom-dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: auto;
    z-index: 300;
    min-width: 170px;
    max-width: min(280px, calc(100vw - 28px));
    max-height: min(280px, calc(100vh - 24px));
    padding: 6px;
    overflow-y: auto;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.16), 0 2px 8px rgba(15, 23, 42, 0.06);
}

.self-market-dashboard-page .owner-filter-section .dashboard-filter-capsule .custom-dropdown-option {
    width: 100%;
    min-height: 44px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #374151;
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.self-market-dashboard-page .owner-filter-section .dashboard-filter-capsule .custom-dropdown-option:hover,
.self-market-dashboard-page .owner-filter-section .dashboard-filter-capsule .custom-dropdown-option:focus-visible,
.self-market-dashboard-page .owner-filter-section .dashboard-filter-capsule .custom-dropdown-option[aria-selected="true"] {
    background: #eef7f1;
    color: #166534;
    font-weight: 600;
}

/* ==================================================
   LISTING SECTION & HEADER
================================================== */
.self-market-dashboard-page .owner-listing-section {
    position: relative;
    z-index: 1;
    margin-top: 32px;
}

.section-header {
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.section-header h2 {
    color: #172019;
    font-size: clamp(20px, 2vw, 24px);
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: -0.015em;
}

.section-header p {
    margin-top: 4px;
    color: #66736c;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}

.reset-filter-btn,
.empty-reset-btn {
    min-height: 40px;
    padding: 0 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 1px solid #e3e9e5;
    border-radius: 10px;
    background: #ffffff;
    color: #526159;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
}

.reset-filter-btn:hover,
.empty-reset-btn:hover {
    color: #183f2c;
    border-color: #b9c8bf;
    background: #f7f9f7;
}

.reset-filter-btn:active,
.empty-reset-btn:active {
    background: #eef3ef;
}

.reset-filter-btn:focus-visible,
.empty-reset-btn:focus-visible,
.action-btn:focus-visible {
    outline: 3px solid rgba(24, 63, 44, 0.2);
    outline-offset: 2px;
}

.owner-listing-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

/* ==================================================
   LISTING CARD
================================================== */
.owner-listing-card {
    position: relative;
    min-width: 0;
    display: grid;
    grid-template-columns: 176px minmax(0, 1fr);
    min-height: 156px;
    border: 1px solid #e3e9e5;
    border-radius: 16px;
    overflow: hidden;
    background: #ffffff;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.owner-listing-card:hover {
    transform: translateY(-1px);
    border-color: #cad6cf;
    box-shadow: 0 10px 24px rgba(22, 35, 27, 0.07);
}

.listing-image-panel {
    position: relative;
    min-height: 156px;
    height: 100%;
    background: #eef1ef;
}

.listing-image-panel img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.owner-listing-card:hover .listing-image-panel img {
    transform: scale(1.018);
}

.listing-status {
    min-height: 26px;
    padding: 4px 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 999px;
    color: #172019;
    font-size: 12px;
    font-weight: 650;
    line-height: 1;
    box-shadow: 0 4px 10px rgba(22, 35, 27, 0.08);
}

.status-available {
    background: #dcfce7;
    color: #166534;
}

.status-pending-payment {
    background: #fef3c7;
    color: #92400e;
}

.status-sold {
    background: #3f3f46;
    color: #ffffff;
}

.status-inactive {
    background: #f3f4f6;
    color: #374151;
}

.listing-content {
    min-width: 0;
    padding: 14px 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.listing-main-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
}

.listing-title {
    min-width: 0;
}

.listing-title h3 {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #172019;
    font-size: clamp(20px, 2vw, 22px);
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.015em;
}

.listing-title p {
    max-height: 3.1em;
    margin-top: 3px;
    display: flex;
    flex-wrap: wrap;
    column-gap: 0;
    row-gap: 1px;
    overflow: hidden;
    color: #66736c;
    font-size: 13px;
    line-height: 1.55;
}

.listing-title p span {
    white-space: nowrap;
}

.listing-title p span + span::before {
    margin: 0 7px;
    color: #b4bdb8;
    content: "·";
}

.listing-price {
    flex-shrink: 0;
    color: #183f2c;
    font-size: clamp(22px, 2.25vw, 25px);
    font-weight: 700;
    line-height: 1.15;
    white-space: nowrap;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.listing-meta-line {
    min-width: 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 0;
    color: #66736c;
    font-size: 13px;
    line-height: 1.45;
    font-variant-numeric: tabular-nums;
}

.listing-meta-entry {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.listing-meta-entry + .listing-meta-entry::before {
    margin: 0 9px;
    color: #c2cac5;
    content: "·";
}

.listing-meta-entry i {
    color: #7c8981;
    font-size: 13px;
}

.listing-meta-entry strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #4a5750;
    font-weight: 600;
}

.listing-note {
    width: auto;
    padding: 4px 8px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border-radius: 8px;
    background: #fff8ed;
    color: #825c26;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.listing-actions {
    margin-top: 2px;
    padding-top: 10px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    border-top: 1px solid #edf1ee;
}

.action-btn {
    min-height: 40px;
    padding: 0 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1px solid #dfe6e2;
    border-radius: 12px;
    background: #ffffff;
    color: #3c4942;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: border-color 0.18s ease, background-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.action-btn:hover {
    border-color: #b9c8bf;
    background: #f7f9f7;
    color: #183f2c;
}

.action-btn:active:not(:disabled) {
    transform: translateY(1px);
}

.action-primary {
    border-color: #183f2c;
    background: #183f2c;
    color: #ffffff;
}

.action-primary:hover {
    border-color: #102f20;
    background: #102f20;
    color: #ffffff;
    box-shadow: 0 8px 18px rgba(16, 47, 32, 0.16);
}

.action-warning {
    border-color: #e5ded3;
    background: #fffdfa;
    color: #6f5b3d;
}

.action-warning:hover {
    border-color: #d8c9b5;
    background: #faf5ed;
    color: #58462f;
}

.action-danger {
    border-color: #edcaca;
    background: #ffffff;
    color: #a44242;
}

.action-danger:hover {
    border-color: #dbaaaa;
    background: #fff5f5;
    color: #8f3030;
}

.action-info {
    border-color: #dfe6e2;
    background: #ffffff;
    color: #3c4942;
}

.action-info:hover {
    border-color: #b9c8bf;
    background: #f7f9f7;
    color: #183f2c;
}

.disabled,
.action-btn:disabled {
    cursor: not-allowed;
    border-color: #e6ebe8;
    background: #f6f8f7;
    color: #9ba59f;
    opacity: 1;
    transform: none;
    box-shadow: none;
}

/* ==================================================
   EMPTY STATE & ERROR
================================================== */
.empty-listing-state {
    padding: 64px 20px;
    text-align: center;
}

.empty-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #eef1f5;
    color: #6b7280;
    font-size: 28px;
}

.empty-listing-state h3 {
    font-size: 20px;
    font-weight: 800;
}

.empty-listing-state p {
    max-width: 430px;
    margin: 6px auto 0;
    color: #6b7280;
    font-size: 13px;
    line-height: 1.7;
}

.empty-create-btn,
.empty-reset-btn {
    margin-top: 18px;
}

.empty-create-btn {
    background: #111827;
    color: #ffffff;
}

.owner-market-error-state {
    min-height: 280px;
    background: #ffffff;
    border: 1px solid #e7e9ed;
    border-radius: 20px;
}

/* ==================================================
   PAGINATION
================================================== */
.pagination {
    margin-top: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
}

.pagination-pages {
    display: flex;
    align-items: center;
    gap: 6px;
}

.pagination button,
.pagination-dots {
    height: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e2e5e9;
    border-radius: 12px;
    background: #ffffff;
    color: #4b5563;
    font-size: 13px;
    font-weight: 700;
}

.pagination button {
    cursor: pointer;
    transition: transform 0.2s ease, color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.pagination button:hover:not(:disabled) {
    transform: translateY(-1px);
    border-color: #111827;
    color: #111827;
}

.pagination button:disabled {
    cursor: not-allowed;
    opacity: 0.4;
}

.pagination-nav {
    min-width: 96px;
    padding: 0 14px;
    gap: 6px;
}

.pagination-page {
    min-width: 44px;
    padding: 0 10px;
}

.pagination-page.active {
    border-color: #111827;
    background: #111827;
    color: #ffffff;
}

.pagination-dots {
    min-width: 32px;
    border-color: transparent;
    background: transparent;
}

/* ==================================================
   SKELETON LOADING
================================================== */
.owner-listing-card-skeleton {
    pointer-events: none;
}

.listing-content-skeleton {
    justify-content: center;
}

.listing-meta-skeleton-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.listing-meta-skeleton-row .skeleton {
    height: 14px;
    border-radius: 6px;
}

/* ==================================================
   CHICKEN SELECTOR MODAL (REDESIGNED)
================================================== */
.chicken-selector-modal[hidden] {
    display: none !important;
}

.chicken-selector-modal {
    position: fixed;
    inset: 0;
    z-index: 2100;
    display: grid;
    place-items: center;
    padding: 16px;
}

.chicken-selector-backdrop {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    animation: listing-modal-fade 180ms ease both;
}

.chicken-selector-dialog {
    position: relative;
    z-index: 1;
    width: min(920px, calc(100vw - 32px));
    max-height: min(840px, calc(100dvh - 40px));
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    outline: 0;
    background: #ffffff;
    box-shadow: 0 24px 60px -12px rgba(15, 23, 42, 0.22);
    animation: listing-modal-enter 200ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* Header */
.chicken-selector-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 24px 28px 20px;
    border-bottom: 1px solid #f1f5f9;
    background: #ffffff;
}

.chicken-selector-heading {
    display: flex;
    flex-direction: column;
}

.chicken-selector-header h2 {
    margin: 0;
    font-size: clamp(20px, 2.2vw, 24px);
    font-weight: 800;
    color: #111827;
    line-height: 1.25;
}

.chicken-selector-subtitle {
    margin: 6px 0 0;
    font-size: 13.5px;
    color: #64748b;
    line-height: 1.4;
}

.chicken-selector-close {
    flex: 0 0 44px !important;
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
    aspect-ratio: 1 / 1 !important;
    margin: 0 !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 50% !important;
    background: #ffffff !important;
    color: #475569 !important;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06) !important;
    font-size: 18px !important;
    cursor: pointer !important;
    transition: all 160ms cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.chicken-selector-close:hover {
    background: #111827 !important;
    border-color: #111827 !important;
    color: #ffffff !important;
    transform: rotate(90deg) !important;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.16) !important;
}

.chicken-selector-close:active {
    transform: rotate(90deg) scale(0.92) !important;
}

.chicken-selector-close:focus-visible {
    outline: 2px solid #16a34a !important;
    outline-offset: 2px !important;
}

/* Toolbar & Search */
.chicken-selector-toolbar {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px 28px;
    background: #fafbfc;
    border-bottom: 1px solid #f1f5f9;
}

.chicken-selector-search-box {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
}

.chicken-selector-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 15px;
    pointer-events: none;
    z-index: 2;
}

.chicken-selector-search-input {
    width: 100%;
    height: 44px;
    padding: 0 38px 0 42px;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    background: #ffffff;
    color: #0f172a;
    font-family: inherit;
    font-size: 14px;
    transition: border-color 140ms ease, box-shadow 140ms ease;
    outline: none;
}

.chicken-selector-search-input::placeholder {
    color: #94a3b8;
}

.chicken-selector-search-input:focus {
    border-color: #16a34a;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.12);
}

.chicken-selector-search-clear {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 26px;
    height: 26px;
    padding: 0;
    margin: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: transparent;
    color: #94a3b8;
    font-size: 16px;
    cursor: pointer;
    border-radius: 50%;
    transition: color 120ms ease, transform 120ms ease;
}

.chicken-selector-search-clear:hover {
    color: #475569;
    transform: translateY(-50%) scale(1.1);
}

.chicken-selector-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 13px;
}

.chicken-selector-status {
    font-weight: 600;
    color: #334155;
}

.chicken-selector-instruction {
    font-size: 12.5px;
    color: #64748b;
}

/* Body & Cards Grid */
.chicken-selector-body {
    flex: 1 1 auto;
    padding: 20px 28px;
    overflow-y: auto;
    max-height: 480px;
}

.chicken-selector-body::-webkit-scrollbar {
    width: 6px;
}

.chicken-selector-body::-webkit-scrollbar-track {
    background: #f8fafc;
}

.chicken-selector-body::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.chicken-selector-results {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 14px;
}

/* Chicken Card */
.chicken-selector-card {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 13px;
    width: 100%;
    padding: 13px;
    text-align: left;
    border: 1.5px solid #e2e8f0;
    border-radius: 14px;
    background: #ffffff;
    cursor: pointer;
    outline: none;
    transition: border-color 150ms ease, background-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.chicken-selector-card:hover:not(:disabled):not(.is-selected) {
    border-color: #cbd5e1;
    background: #f8fafc;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
    transform: translateY(-1px);
}

.chicken-selector-card:focus-visible {
    border-color: #16a34a;
    outline: 2px solid #16a34a;
    outline-offset: 2px;
}

/* Card Selected State */
.chicken-selector-card.is-selected {
    border-color: #16a34a;
    background: #f0fdf4;
    box-shadow: 0 0 0 1px #16a34a, 0 6px 18px rgba(22, 163, 74, 0.12);
}

/* Card Disabled State */
.chicken-selector-card:disabled {
    cursor: not-allowed;
    opacity: 0.58;
    background: #f8fafc;
    border-color: #e2e8f0;
    box-shadow: none;
    transform: none;
}

/* Card Image */
.chicken-selector-card-media {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    border-radius: 10px;
    overflow: hidden;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
}

.chicken-selector-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Card Info */
.chicken-selector-card-info {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding-right: 24px; /* avoid check indicator overlap */
}

.chicken-selector-card-name {
    margin: 0;
    font-size: 14.5px;
    font-weight: 700;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.chicken-selector-card-code {
    font-size: 12px;
    font-weight: 500;
    color: #475569;
    display: flex;
    align-items: center;
    gap: 4px;
}

.chicken-selector-card-breed {
    font-size: 11.5px;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.chicken-selector-card-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 7px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    width: fit-content;
    margin-top: 3px;
    line-height: 1.3;
}

.chicken-selector-card-badge--ready {
    background: #dcfce7;
    color: #15803d;
}

.chicken-selector-card-badge--listed {
    background: #fef3c7;
    color: #b45309;
}

/* Card Check Indicator */
.chicken-selector-card-check {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1.5px solid #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    color: transparent;
    font-size: 12px;
    font-weight: 800;
    transition: all 140ms ease;
    pointer-events: none;
}

.chicken-selector-card.is-selected .chicken-selector-card-check {
    border-color: #16a34a;
    background: #16a34a;
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(22, 163, 74, 0.3);
}

.chicken-selector-card:disabled .chicken-selector-card-check {
    opacity: 0.4;
    border-color: #e2e8f0;
}

/* Empty State */
.chicken-selector-empty {
    padding: 44px 24px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.chicken-selector-empty__icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #f1f5f9;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-bottom: 4px;
}

.chicken-selector-empty__title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
}

.chicken-selector-empty__desc {
    margin: 0 0 6px;
    font-size: 13.5px;
    color: #64748b;
    max-width: 320px;
    line-height: 1.45;
}

.chicken-selector-empty__btn {
    padding: 7px 16px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #334155;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 140ms ease;
}

.chicken-selector-empty__btn:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    color: #0f172a;
}

/* Footer */
.chicken-selector-footer {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 28px;
    background: #ffffff;
    border-top: 1px solid #f1f5f9;
}

.chicken-selector-summary {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    min-height: 28px;
}

.chicken-selector-summary__hint {
    color: #64748b;
}

.chicken-selector-summary__selected {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: #ecfdf5;
    color: #15803d;
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 700;
    border: 1px solid #bbf7d0;
}

.chicken-selector-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chicken-selector-btn {
    height: 42px;
    padding: 0 20px;
    border-radius: 10px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 140ms ease;
}

.chicken-selector-btn--secondary {
    border: 1.5px solid #e2e8f0;
    background: #ffffff;
    color: #475569;
}

.chicken-selector-btn--secondary:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #0f172a;
}

.chicken-selector-btn--primary {
    border: 0;
    background: #16a34a;
    color: #ffffff;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.22);
}

.chicken-selector-btn--primary:hover:not(:disabled) {
    background: #15803d;
    box-shadow: 0 6px 16px rgba(22, 163, 74, 0.28);
    transform: translateY(-1px);
}

.chicken-selector-btn--primary:disabled {
    background: #e2e8f0 !important;
    color: #94a3b8 !important;
    cursor: not-allowed !important;
    box-shadow: none !important;
    transform: none !important;
}

/* Responsive */
@media (max-width: 768px) {
    .chicken-selector-dialog {
        width: calc(100vw - 20px);
        max-height: calc(100dvh - 20px);
        border-radius: 16px;
    }

    .chicken-selector-header {
        padding: 16px 20px 14px;
    }

    .chicken-selector-toolbar {
        padding: 12px 20px;
    }

    .chicken-selector-body {
        padding: 16px 20px;
    }

    .chicken-selector-results {
        grid-template-columns: 1fr;
    }

    .chicken-selector-footer {
        padding: 14px 20px;
        flex-direction: column-reverse;
        align-items: stretch;
        gap: 12px;
    }

    .chicken-selector-actions {
        display: grid;
        grid-template-columns: 1fr 1.4fr;
        width: 100%;
    }

    .chicken-selector-btn {
        width: 100%;
    }
}

/* ==================================================
   CHICKEN SALE MODAL — TRANSACTION / LISTING EDITOR
================================================== */
.chicken-sale-dialog {
    position: relative;
    z-index: 1;
    width: min(560px, calc(100vw - 32px));
    margin: auto;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 16px 40px -8px rgba(15, 23, 42, 0.16);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0;
    max-height: calc(100dvh - 32px);
}

/* 1. Header */
.chicken-sale-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 24px 20px;
    border-bottom: 1px solid #f1f5f9;
}

.chicken-sale-title {
    font-size: 20px;
    font-weight: 700;
    color: #111827;
    margin: 0;
    line-height: 1.25;
}

/* 2. Chicken Identity Row */
.chicken-sale-identity-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 24px;
    border-bottom: 1px solid #f1f5f9;
    background: #ffffff;
}

.chicken-sale-identity-media {
    width: 68px;
    height: 68px;
    min-width: 68px;
    border-radius: 10px;
    overflow: hidden;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.chicken-sale-identity-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.chicken-sale-identity-details {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.chicken-sale-identity-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.chicken-sale-identity-name {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chicken-sale-identity-badge {
    display: inline-flex;
    align-items: center;
    padding: 1px 7px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #dcfce7;
    white-space: nowrap;
}

.chicken-sale-identity-code {
    font-size: 13px;
    color: #4b5563;
    display: flex;
    align-items: center;
    gap: 6px;
}

.chicken-sale-identity-sep {
    color: #9ca3af;
}

.chicken-sale-identity-meta {
    font-size: 12px;
    color: #6b7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 3. Price Section */
.chicken-sale-form {
    display: flex;
    flex-direction: column;
    padding: 0;
    margin: 0;
}

.chicken-sale-price-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 20px 24px 0 24px;
}

.chicken-sale-price-label {
    font-size: 13.5px;
    font-weight: 600;
    color: #374151;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    margin: 0;
}

.chicken-sale-required-mark {
    color: #dc2626;
}

.chicken-sale-price-control {
    display: flex;
    align-items: center;
    height: 52px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    background: #ffffff;
    transition: border-color 140ms ease, box-shadow 140ms ease;
    overflow: hidden;
}

.chicken-sale-price-control:focus-within {
    border-color: #17653D;
    box-shadow: 0 0 0 3px rgba(23, 101, 61, 0.14);
}

.chicken-sale-price-prefix {
    padding-left: 16px;
    font-size: 20px;
    font-weight: 600;
    color: #4b5563;
    user-select: none;
}

.chicken-sale-price-field {
    flex: 1 1 auto;
    height: 100%;
    border: none;
    background: transparent;
    padding: 0 16px 0 8px;
    font-family: inherit;
    font-size: 22px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: #111827;
    outline: none;
    -moz-appearance: textfield;
    appearance: textfield;
}

.chicken-sale-price-field::-webkit-inner-spin-button,
.chicken-sale-price-field::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.chicken-sale-price-field::placeholder {
    color: #9ca3af;
    font-weight: 400;
}

.chicken-sale-price-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 18px;
}

.chicken-sale-helper {
    font-size: 12px;
    color: #6b7280;
}

.chicken-sale-formatted-price {
    font-size: 12px;
    font-weight: 600;
    color: #17653D;
    font-variant-numeric: tabular-nums;
}

.chicken-sale-error {
    font-size: 12px;
    font-weight: 500;
    color: #dc2626;
    margin-top: 4px;
    line-height: 1.4;
}

.chicken-sale-error.is-loading {
    color: #1d4ed8;
}


/* 4. Actions */
.chicken-sale-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px 24px 24px 24px;
}

.chicken-sale-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 42px;
    padding: 0 18px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
    user-select: none;
}

.chicken-sale-btn--secondary {
    background: #ffffff;
    border: 1px solid #d1d5db;
    color: #374151;
}

.chicken-sale-btn--secondary:hover {
    background: #f9fafb;
    border-color: #9ca3af;
    color: #111827;
}

.chicken-sale-btn--primary {
    background: #17653D;
    border: 1px solid #17653D;
    color: #ffffff;
}

.chicken-sale-btn--primary:hover:not(:disabled) {
    background: #125231;
    border-color: #125231;
}

.chicken-sale-btn--primary:disabled {
    background: #e5e7eb;
    border-color: #e5e7eb;
    color: #9ca3af;
    cursor: not-allowed;
}

@media (max-width: 640px) {
    .chicken-sale-dialog {
        width: calc(100vw - 24px);
        border-radius: 12px;
    }

    .chicken-sale-header,
    .chicken-sale-identity-row,
    .chicken-sale-price-section,
    .chicken-sale-actions {
        padding-left: 16px;
        padding-right: 16px;
    }

    .chicken-sale-actions {
        padding-bottom: 18px;
    }

    .chicken-sale-btn {
        flex: 1 1 50%;
    }
}

/* ==================================================
   LISTING ACTION MODAL (DETAIL / EDIT / DELETE)
================================================== */
.listing-modal[hidden] {
    display: none !important;
}

.listing-modal {
    position: fixed;
    inset: 0;
    z-index: 2200;
    display: grid;
    place-items: center;
    padding: 20px;
}

.listing-modal-backdrop {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    background: rgba(15, 23, 42, 0.52);
    cursor: default;
    animation: listing-modal-fade 180ms ease both;
}

.listing-modal-dialog {
    position: relative;
    z-index: 1;
    width: min(760px, 100%);
    max-height: min(820px, calc(100dvh - 36px));
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid #e5e7eb;
    border-radius: 24px;
    outline: 0;
    background: #ffffff;
    box-shadow: 0 28px 70px rgba(15, 23, 42, 0.22);
    animation: listing-modal-enter 200ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.listing-modal.is-compact .listing-modal-dialog {
    width: min(470px, 100%);
}

.listing-modal-header {
    padding: 20px 24px 16px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 1px solid #f0f1f3;
}

.listing-modal-heading {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.listing-modal-icon {
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: #f3f4f6;
    color: #374151;
    font-size: 18px;
}

.listing-modal.is-danger .listing-modal-icon {
    background: #fdf2f2;
    color: #a94b4b;
}

.listing-modal-eyebrow {
    margin: 0 0 2px;
    color: #6b7280;
    font-size: 11px;
    font-weight: 700;
}

.listing-modal-header h2 {
    margin: 0;
    color: #111827;
    font-size: clamp(20px, 2.5vw, 23px);
    line-height: 1.3;
}

.listing-modal-subtitle {
    margin: 0;
    color: #6b7280;
    font-size: 12px;
    line-height: 1.5;
}

.listing-modal-subtitle:empty {
    display: none;
}

.listing-modal-close {
    flex: 0 0 46px !important;
    width: 46px !important;
    height: 46px !important;
    min-width: 46px !important;
    min-height: 46px !important;
    aspect-ratio: 1 / 1 !important;
    margin: 0 !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 50% !important;
    background: #ffffff !important;
    color: #374151 !important;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.1) !important;
    font-size: 20px !important;
    cursor: pointer !important;
    transition:
        background-color 140ms ease,
        border-color 140ms ease,
        color 140ms ease,
        transform 160ms cubic-bezier(0.16, 1, 0.3, 1),
        box-shadow 140ms ease !important;
}

.listing-modal-close:hover {
    background: #111827 !important;
    border-color: #111827 !important;
    color: #ffffff !important;
    transform: rotate(90deg) !important;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.18) !important;
}

.listing-modal-close:active {
    transform: rotate(90deg) scale(0.92) !important;
}

.listing-modal-close:focus-visible {
    outline: 3px solid rgba(242, 101, 34, 0.24) !important;
    outline-offset: 2px !important;
}

.listing-modal-body {
    min-height: 0;
    padding: 20px 24px;
    overflow-y: auto;
}

.listing-modal-message {
    min-height: 0;
    margin: 0;
    padding: 0 24px;
    color: #a94b4b;
    font-size: 13px;
    font-weight: 600;
}

.listing-modal-message:not(:empty) {
    padding-bottom: 14px;
}

.listing-modal-footer {
    min-height: 68px;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
    border-top: 1px solid #f0f1f3;
    background: #ffffff;
}

.listing-modal-button {
    min-height: 44px;
    padding: 0 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: #111827;
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.16s ease, background-color 0.16s ease, border-color 0.16s ease;
}

.listing-modal-button:hover:not(:disabled) {
    transform: translateY(-1px);
    background: #273244;
}

.listing-modal-button.is-secondary {
    border-color: #e5e7eb;
    background: #ffffff;
    color: #374151;
}

.listing-modal-button.is-secondary:hover:not(:disabled) {
    border-color: #cbd0d8;
    background: #f8fafc;
}

.listing-modal-button.is-primary {
    background: #2e7d32;
}

.listing-modal-button.is-primary:hover:not(:disabled) {
    background: #256b29;
}

.listing-modal-button.is-danger {
    background: #a94b4b;
}

.listing-modal-button.is-danger:hover:not(:disabled) {
    background: #923f3f;
}

.listing-modal-button:disabled,
.listing-modal-close:disabled {
    cursor: wait;
    opacity: 0.58;
    transform: none;
}

.listing-modal-hero {
    display: grid;
    grid-template-columns: 140px minmax(0, 1fr);
    align-items: center;
    gap: 16px;
    padding: 14px;
    margin-bottom: 16px;
    border: 1px solid #eceef1;
    border-radius: 18px;
    background: #fafafa;
}

.listing-modal-hero img {
    width: 140px;
    height: 125px;
    display: block;
    object-fit: cover;
    border-radius: 14px;
    background: #eef0f3;
}

.listing-modal-hero-copy h3 {
    margin: 0 0 4px;
    color: #111827;
    font-size: 20px;
}

.listing-modal-hero-copy p {
    margin: 0;
    color: #6b7280;
    font-size: 13px;
}

.listing-modal-hero-copy .listing-status {
    margin-top: 10px;
    box-shadow: none;
}

/* ==================================================
   LISTING DETAIL MODAL — MARKETPLACE PRODUCT DETAIL
   Scoped so edit and confirmation modals retain their existing UI.
================================================== */
.listing-modal:is(.is-detail, .is-edit) .listing-modal-backdrop {
    background: rgba(7, 16, 8, 0.48);
}

.listing-modal:is(.is-detail, .is-edit) .listing-modal-dialog {
    width: min(960px, 100%);
    max-height: min(860px, 90dvh);
    border-color: #e3e9e5;
    border-radius: 16px;
    box-shadow: 0 20px 54px rgba(7, 16, 8, 0.18);
}

.listing-modal:is(.is-detail, .is-edit) .listing-modal-header {
    padding: 18px 24px 16px;
    align-items: flex-start;
    border-bottom-color: #e9eeeb;
}

.listing-modal:is(.is-detail, .is-edit) .listing-modal-heading {
    gap: 0;
}

.listing-modal:is(.is-detail, .is-edit) .listing-modal-icon {
    display: none;
}

.listing-modal:is(.is-detail, .is-edit) .listing-modal-eyebrow {
    margin-bottom: 3px;
    color: #66736c;
    font-size: 11px;
    letter-spacing: 0;
}

.listing-modal:is(.is-detail, .is-edit) .listing-modal-header h2 {
    color: #172019;
    font-size: 20px;
    letter-spacing: -0.015em;
}

.listing-modal:is(.is-detail, .is-edit) .listing-modal-subtitle {
    margin: 3px 0 0;
    color: #66736c;
    font-size: 12px;
    line-height: 1.5;
}

/* Standardized close button inherited from Master Reference (.listing-modal-close) */

.listing-modal:is(.is-detail, .is-edit) .listing-modal-body {
    padding: 24px;
    scrollbar-width: thin;
    scrollbar-color: #cbd7cf transparent;
}

.listing-modal:is(.is-detail, .is-edit) .listing-modal-body::-webkit-scrollbar {
    width: 8px;
}

.listing-modal:is(.is-detail, .is-edit) .listing-modal-body::-webkit-scrollbar-thumb {
    border: 2px solid #ffffff;
    border-radius: 999px;
    background: #cbd7cf;
}

.listing-modal:is(.is-detail, .is-edit) .listing-modal-footer {
    min-height: 60px;
    padding: 8px 24px;
    border-top-color: #e9eeeb;
}

.listing-modal:is(.is-detail, .is-edit) .listing-modal-button.is-secondary {
    flex: 0 0 auto;
    min-width: 84px;
    min-height: 44px;
    padding: 0 18px;
    border-color: #d8e1db;
    border-radius: 12px;
    background: #ffffff;
    color: #314239;
    box-shadow: none;
}

.listing-modal:is(.is-detail, .is-edit) .listing-modal-button.is-secondary:hover:not(:disabled) {
    transform: none;
    border-color: #b9c9be;
    background: #f7f9f7;
    color: #183f2c;
}

.listing-modal:is(.is-detail, .is-edit) .listing-modal-button:focus-visible,
.listing-modal:is(.is-detail, .is-edit) .listing-modal-close:focus-visible {
    outline: 3px solid rgba(24, 63, 44, 0.22);
    outline-offset: 2px;
}

.listing-detail-hero {
    display: grid;
    grid-template-columns: minmax(280px, 0.8fr) minmax(0, 1.2fr);
    gap: 28px;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid #e9eeeb;
}

.listing-detail-image-wrap {
    min-width: 0;
    height: 250px;
    overflow: hidden;
    border-radius: 14px;
    background: #f4f6f8;
}

.listing-detail-image-wrap img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.listing-detail-summary {
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.listing-detail-summary-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.listing-detail-summary h3 {
    min-width: 0;
    margin: 0;
    color: #172019;
    font-size: clamp(30px, 3.4vw, 38px);
    line-height: 1.15;
    letter-spacing: -0.025em;
    overflow-wrap: anywhere;
}

.listing-detail-summary .listing-status {
    flex: 0 0 auto;
    min-height: 28px;
    margin: 2px 0 0;
    padding: 4px 10px;
    font-size: 11px;
    box-shadow: none;
}

.listing-detail-code {
    margin: 10px 0 0;
    color: #526158;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.025em;
}

.listing-detail-breed-line {
    margin: 4px 0 0;
    color: #66736c;
    font-size: 14px;
    line-height: 1.5;
}

.listing-detail-price {
    margin-top: 18px;
}

.listing-detail-price span,
.listing-detail-location-line span {
    display: block;
    color: #66736c;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.45;
}

.listing-detail-price strong {
    display: block;
    margin-top: 2px;
    color: #183f2c;
    font-size: clamp(28px, 3vw, 34px);
    line-height: 1.15;
    letter-spacing: -0.025em;
}

.listing-detail-location-line {
    margin-top: 16px;
    display: flex;
    align-items: flex-start;
    gap: 9px;
    color: #66736c;
}

.listing-detail-location-line i {
    margin-top: 2px;
    color: #183f2c;
    font-size: 16px;
}

.listing-detail-location-line strong {
    display: block;
    margin-top: 2px;
    color: #314239;
    font-size: 13px;
    font-weight: 650;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.listing-detail-section-title {
    margin: 0 0 14px;
    color: #172019;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.listing-detail-key-section {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid #e9eeeb;
}

.listing-detail-info-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: 32px;
    row-gap: 18px;
}

.listing-detail-info-item {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.listing-detail-info-item span,
.listing-detail-meta-item span {
    color: #66736c;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.45;
}

.listing-detail-info-item strong {
    color: #26342a;
    font-size: 14px;
    font-weight: 650;
    line-height: 1.5;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.listing-detail-additional {
    display: block;
}

.listing-detail-description p {
    max-width: 72ch;
    margin: 0;
    color: #526158;
    font-size: 14px;
    line-height: 1.7;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.listing-detail-meta-grid {
    margin-top: 22px;
    padding-top: 18px;
    display: flex;
    flex-wrap: wrap;
    gap: 18px 40px;
    border-top: 1px solid #e9eeeb;
}

.listing-detail-meta-item {
    min-width: 150px;
    display: grid;
    gap: 3px;
}

.listing-detail-meta-item strong {
    color: #314239;
    font-size: 13px;
    font-weight: 650;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

/* Edit listing inherits the approved detail shell, with a form-first interior. */
.listing-modal.is-edit .listing-modal-dialog {
    width: min(760px, 100%);
}

.listing-modal.is-edit .listing-modal-button.is-primary {
    flex: 0 0 auto;
    min-height: 44px;
    padding: 0 18px;
    border-radius: 12px;
    background: #183f2c;
    color: #ffffff;
    box-shadow: none;
}

.listing-modal.is-edit .listing-modal-button.is-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    background: #102f20;
}

.listing-modal.is-edit .listing-modal-dialog[aria-busy="true"] .listing-modal-message {
    color: #66736c;
}

.listing-edit-chicken-summary {
    display: grid;
    grid-template-columns: 84px minmax(0, 1fr) minmax(200px, 0.9fr);
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    padding: 14px;
    border-radius: 14px;
    background: #f7f9f7;
}

.listing-edit-chicken-summary img {
    width: 84px;
    height: 76px;
    display: block;
    object-fit: cover;
    border-radius: 12px;
    background: #eef2ef;
}

.listing-edit-chicken-copy {
    min-width: 0;
}

.listing-edit-chicken-copy h3 {
    margin: 0;
    color: #172019;
    font-size: 18px;
    line-height: 1.35;
    letter-spacing: -0.015em;
    overflow-wrap: anywhere;
}

.listing-edit-chicken-copy p {
    margin: 2px 0 0;
    color: #66736c;
    font-size: 12px;
    line-height: 1.5;
}

.listing-edit-chicken-copy .listing-edit-chicken-code {
    margin-top: 5px;
    color: #314239;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.listing-edit-chicken-note {
    margin: 0;
    color: #66736c;
    font-size: 11px;
    line-height: 1.65;
}

.listing-edit-form {
    display: grid;
    gap: 24px;
}

.listing-edit-section {
    min-width: 0;
}

.listing-edit-section + .listing-edit-section {
    padding-top: 22px;
    border-top: 1px solid #e9eeeb;
}

.listing-edit-section > h3,
.listing-edit-section-heading h3 {
    margin: 0 0 14px;
    color: #172019;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.45;
    letter-spacing: -0.01em;
}

.listing-edit-section-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
}

.listing-edit-section-heading span {
    flex: 0 0 auto;
    color: #66736c;
    font-size: 11px;
    font-variant-numeric: tabular-nums;
}

.listing-edit-field-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
    gap: 16px;
}

.listing-edit-field {
    min-width: 0;
    display: grid;
    align-content: start;
    gap: 7px;
}

.listing-edit-field label {
    color: #314239;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.45;
}

.listing-required-mark {
    color: #b93f3f;
}

.listing-edit-form input,
.listing-edit-form textarea {
    width: 100%;
    border: 1px solid #d8e1db;
    border-radius: 10px;
    outline: 0;
    background: #ffffff;
    color: #172019;
    caret-color: #183f2c;
    font: inherit;
    font-size: 13px;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

.listing-edit-form input {
    height: 44px;
    padding: 0 13px;
}

.listing-edit-form textarea {
    min-height: 118px;
    padding: 11px 13px;
    line-height: 1.65;
    resize: vertical;
}

.listing-edit-form input:hover:not(:disabled),
.listing-edit-form textarea:hover:not(:disabled) {
    border-color: #bcc9c0;
}

.listing-edit-form input:focus,
.listing-edit-form textarea:focus {
    border-color: #183f2c;
    box-shadow: 0 0 0 3px rgba(24, 63, 44, 0.12);
}

.listing-edit-form input.is-invalid,
.listing-edit-form textarea.is-invalid {
    border-color: #c86a6a;
    box-shadow: 0 0 0 3px rgba(185, 63, 63, 0.08);
}

.listing-edit-form input:disabled,
.listing-edit-form textarea:disabled {
    cursor: wait;
    background: #f4f6f4;
    color: #66736c;
}

.listing-edit-price-control {
    position: relative;
}

.listing-edit-price-control > span {
    position: absolute;
    z-index: 1;
    top: 50%;
    left: 13px;
    color: #66736c;
    font-size: 13px;
    font-weight: 600;
    transform: translateY(-50%);
    pointer-events: none;
}

.listing-edit-price-control input {
    padding-left: 32px;
    font-variant-numeric: tabular-nums;
}

.listing-edit-description-label {
    color: #66736c !important;
    font-size: 12px !important;
    font-weight: 500 !important;
}

.listing-edit-error {
    min-height: 16px;
    color: #b93f3f;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.45;
}

.listing-save-spinner {
    width: 15px;
    height: 15px;
    border: 2px solid rgba(255, 255, 255, 0.42);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: listing-save-spin 0.7s linear infinite;
}

@keyframes listing-save-spin {
    to { transform: rotate(360deg); }
}

.listing-confirm-copy {
    padding: 6px 0;
    text-align: center;
}

.listing-confirm-copy strong {
    display: block;
    color: #111827;
    font-size: 17px;
    line-height: 1.6;
}

.listing-confirm-copy p {
    margin: 10px 0 0;
    color: #6b7280;
    font-size: 13px;
    line-height: 1.6;
}

/* ==================================================
   TOAST NOTIFICATIONS
================================================== */
.listing-toast-region {
    position: fixed;
    z-index: 2400;
    right: 20px;
    bottom: 20px;
    display: grid;
    gap: 8px;
    pointer-events: none;
}

.listing-toast {
    min-width: min(320px, calc(100vw - 32px));
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid #dce4dd;
    border-radius: 14px;
    background: #ffffff;
    color: #245c28;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.14);
    font-size: 13px;
    font-weight: 700;
    animation: listing-toast-in 180ms ease both;
}

.listing-toast.is-error {
    border-color: #ecdada;
    color: #8f4444;
}

/* Body Scroll Lock */
body:has(.chicken-selector-modal:not([hidden])),
body:has(.listing-modal:not([hidden])) {
    overflow: hidden;
}

/* Animations */
@keyframes listing-modal-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes listing-modal-enter {
    from { opacity: 0; transform: scale(0.975) translateY(6px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

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

/* ==================================================
   RESPONSIVE BREAKPOINTS
================================================== */

/* Small Desktop / Large Tablet */
@media (max-width: 1100px) {
    .listing-summary-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* Tablet */
@media (max-width: 900px) {
    #sidebar,
    .sidebar {
        z-index: 1000 !important;
    }

    #sidebar-overlay,
    .sidebar-overlay {
        z-index: 999 !important;
    }

    .mobile-sidebar-button {
        display: grid;
    }

    .self-market-dashboard-page .owner-market-main {
        padding: 20px 0 44px;
    }

    .owner-listing-card {
        grid-template-columns: 156px minmax(0, 1fr);
        min-height: 154px;
    }

    .listing-image-panel {
        min-height: 154px;
    }

    .listing-content {
        padding-right: 14px;
        padding-left: 14px;
    }

    .action-btn {
        padding-right: 11px;
        padding-left: 11px;
    }
}

/* Mobile: 700px and below */
@media (max-width: 700px) {
    .listing-summary-grid {
        display: flex !important;
        flex-flow: row nowrap !important;
        align-items: stretch !important;
        gap: 6px !important;
        width: 100% !important;
        max-width: 100% !important;
        margin-bottom: 16px !important;
        box-sizing: border-box !important;
        overflow: visible !important;
    }

    .listing-summary-card {
        position: relative !important;
        display: flex !important;
        flex: 1 1 0 !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 2px !important;
        width: auto !important;
        min-width: 0 !important;
        min-height: 84px !important;
        padding: 8px 3px !important;
        border: 1px solid #e3e9e5 !important;
        border-radius: 12px !important;
        background: #ffffff !important;
        color: #171b18 !important;
        box-shadow: 0 4px 12px rgba(22, 35, 27, 0.05) !important;
        text-align: center !important;
        overflow: hidden !important;
    }

    .listing-summary-card:hover {
        transform: none !important;
    }

    .listing-summary-card.is-active {
        border-color: #17653D !important;
        background: #17653D !important;
        color: #ffffff !important;
        box-shadow: 0 5px 14px rgba(23, 101, 61, 0.2) !important;
    }

    .listing-summary-title {
        font-size: 10.5px !important;
        font-weight: 600 !important;
        line-height: 1.15 !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        max-width: 100% !important;
        color: #64748b !important;
        order: 3 !important;
        margin-top: 2px !important;
    }

    .desktop-summary-title {
        display: none !important;
    }

    .mobile-summary-title {
        display: inline !important;
    }

    .listing-summary-card.is-active .listing-summary-title {
        color: rgba(255, 255, 255, 0.9) !important;
    }

    .listing-summary-number {
        font-size: 19px !important;
        font-weight: 750 !important;
        line-height: 1.05 !important;
        color: #171b18 !important;
        order: 2 !important;
        margin: 0 !important;
        font-variant-numeric: tabular-nums !important;
    }

    .listing-summary-card.is-active .listing-summary-number {
        color: #ffffff !important;
    }

    .listing-summary-footer {
        order: 1 !important;
        margin: 0 0 2px 0 !important;
        color: inherit !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
    }

    .listing-summary-change {
        padding: 0 !important;
        background: transparent !important;
        color: #17653D !important;
        font-size: 0 !important;
        gap: 0 !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .listing-summary-change i {
        font-size: 16px !important;
        line-height: 1 !important;
    }

    .listing-summary-card.is-active .listing-summary-change {
        color: #ffffff !important;
        background: transparent !important;
    }

    .listing-summary-card:last-child {
        grid-column: auto !important;
    }

    /* Filter Toolbar Grid on Mobile */
    .self-market-dashboard-page .owner-filter-section .dashboard-filter-toolbar {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 8px !important;
        width: 100% !important;
    }

    .self-market-dashboard-page .owner-filter-section .dashboard-filter-search-slot,
    .self-market-dashboard-page .owner-filter-section .dashboard-filter-search-slot:hover,
    .self-market-dashboard-page .owner-filter-section .dashboard-filter-search-slot:focus-within {
        grid-column: 1 / -1 !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
        flex: 1 1 100% !important;
    }

    .self-market-dashboard-page .owner-filter-section .dashboard-filter-search-slot .dashboard-filter-search,
    .self-market-dashboard-page .owner-filter-section .dashboard-filter-search-slot:hover .dashboard-filter-search,
    .self-market-dashboard-page .owner-filter-section .dashboard-filter-search-slot:focus-within .dashboard-filter-search {
        position: relative !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
    }

    .self-market-dashboard-page .owner-filter-section #listing-search-input {
        width: 100% !important;
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
        transform: none !important;
    }

    .self-market-dashboard-page .owner-filter-section .dashboard-filter-capsule,
    .self-market-dashboard-page .owner-filter-section [data-custom-dropdown].dashboard-filter-capsule,
    .self-market-dashboard-page .owner-filter-section .dashboard-filter-capsule:nth-of-type(2),
    .self-market-dashboard-page .owner-filter-section .dashboard-filter-capsule:nth-of-type(3),
    .self-market-dashboard-page .owner-filter-section .dashboard-filter-capsule:nth-of-type(4),
    .self-market-dashboard-page .owner-filter-section .dashboard-filter-capsule:nth-of-type(5) {
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
        flex: none !important;
    }

    /* Left column (even children 2 and 4): menu anchors left */
    .self-market-dashboard-page .owner-filter-section .dashboard-filter-capsule:nth-child(even) .custom-dropdown-menu {
        left: 0 !important;
        right: auto !important;
    }

    /* Right column (odd children 3 and 5): menu anchors right */
    .self-market-dashboard-page .owner-filter-section .dashboard-filter-capsule:nth-child(odd) .custom-dropdown-menu {
        left: auto !important;
        right: 0 !important;
    }
}

/* Detail modal tablet layout */
@media (max-width: 900px) {
    .listing-modal.is-detail .listing-detail-hero {
        grid-template-columns: minmax(240px, 0.72fr) minmax(0, 1.28fr);
        gap: 24px;
    }

    .listing-modal.is-detail .listing-detail-image-wrap,
    .listing-modal.is-detail .listing-detail-image-wrap img {
        height: 230px;
    }
}

/* Mobile: 640px and below */
@media (max-width: 640px) {
    .self-market-dashboard-page .owner-market-main {
        padding: 14px 0 36px;
    }

    .self-market-dashboard-page .dashboard-topbar {
        position: static !important;
        top: auto !important;
        background: transparent !important;
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) auto !important;
        grid-template-rows: 44px auto auto !important;
        align-items: center !important;
        gap: 12px 8px !important;
        width: 100% !important;
        padding: 0 0 4px 0 !important;
    }

    .self-market-dashboard-page .self-market-topbar-heading {
        display: contents !important;
    }

    .self-market-dashboard-page .mobile-sidebar-button {
        grid-column: 1 !important;
        grid-row: 1 !important;
        justify-self: start !important;
        display: inline-grid !important;
        place-items: center !important;
        width: 44px !important;
        height: 44px !important;
        min-width: 44px !important;
        min-height: 44px !important;
        border-radius: 12px !important;
        background: #ffffff !important;
        color: #111827 !important;
        border: 1px solid #e3e9e5 !important;
        box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05) !important;
        font-size: 20px !important;
        cursor: pointer !important;
    }

    .self-market-dashboard-page .self-market-topbar-heading > div {
        grid-column: 1 / -1 !important;
        grid-row: 2 !important;
        margin-top: 2px !important;
        min-width: 0 !important;
    }

    .self-market-dashboard-page .self-market-topbar-heading h1 {
        font-size: clamp(20px, 5.8vw, 24px) !important;
        font-weight: 700 !important;
        line-height: 1.25 !important;
        margin: 0 !important;
        color: #111827 !important;
    }

    .self-market-dashboard-page .self-market-topbar-heading p {
        font-size: 13px !important;
        margin: 3px 0 0 0 !important;
        color: #6b7280 !important;
    }

    .self-market-dashboard-page .topbar-actions {
        display: contents !important;
    }

    .self-market-dashboard-page .topbar-quick-actions {
        grid-column: 2 !important;
        grid-row: 1 !important;
        justify-self: end !important;
        display: flex !important;
        align-items: center !important;
        justify-content: flex-end !important;
        gap: 6px !important;
        width: auto !important;
        min-width: 0 !important;
    }

    .self-market-dashboard-page .topbar-quick-actions .icon-btn,
    .self-market-dashboard-page .topbar-quick-actions .user-profile {
        flex: 0 0 42px !important;
        width: 42px !important;
        min-width: 42px !important;
        height: 42px !important;
        min-height: 42px !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .self-market-dashboard-page .topbar-quick-actions .icon-btn {
        font-size: 15px !important;
    }

    .self-market-dashboard-page .topbar-quick-actions .user-profile {
        display: grid !important;
        place-items: center !important;
        border-radius: 50% !important;
    }

    .self-market-dashboard-page .topbar-quick-actions .user-avatar {
        flex: none !important;
        width: 38px !important;
        height: 38px !important;
    }

    .self-market-dashboard-page .topbar-quick-actions .user-info {
        display: none !important;
    }

    .self-market-dashboard-page .topbar-create-listing {
        grid-column: 1 / -1 !important;
        grid-row: 3 !important;
        width: 100% !important;
        min-height: 44px !important;
        font-size: 14px !important;
        border-radius: 12px !important;
        margin-top: 4px !important;
    }

    .section-header {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 6px !important;
        margin-bottom: 12px !important;
        width: 100% !important;
    }

    .reset-filter-btn {
        order: 1 !important;
        align-self: flex-end !important;
        min-height: 28px !important;
        height: 28px !important;
        padding: 0 10px !important;
        font-size: 11px !important;
        font-weight: 600 !important;
        border-radius: 999px !important;
        white-space: nowrap !important;
        gap: 4px !important;
        width: auto !important;
    }

    .section-header > div {
        order: 2 !important;
        width: 100% !important;
        min-width: 0 !important;
    }

    .section-header h2 {
        font-size: 15px !important;
        font-weight: 700 !important;
        line-height: 1.3 !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        margin: 0 !important;
    }

    .section-header .section-subtitle {
        font-size: 11px !important;
        line-height: 1.3 !important;
        color: #64748b !important;
        margin: 2px 0 0 0 !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    /* Owner Listing Grid: 2 คอลัมน์บนมือถือ */
    .owner-listing-grid {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 10px !important;
    }

    .owner-listing-card {
        display: flex !important;
        flex-direction: column !important;
        min-height: auto !important;
        border-radius: 14px !important;
        overflow: hidden !important;
        border: 1px solid #e3e9e5 !important;
        background: #ffffff !important;
        box-shadow: 0 4px 12px rgba(22, 35, 27, 0.04) !important;
    }

    .listing-image-panel {
        width: 100% !important;
        height: 130px !important;
        min-height: 130px !important;
        position: relative !important;
        overflow: hidden !important;
        aspect-ratio: auto !important;
    }

    .listing-image-panel img {
        position: absolute !important;
        inset: 0 !important;
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
    }

    .listing-content {
        padding: 8px 6px 10px !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 3px !important;
        flex: 1 1 auto !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
    }

    .listing-main-row {
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 2px !important;
        width: 100% !important;
        min-width: 0 !important;
    }

    .listing-title {
        width: 100% !important;
        min-width: 0 !important;
    }

    .listing-title h3 {
        font-size: 13px !important;
        font-weight: 700 !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        line-height: 1.25 !important;
        margin: 0 !important;
    }

    .listing-title p {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 2px 3px !important;
        font-size: 9.5px !important;
        color: #64748b !important;
        margin: 2px 0 0 0 !important;
        line-height: 1.2 !important;
    }

    .listing-title p span {
        background: #f1f5f3 !important;
        padding: 1px 4px !important;
        border-radius: 4px !important;
        font-size: 9px !important;
        white-space: nowrap !important;
        max-width: 100% !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    .listing-price {
        font-size: 13.5px !important;
        font-weight: 750 !important;
        color: #17653D !important;
        margin-top: 1px !important;
    }

    .listing-meta-line {
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        justify-content: flex-start !important;
        gap: 2px !important;
        font-size: 9.5px !important;
        color: #64748b !important;
        margin: 2px 0 !important;
        min-width: 0 !important;
        width: 100% !important;
        overflow: hidden !important;
        text-align: left !important;
    }

    .listing-meta-entry {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
        gap: 3px !important;
        font-size: 9.5px !important;
        min-width: 0 !important;
        width: 100% !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        text-align: left !important;
    }

    .listing-meta-entry + .listing-meta-entry::before {
        display: none !important;
        content: none !important;
        margin: 0 !important;
    }

    .listing-meta-entry i {
        font-size: 10px !important;
        flex-shrink: 0 !important;
    }

    .listing-meta-skeleton-row {
        grid-template-columns: 1fr;
    }

    .listing-actions {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 4px !important;
        width: 100% !important;
        margin-top: auto !important;
        padding-top: 4px !important;
        box-sizing: border-box !important;
    }

    .action-btn {
        min-height: 28px !important;
        height: 28px !important;
        padding: 0 4px !important;
        font-size: 10px !important;
        font-weight: 600 !important;
        border-radius: 6px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        text-align: center !important;
        white-space: nowrap !important;
        line-height: 1 !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    .action-btn i {
        display: none !important;
    }

    /* If only 1 action button exists or 3rd button, span full width */
    .listing-actions .action-btn:only-child,
    .listing-actions .action-btn:nth-child(3):last-child {
        grid-column: 1 / -1 !important;
    }

    /* Modals Responsive */
    .listing-modal,
    .chicken-selector-modal {
        padding: 12px;
    }

    .listing-modal-dialog {
        width: 100%;
        max-height: calc(100dvh - 24px);
        border-radius: 20px;
    }

    .listing-modal-header,
    .listing-modal-body,
    .listing-modal-footer {
        padding-right: 16px;
        padding-left: 16px;
    }

    .listing-modal-message {
        padding-right: 16px;
        padding-left: 16px;
    }

    .listing-modal-hero {
        grid-template-columns: 90px minmax(0, 1fr);
        gap: 12px;
    }

    .listing-modal-hero img {
        width: 90px;
        height: 90px;
    }

    .listing-modal-footer {
        align-items: stretch;
    }

    .listing-modal-button {
        flex: 1 1 auto;
    }



    .listing-toast-region {
        right: 14px;
        bottom: 14px;
        left: 14px;
    }

    .listing-toast {
        width: 100%;
        min-width: 0;
    }

    /* Detail modal: marketplace composition for narrow screens. */
    .listing-modal:is(.is-detail, .is-edit) .listing-modal-header {
        padding: 16px 18px 14px;
    }

    .listing-modal:is(.is-detail, .is-edit) .listing-modal-body {
        padding: 18px;
    }

    .listing-modal:is(.is-detail, .is-edit) .listing-modal-footer {
        min-height: 58px;
        padding: 7px 18px;
    }

    .listing-modal.is-detail .listing-detail-hero {
        grid-template-columns: 1fr;
        gap: 18px;
        margin-bottom: 20px;
        padding-bottom: 20px;
    }

    .listing-modal.is-detail .listing-detail-image-wrap,
    .listing-modal.is-detail .listing-detail-image-wrap img {
        height: 210px;
    }

    .listing-modal.is-detail .listing-detail-summary h3 {
        font-size: clamp(26px, 8vw, 32px);
    }

    .listing-modal.is-detail .listing-detail-summary-heading {
        gap: 10px;
    }

    .listing-modal.is-detail .listing-detail-info-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: 20px;
        row-gap: 16px;
    }

    .listing-modal.is-detail .listing-detail-meta-grid {
        gap: 16px 24px;
    }

    .listing-modal.is-detail .listing-modal-button.is-secondary {
        min-width: 84px;
    }

    .listing-modal.is-edit .listing-edit-chicken-summary {
        grid-template-columns: 72px minmax(0, 1fr);
        gap: 12px;
        margin-bottom: 20px;
        padding: 12px;
    }

    .listing-modal.is-edit .listing-edit-chicken-summary img {
        width: 72px;
        height: 68px;
    }

    .listing-modal.is-edit .listing-edit-chicken-note {
        grid-column: 1 / -1;
    }

    .listing-modal.is-edit .listing-edit-field-grid {
        grid-template-columns: 1fr;
    }

    .listing-modal.is-edit .listing-modal-footer {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .listing-modal.is-edit .listing-modal-button.is-primary,
    .listing-modal.is-edit .listing-modal-button.is-secondary {
        width: 100%;
        min-width: 0;
    }

}

/* Small Mobile: 480px and below */
@media (max-width: 480px) {
    .pagination {
        gap: 6px;
    }

    .pagination-nav {
        min-width: 44px;
        width: 44px;
        padding: 0;
    }

    .pagination-nav span {
        display: none;
    }

    .pagination-nav i {
        font-size: 16px;
    }

    .pagination-page {
        min-width: 40px;
        height: 44px;
        padding: 0 6px;
        font-size: 12px;
    }

    .pagination-dots {
        min-width: 24px;
        font-size: 12px;
    }
}

/* Very Small Mobile: 380px and below */
@media (max-width: 380px) {
    .listing-summary-grid {
        gap: 4px !important;
    }

    .listing-summary-card {
        padding: 6px 2px !important;
        min-height: 78px !important;
    }

    .listing-summary-title {
        font-size: 9.5px !important;
    }

    .listing-summary-number {
        font-size: 16px !important;
    }

    .self-market-dashboard-page .owner-filter-section .dashboard-filter-toolbar {
        grid-template-columns: 1fr !important;
    }

    .self-market-dashboard-page .owner-filter-section .dashboard-filter-capsule .custom-dropdown-menu,
    .self-market-dashboard-page .owner-filter-section .dashboard-filter-capsule:nth-child(odd) .custom-dropdown-menu,
    .self-market-dashboard-page .owner-filter-section .dashboard-filter-capsule:nth-child(even) .custom-dropdown-menu {
        left: 0 !important;
        right: 0 !important;
        min-width: 0 !important;
        max-width: 100% !important;
    }

    .listing-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 3px !important;
    }

    .action-btn {
        padding: 0 2px !important;
        font-size: 9.5px !important;
        min-height: 26px !important;
        height: 26px !important;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }

    .reveal {
        opacity: 1 !important;
        transform: none !important;
    }
}
