/* Curate plugin (admin). Everything is scoped to the Curate page. */
#curate-app { --cu-ink: #1E2A23; --cu-muted: #6B6F69; --cu-line: #E1E0DA; --cu-green: #2F4B3B; --cu-bg: #F7F6F2; --cu-card: #FFFFFF; --cu-gold: #C8A15A;
    color: var(--cu-ink); font-family: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 14px; }
#curate-app *, #curate-app *::before, #curate-app *::after { box-sizing: border-box; }
#curate-app button { font: inherit; cursor: pointer; }
#curate-app ul, #curate-app li { list-style: none; margin: 0; padding: 0; }
#curate-app h1 { font-family: "Cormorant Garamond", Georgia, serif; font-size: 34px; font-weight: 600; margin: 0 0 4px; }
#curate-app .cu-wrap { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 28px; align-items: start; padding: 20px 4px 120px; }
#curate-app .cu-query { position: sticky; top: 12px; display: flex; flex-direction: column; gap: 14px; background: var(--cu-card); border: 1px solid var(--cu-line); border-radius: 12px; padding: 20px; max-height: calc(100vh - 140px); overflow: auto; }
#curate-app .cu-muted { color: var(--cu-muted); margin: 0; }
#curate-app .cu-small { font-size: 12px; }
#curate-app .cu-label { display: block; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--cu-muted); margin-bottom: 6px; }
#curate-app .cu-field { display: block; }
#curate-app .cu-field input[type=search], #curate-app .cu-field select, #curate-app .cu-pick input {
    width: 100%; padding: 9px 11px; border: 1px solid var(--cu-line); border-radius: 8px; background: #FFF; font: inherit; color: inherit; }
#curate-app .cu-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
#curate-app .cu-radio { display: flex; gap: 8px; align-items: flex-start; padding: 3px 0; cursor: pointer; }
#curate-app .cu-radio small, #curate-app .cu-check small { display: block; color: var(--cu-muted); font-size: 12px; }
#curate-app .cu-radio input { margin-top: 3px; }
#curate-app .cu-check { display: flex; gap: 8px; align-items: baseline; font-size: 13px; cursor: pointer; }
#curate-app .cu-presets { display: flex; flex-wrap: wrap; gap: 6px; }
#curate-app .cu-presets .cu-label { width: 100%; margin: 0; }
#curate-app .cu-presets button, #curate-app .cu-tools button { border: 1px solid var(--cu-line); background: var(--cu-bg); border-radius: 999px; padding: 5px 12px; font-size: 13px; color: inherit; }
#curate-app .cu-presets button:hover, #curate-app .cu-tools button:hover:not([disabled]) { border-color: var(--cu-green); }
#curate-app .cu-tools button[disabled] { opacity: .45; cursor: default; }
#curate-app .cu-btn { border: 1px solid var(--cu-line); background: #FFF; border-radius: 8px; padding: 9px 16px; font-weight: 600; color: inherit; }
#curate-app .cu-btn-main { background: var(--cu-green); border-color: var(--cu-green); color: #FFF; }
#curate-app .cu-btn[disabled] { opacity: .5; }

#curate-app .cu-pick { position: relative; }
#curate-app .cu-pick-clear { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; font-size: 18px; color: var(--cu-muted); padding: 0 6px; }
#curate-app .cu-picker { position: relative; }
#curate-app .cu-pick-list { position: absolute; z-index: 50; left: 0; right: 0; top: calc(100% + 4px); max-height: 320px; overflow: auto; background: #FFF; border: 1px solid var(--cu-line); border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,.12); padding: 4px; }
#curate-app .cu-pick-list button { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: 6px 8px; border-radius: 6px; color: inherit; font-size: 13px; }
#curate-app .cu-pick-list button:hover { background: var(--cu-bg); }
#curate-app .cu-pick-list small { color: var(--cu-muted); }
#curate-app .cu-pick-list li.cu-muted { padding: 6px 8px; }

