/* ========================================================================== 
   HPA PARTNER LISTINGS 1.2.3 — shared palette and scope
   ========================================================================== */
.hpc-pl {
    --pl-ink: #292d31;
    --pl-muted: #6d685f;
    --pl-gold: #92713b;
    --pl-paper: #faf8f3;
    --pl-line: #dfd6c5;
    color: var(--pl-ink);
    line-height: 1.55;
}
.hpc-pl *, .hpc-pl *::before, .hpc-pl *::after { box-sizing: border-box; }
.hpc-pl [hidden], [data-hpc-partner-tab][hidden] { display: none !important; }
.hpc-pl h2, .hpc-pl h3 { color: var(--pl-ink); }
.hpc-pl-eyebrow { font-size: 11px; letter-spacing: .1em; color: var(--pl-gold); }
.hpc-pl-help, .hpc-pl small { color: var(--pl-muted); font-size: 13px; }
.hpc-pl button, .hpc-pl-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 17px;
    border: 1px solid var(--pl-gold);
    border-radius: 4px;
    background: var(--pl-gold);
    color: #fff;
    font: inherit;
    font-size: 14px;
    line-height: 1.3;
    text-decoration: none;
    cursor: pointer;
}
.hpc-pl button:hover, .hpc-pl-button:hover { background: #775a2d; color: #fff; }
.hpc-pl button.hpc-pl-secondary, .hpc-pl a.hpc-pl-secondary { background: transparent; color: var(--pl-gold); }
.hpc-pl :is(button, a, input, select, summary):focus-visible { outline: 3px solid #3574a0; outline-offset: 3px; }
.hpc-pl [aria-busy="true"], .hpc-pl[aria-busy="true"] { opacity: .65; }
.hpc-pl-error { color: #9a2424 !important; }
.hpc-pl-notice, .hpc-pl-message { padding: 14px 18px; border: 1px solid var(--pl-line); background: var(--pl-paper); }

/* ========================================================================== 
   1. Partner cabinet — heading, counters and form
   ========================================================================== */
.hpc-pl-heading { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin-bottom: 18px; }
.hpc-pl-heading h2 { margin: 3px 0 0; }
.hpc-pl-heading p { margin: 0; }
.hpc-pl-status-counts { display: flex; flex-wrap: wrap; gap: 8px; margin: 24px 0; }
.hpc-pl-status-counts button { background: var(--pl-paper); color: var(--pl-ink); border-color: var(--pl-line); gap: 8px; }
.hpc-pl-status-counts strong { color: var(--pl-gold); font-size: 20px; }
.hpc-pl-editor { padding: 22px; margin: 22px 0; border: 1px solid var(--pl-line); border-radius: 6px; background: var(--pl-paper); }
.hpc-pl-editor summary { cursor: pointer; font-size: 18px; font-weight: 600; }
.hpc-pl-editor[open] summary { margin-bottom: 22px; }
.hpc-pl-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.hpc-pl label { display: block; font-size: 14px; font-weight: 600; }
.hpc-pl label span, .hpc-pl label small { font-weight: 400; }
.hpc-pl :is(input:not([type="checkbox"]), select) { display: block; width: 100%; max-width: 100%; min-height: 42px; padding: 9px 12px; margin: 6px 0; border: 1px solid #c9c5bc; border-radius: 3px; color: var(--pl-ink); background: #fff; font: inherit; font-size: 14px; }
.hpc-pl input[type="file"] { padding: 8px; }
.hpc-pl input[type="checkbox"] { width: 18px; height: 18px; min-width: 18px; margin: 3px 0 0; accent-color: var(--pl-gold); }
.hpc-pl .hpc-pl-check { display: flex; align-items: flex-start; gap: 10px; margin: 20px 0; font-weight: 400; }
.hpc-pl-catalogue { grid-column: 1 / -1; padding: 16px; border: 1px solid var(--pl-line); background: #fff; }
.hpc-pl-selectors { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 18px; }
.hpc-pl-selectors label:last-child { grid-column: 1 / -1; }
.hpc-pl-selected-title { font-weight: 600; margin-bottom: 0; }
.hpc-pl-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
.hpc-pl-edit-image { max-width: 120px; height: 80px; object-fit: contain; }

/* ========================================================================== 
   2. Partner cabinet — filters, listings table, bulk controls and pages
   ========================================================================== */
.hpc-pl-filters { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 14px; margin: 25px 0 16px; }
.hpc-pl-filters label { flex: 1; min-width: 150px; }
.hpc-pl-filters button { margin-bottom: 6px; }
.hpc-pl-table-wrap { overflow-x: auto; border: 1px solid var(--pl-line); border-radius: 5px; }
.hpc-pl-mobile-help { display: none; color: var(--pl-muted); font-size: 12px; }
.hpc-pl-table {
    width: 100%;
    min-width: 860px;
    table-layout: fixed;
    border-collapse: collapse;
    margin: 0;
    font-size: 14px;
}
/* Fixed utility columns leave the remaining width to the listing title and subtitle. */
.hpc-pl-table th:nth-child(1) { width: 44px; }
.hpc-pl-table th:nth-child(2) { width: 104px; }
.hpc-pl-table th:nth-child(4) { width: 76px; }
.hpc-pl-table th:nth-child(5) { width: 190px; }
.hpc-pl-table th:nth-child(6) { width: 100px; }
.hpc-pl-table th:nth-child(7) { width: 140px; }
.hpc-pl-table th { background: var(--pl-paper); text-align: left; }
.hpc-pl-table :is(th, td) { padding: 14px 10px; border: 0; border-bottom: 1px solid var(--pl-line); vertical-align: top; }
.hpc-pl-table small { display: block; margin-top: 5px; }
.hpc-pl-table td { overflow-wrap: anywhere; }
/* Coverage has its own column; title tooltips explain active versus matching pages. */
.hpc-pl-table :is(th, td).hpc-pl-pages { text-align: center; }
.hpc-pl-page-count {
    display: inline-block;
    color: var(--pl-gold);
    font-size: 16px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* Two compact actions above one full-width product link. */
.hpc-pl-row-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 6px;
}
.hpc-pl-row-actions .hpc-pl-product-action { grid-column: 1 / -1; }
/* Shared button/link styling prevents theme defaults from splitting the actions. */
.hpc-pl .hpc-pl-row-actions :is(button.hpc-pl-secondary, a.hpc-pl-secondary) {
    appearance: none;
    min-height: 32px;
    padding: 5px 8px;
    margin: 0;
    border: 1px solid var(--pl-gold);
    border-radius: 4px;
    background: transparent;
    color: var(--pl-gold);
    box-shadow: none;
    font: inherit;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.3;
    letter-spacing: normal;
    text-align: center;
    text-decoration: none;
    text-transform: none;
    white-space: nowrap;
    transform: none;
    transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}

/* Edit, HPA and Product use the same hover and keyboard-focus treatment. */
.hpc-pl .hpc-pl-row-actions :is(button.hpc-pl-secondary, a.hpc-pl-secondary):is(:hover, :focus-visible) {
    background: var(--pl-paper);
    color: var(--pl-ink);
    border-color: var(--pl-ink);
    box-shadow: none;
    text-decoration: none;
    transform: none;
}
.hpc-pl-status { font-weight: 600; color: var(--pl-gold); }
.hpc-pl-bulk {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    padding: 22px 0;
}
.hpc-pl-bulk > label:not(.hpc-pl-check) { max-width: 340px; }
.hpc-pl-bulk > .hpc-pl-check { margin: 0; }
.hpc-pl-bulk > button { justify-self: start; }
.hpc-pl-pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: 10px 0 25px; }
.hpc-pl-admin { max-width: 1300px; padding-right: 15px; }

/* ========================================================================== 
   3. Public Look / Workshop rows — one full-width row per listing
   ========================================================================== */
.hpc-pl-public:empty { display: none; }
.hpc-pl-public-section { padding-top: 28px; }
.hpc-pl-public-section > h2 { margin: 0 0 8px; font-size: 26px; }
.hpc-pl-public-row {
    display: grid;
    grid-template-columns: 135px 140px minmax(0, 1fr) auto;
    align-items: center;
    gap: 22px;
    margin: 14px 0;
    padding: 20px;
    border: 1px solid var(--pl-line);
    border-radius: 5px;
    background: var(--pl-paper);
}
.hpc-pl-seller small, .hpc-pl-seller strong { display: block; overflow-wrap: anywhere; }
.hpc-pl-seller strong { margin-top: 5px; font-size: 15px; }
.hpc-pl-photo { display: flex; align-items: center; justify-content: center; aspect-ratio: 16 / 9; background: #fff; }
.hpc-pl-photo img { width: 100%; height: 100%; max-height: 100px; object-fit: contain; }
.hpc-pl-image-label { padding: 10px; font-size: 13px; color: var(--pl-muted); text-align: center; overflow-wrap: anywhere; }
.hpc-pl-product h3 { margin: 4px 0; font-size: 20px; line-height: 1.3; }
.hpc-pl-product p { margin: 7px 0 0; font-size: 14px; overflow-wrap: anywhere; }
.hpc-pl-public-row .hpc-pl-button { white-space: nowrap; }

/* ========================================================================== 
   4. Variant Registry — colour is supplemented by a descriptive link label
   ========================================================================== */
.hpc-pl-vr { display: inline-flex; min-width: 22px; align-items: center; justify-content: center; }
.hpc-pl-vr .hpc-pl-partner .hpc-vrx-availability-dot { background: #497e9d; box-shadow: 0 0 0 2px rgba(73,126,157,.18); }
.hpc-pl-vr .hpc-pl-hpa .hpc-vrx-availability-dot { background: #2e8052; }

/* ========================================================================== 
   5. Tablet and phone layouts
   ========================================================================== */
@media (max-width: 950px) {
    .hpc-pl-public-row { grid-template-columns: 110px 110px minmax(0, 1fr); gap: 16px; }
    .hpc-pl-public-row .hpc-pl-button { grid-column: 3; justify-self: start; }
}
@media (max-width: 600px) {
    .hpc-pl-mobile-help { display: block; }
    .hpc-pl-heading { display: block; }
    .hpc-pl-heading > div + div { margin-top: 15px; }
    .hpc-pl-form-grid, .hpc-pl-selectors { grid-template-columns: 1fr; }
    .hpc-pl-editor { padding: 16px; }
    .hpc-pl-public-row { grid-template-columns: 90px minmax(0, 1fr); padding: 15px; gap: 14px; }
    .hpc-pl-seller { grid-column: 1 / -1; }
    .hpc-pl-seller small { display: inline; margin-right: 10px; }
    .hpc-pl-seller strong { display: inline; }
    .hpc-pl-public-row .hpc-pl-button { grid-column: 2; }
    .hpc-pl-product h3 { font-size: 18px; }
    .hpc-pl-public-section > h2 { font-size: 23px; }
}

/* 6. Partner rules and explicit acceptance.
   Native details stays usable with keyboard and without custom modal code. */
.hpc-pl-rules {
    margin: 10px 0 0;
    padding: 13px 16px;
    border: 1px solid var(--pl-line);
    border-radius: 8px;
    background: var(--pl-paper);
}
.hpc-pl-consent { min-width: 0; }
.hpc-pl-consent > .hpc-pl-check { margin: 0; }
.hpc-pl-consent > .hpc-pl-help { margin: 0; }
.hpc-pl-rules summary {
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: var(--pl-ink);
}
.hpc-pl-rules-version {
    display: inline-block;
    margin-left: 8px;
    color: var(--pl-muted);
    font-size: 12px;
    font-weight: 400;
}
.hpc-pl-rules[open] > summary {
    padding-bottom: 12px;
    border-bottom: 1px solid var(--pl-line);
}
.hpc-pl-rules-copy {
    max-width: 78ch;
    line-height: 1.65;
}
.hpc-pl-rules-copy h4 {
    margin: 24px 0 8px;
    font-size: 17px;
}
.hpc-pl-rules-copy p {
    margin: 12px 0;
}
/* 7. Cabinet photo column. The thumbnail never replaces or changes archive photos. */
.hpc-pl-table .hpc-pl-preview {
    width: 104px;
    min-width: 104px;
    text-align: center;
}
.hpc-pl-listing-thumb {
    display: block;
    width: 84px;
    height: 56px;
    margin: 0 auto;
    object-fit: contain;
    background: #fff;
    border: 1px solid var(--pl-line);
    border-radius: 4px;
}

/* 8. Parts/materials coverage: one listing can match several archive pages. */
.hpc-pl-scope-fields {
    grid-column: 1 / -1;
    padding: 16px;
    border: 1px solid var(--pl-line);
    background: #fff;
}
.hpc-pl-scope-fields .hpc-pl-selectors label:last-child { grid-column: auto; }
.hpc-pl-coverage-preview {
    margin: 16px 0 0;
    color: var(--pl-ink);
    font-size: 14px;
    font-weight: 600;
}

/* 9. Admin inventory totals and paginated partner directory. */
.hpc-pl-admin-counts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
    margin: 22px 0 12px;
}
.hpc-pl-admin-counts > div {
    padding: 18px;
    border: 1px solid var(--pl-line);
    border-radius: 5px;
    background: var(--pl-paper);
}
.hpc-pl-admin-counts strong {
    display: block;
    color: var(--pl-gold);
    font-size: 28px;
    line-height: 1.2;
}
.hpc-pl-admin-counts span { display: block; margin-top: 6px; }
.hpc-pl-partners-table-wrap { overflow-x: auto; margin-bottom: 24px; }
.hpc-pl-partners-table { min-width: 950px; }
.hpc-pl-partners-table small { display: block; margin-top: 4px; }
@media (max-width: 600px) {
    .hpc-pl-admin-counts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}