/* Explore → Published (js/published-page.js): what you published and who can see it.
   PatchWork Standard: a search, Who can see it chips, then one .sl-table. */

.mk-section > .pub-page { flex: 1; min-height: 0; }
.pub-page {
    display: flex; flex-direction: column; min-height: 0; overflow-y: auto;
    padding: 16px 40px 40px; font-family: var(--sl-font-ui); color: var(--sl-text-1); background: var(--sl-app);
}
.pub-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pub-search { flex: 1 1 240px; min-width: 0; max-width: 420px; }
.pub-search input[type="search"]::-webkit-search-cancel-button { filter: grayscale(1) opacity(0.6); }
.pub-chips { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pub-body { margin-top: 14px; }
.pub-empty { padding: 56px 20px; }

/* Rows: name · who can see it · used · updated · more */
.pub-row {
    display: grid; align-items: center; column-gap: 16px;
    grid-template-columns: minmax(0, 1fr) minmax(220px, 300px) 110px 96px 30px;
}
.pub-table .sl-table-row:hover { background: var(--sl-row-hover); }
.pub-row.is-busy { opacity: 0.65; }

.pub-name { display: flex; align-items: center; gap: 12px; min-width: 0; }
.pub-thumb {
    flex: none; width: 40px; height: 40px; border-radius: var(--sl-r-8); overflow: hidden;
    display: inline-flex; align-items: center; justify-content: center;
    background: color-mix(in oklab, var(--sl-ink) 7%, transparent); color: var(--sl-text-3);
}
.pub-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pub-name-text { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.pub-title { font-size: 13px; font-weight: 600; color: var(--sl-text-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pub-sub { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--sl-text-3); min-width: 0; }
.pub-kind { display: inline-flex; align-items: center; gap: 4px; }
.pub-version { font-family: var(--sl-font-mono); font-size: 10.5px; }

.pub-who { display: flex; align-items: center; gap: 10px; min-width: 0; flex-wrap: wrap; }
.pub-who-btn { max-width: 100%; min-width: 0; font-weight: 600; }
.pub-who-btn .pub-who-label { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pub-who-btn svg:last-child { color: var(--sl-text-3); }
/* The label's icon carries the colour: grey lock, blue team, green globe. */
.pub-who-btn.is-private > svg:first-child { color: var(--sl-text-3); }
.pub-who-btn.is-team > svg:first-child { color: var(--sl-link); }
.pub-who-btn.is-public > svg:first-child { color: var(--sl-success); }
.pub-state { white-space: nowrap; }

.pub-used { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--sl-text-2); }
.pub-uses, .pub-rating { display: inline-flex; align-items: center; gap: 4px; }
.pub-rating svg { color: var(--sl-warning); }
.pub-dim { color: var(--sl-text-3); }
.pub-when { font-size: 12px; color: var(--sl-text-3); white-space: nowrap; }
.pub-act { display: flex; justify-content: flex-end; }
.pub-more { background: transparent; border-color: transparent; color: var(--sl-text-2); }
.pub-more:hover { background: var(--sl-quiet-hover); }

/* Body-appended and fixed: above #home-screen (z-index 9999), or it paints underneath and cannot be clicked. */
.pub-menu { position: fixed; z-index: 10500; min-width: 200px; max-width: 300px; }
.pub-menu .sl-menu-item .pub-grow { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pub-menu .sl-menu-item .pub-check { color: var(--sl-link); }

@media (max-width: 900px) {
    .pub-page { padding: 16px 16px 32px; }
    /* A row stacks: the name across, then who can see it and the menu; used and updated drop. */
    .pub-head { display: none; }
    .pub-row { grid-template-columns: minmax(0, 1fr) 30px; row-gap: 10px; }
    .pub-name { grid-column: 1; grid-row: 1; }
    .pub-act { grid-column: 2; grid-row: 1; }
    .pub-who { grid-column: 1 / -1; grid-row: 2; }
    .pub-used, .pub-when { display: none; }
}