#curate-app .cu-summary { font-size: 15px; margin-bottom: 10px; min-height: 22px; }
#curate-app .cu-note { margin: 6px 0 0; padding: 8px 12px; border-radius: 8px; background: #FBF4E4; font-size: 13px; }
#curate-app .cu-error { color: #9A2B1E; }
#curate-app .cu-tools { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; margin-bottom: 14px; }
#curate-app .cu-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
#curate-app .cu-tile { position: relative; background: var(--cu-card); border: 1px solid var(--cu-line); border-radius: 10px; padding: 6px; cursor: pointer; user-select: none; transition: border-color .12s, box-shadow .12s; }
#curate-app .cu-tile:hover { border-color: #BFC3BB; }
#curate-app .cu-tile.is-sel { border-color: var(--cu-green); box-shadow: 0 0 0 2px var(--cu-green); }
#curate-app .cu-tile.is-filed { opacity: .55; }
#curate-app .cu-img { position: relative; display: flex; align-items: center; justify-content: center; height: 170px; background: #ECEBE6; border-radius: 6px; overflow: hidden; }
#curate-app .cu-tile.is-loading .cu-img { background: linear-gradient(90deg, #ECEBE6, #F4F3EF, #ECEBE6); }
#curate-app .cu-img img { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
#curate-app .cu-tick { position: absolute; top: 6px; left: 6px; width: 24px; height: 24px; border-radius: 50%; background: rgba(255,255,255,.9); border: 1px solid var(--cu-line); color: transparent; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; }
#curate-app .cu-tile.is-sel .cu-tick { background: var(--cu-green); border-color: var(--cu-green); color: #FFF; }
#curate-app .cu-score { position: absolute; top: 6px; right: 6px; background: rgba(30,42,35,.75); color: #FFF; font-size: 11px; padding: 2px 6px; border-radius: 999px; }
#curate-app .cu-filed { position: absolute; bottom: 6px; left: 6px; background: var(--cu-gold); color: #1E2A23; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; }
#curate-app .cu-meta { display: flex; justify-content: space-between; gap: 6px; padding: 6px 2px 2px; font-size: 12px; }
#curate-app .cu-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
#curate-app .cu-open { color: var(--cu-muted); text-decoration: none; padding: 0 4px; }
#curate-app .cu-open:hover { color: var(--cu-green); }
#curate-app .cu-chips { display: flex; flex-wrap: wrap; gap: 4px; padding: 2px; }
#curate-app .cu-chip { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; background: #EEF2EE; color: var(--cu-green); border-radius: 999px; padding: 2px 8px; border: 0; }
#curate-app .cu-chip-none { background: #F6EBDD; color: #8A5A1F; }
#curate-app .cu-chip-btn { cursor: pointer; margin-left: 4px; }
#curate-app .cu-chip-btn:hover { background: var(--cu-green); color: #FFF; }
#curate-app .cu-more { text-align: center; margin: 20px 0; }

#curate-app .cu-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 100; background: #1E2A23; color: #FFF; box-shadow: 0 -6px 24px rgba(0,0,0,.18); }
#curate-app .cu-bar-in { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 12px 24px; max-width: 1600px; margin: 0 auto; }
#curate-app .cu-bar .cu-bar-picker { width: 380px; max-width: 100%; color: var(--cu-ink); }
#curate-app .cu-bar .cu-pick-list { top: auto; bottom: calc(100% + 4px); }
#curate-app .cu-bar .cu-btn { background: transparent; color: #FFF; border-color: rgba(255,255,255,.35); }
#curate-app .cu-bar .cu-btn-main { background: var(--cu-gold); border-color: var(--cu-gold); color: #1E2A23; }
#curate-app .cu-bar-from { font-size: 12px; opacity: .9; }
#curate-app .cu-spin { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--cu-line); border-top-color: var(--cu-green); border-radius: 50%; animation: cu-spin .8s linear infinite; vertical-align: -2px; margin-right: 6px; }
@keyframes cu-spin { to { transform: rotate(360deg); } }

.cu-toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); z-index: 200; background: #1E2A23; color: #FFF; padding: 10px 18px; border-radius: 999px; font-size: 14px; box-shadow: 0 6px 20px rgba(0,0,0,.2); transition: opacity .5s; }
.cu-toast.is-out { opacity: 0; }

@media (max-width: 900px) {
    #curate-app .cu-wrap { grid-template-columns: 1fr; }
    #curate-app .cu-query { position: static; max-height: none; }
    #curate-app .cu-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
    #curate-app .cu-img { height: 130px; }
}

/* Keep ResourceSpace's own form styles from leaking in */
#curate-app input[type=search], #curate-app select { margin: 0 !important; width: 100% !important; max-width: none !important; height: auto !important; box-shadow: none; }
#curate-app input[type=radio], #curate-app input[type=checkbox] { width: auto !important; margin: 3px 0 0 !important; flex: none; }
#curate-app .cu-check { display: block; }
#curate-app .cu-check input { margin-right: 6px !important; vertical-align: -1px; }
#curate-app .cu-check small { display: inline; margin-left: 2px; }
#curate-app h1 { padding: 0; line-height: 1.1; }
#curate-app .cu-tools .cu-check { display: inline-flex; align-items: center; gap: 6px; }
#curate-app .cu-tools .cu-check input { margin: 0 !important; }

/* ---- v1.1 Tick circle selects; picture opens details ---- */
#curate-app .cu-img { cursor: zoom-in; }
#curate-app .cu-tick { cursor: pointer; width: 28px; height: 28px; top: 5px; left: 5px; z-index: 2; }
#curate-app .cu-tick input { position: absolute; inset: 0; opacity: 0; margin: 0 !important; width: 100% !important; height: 100%; cursor: pointer; }
#curate-app .cu-tick span { pointer-events: none; }
#curate-app .cu-tile:hover .cu-tick { border-color: var(--cu-green); }
#curate-app .cu-tile.is-sel .cu-tick span { color: #FFF; }
#curate-app .cu-tile.ui-draggable-dragging { opacity: .4; }

.cu-drag { display: flex; align-items: center; gap: 8px; padding: 6px 10px 6px 6px; background: #1E2A23; color: #FFF; border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.25); font: 600 13px/1.2 "Instrument Sans", system-ui, sans-serif; pointer-events: none; }
.cu-drag img { width: 48px; height: 48px; object-fit: cover; border-radius: 6px; }

/* Room for the Collections panel when it is open */
@media (min-width: 900px) {
    body.ct-open #curate-app .cu-bar { left: var(--ct-width, 320px); }
}

/* Details pop-up */
#curate-app .cu-detail { position: fixed; inset: 0; z-index: 1000; background: rgba(20,26,22,.72); display: flex; align-items: center; justify-content: center; padding: 3vh 3vw; }
#curate-app .cu-detail-in { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 380px; width: 100%; max-width: 1500px; height: 100%; max-height: 94vh; background: var(--cu-card); border-radius: 12px; overflow: hidden; }
#curate-app .cu-detail-img { position: relative; display: flex; align-items: center; justify-content: center; background: #ECEBE6; min-height: 0; padding: 24px; }
#curate-app .cu-detail-img img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
#curate-app .cu-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 64px; border: 0; border-radius: 8px; background: rgba(255,255,255,.85); font-size: 34px; line-height: 1; color: var(--cu-ink); }
#curate-app .cu-prev { left: 10px; }
#curate-app .cu-next { right: 10px; }
#curate-app .cu-detail-side { overflow: auto; padding: 22px 22px 18px; border-left: 1px solid var(--cu-line); }
#curate-app .cu-detail-side h2 { font-family: "Cormorant Garamond", Georgia, serif; font-size: 26px; margin: 0 36px 4px 0; padding: 0; word-break: break-word; }
#curate-app .cu-detail-side h3 { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--cu-muted); margin: 18px 0 6px; padding: 0; }
#curate-app .cu-detail-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
#curate-app .cu-detail-actions a.cu-btn { text-decoration: none; }
#curate-app .cu-dsel[aria-pressed=true] { background: #EEF2EE; border-color: var(--cu-green); color: var(--cu-green); }
#curate-app .cu-detail-cols { display: flex; flex-direction: column; gap: 6px; }
#curate-app .cu-dcol { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: #EEF2EE; color: var(--cu-green); border-radius: 8px; padding: 5px 6px 5px 10px; font-size: 13px; }
#curate-app .cu-dcol button { border: 0; background: transparent; color: var(--cu-muted); font-size: 18px; line-height: 1; padding: 0 6px; border-radius: 6px; }
#curate-app .cu-dcol button:hover { background: #F3D9D4; color: #9A2B1E; }
#curate-app .cu-fields { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; margin: 0; font-size: 13px; }
#curate-app .cu-fields dt { color: var(--cu-muted); }
#curate-app .cu-fields dd { margin: 0; word-break: break-word; }
#curate-app .cu-detail-close { position: absolute; top: 10px; right: 12px; z-index: 2; width: 34px; height: 34px; border: 0; border-radius: 50%; background: rgba(255,255,255,.9); font-size: 22px; line-height: 1; color: var(--cu-ink); }
@media (max-width: 900px) {
    #curate-app .cu-detail-in { grid-template-columns: 1fr; grid-template-rows: 55% 45%; }
    #curate-app .cu-detail-side { border-left: 0; border-top: 1px solid var(--cu-line); }
}

/* ---- In ResourceSpace's thumbnail results: which collections a picture is in ---- */
.resource-card .curate-incols { font-size: 12px; color: #2F4B3B; line-height: 1.35; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; margin-top: 2px; }
.resource-card .curate-incols-n { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 999px; background: #EEF2EE; text-align: center; font-weight: 600; font-size: 11px; }
.resource-card .curate-incols-one .curate-incols-n { background: #F6EBDD; color: #8A5A1F; }
.resource-card .curate-incols-none { color: #8A5A1F; }
.resource-card .curate-incols-none .curate-incols-n { background: #F3D9D4; color: #9A2B1E; }

/* ---- v1.4 Find similar ---- */
#curate-app .cu-like { display: flex; align-items: center; gap: 10px; padding: 6px; border: 1px solid var(--cu-green); border-radius: 8px; background: #EEF2EE; }
#curate-app .cu-like img { width: 56px; height: 56px; object-fit: cover; border-radius: 6px; flex: none; }
#curate-app .cu-like span { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#curate-app .cu-like button { border: 0; background: transparent; font-size: 20px; color: var(--cu-muted); padding: 0 6px; }
#curate-app .cu-back { align-self: flex-start; border: 0; background: transparent; color: var(--cu-green); font-weight: 600; padding: 0; }
#curate-app .cu-back:hover { text-decoration: underline; }
