/* The culling flow (js/features/culling.js): the rating bar of quick look and the viewer, dimmed rated tiles with
   "→ Gold", waiting entries in the tier folder, the "Hide rated" and "Apply to folders" chips, the Apply panel.
   Tokens from style.css; medal colours are quiet (ice blue, gold, silver, bronze). */

:root {
  --tier-5: #9fd3f5;   /* Diamond */
  --tier-4: #7fb4de;   /* Diamond to edit */
  --tier-3: #e0b64a;   /* Gold */
  --tier-2: #bfc3cc;   /* Silver */
  --tier-1: #c08457;   /* Bronze */
}

/* ---------- the rating bar ---------- */
.rb { display: flex; align-items: stretch; justify-content: center; gap: 6px; padding: 10px 14px 4px; }
.rb[hidden] { display: none; }
.rb-btn { position: relative; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-width: 64px; min-height: 44px;
  padding: 5px 10px 4px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--panel); color: var(--muted); cursor: pointer; font: inherit;
  transition: background .1s, border-color .1s, color .1s; }
.rb-btn:hover:not(:disabled) { background: var(--raised); color: var(--text); }
.rb-btn:disabled { opacity: .4; cursor: default; }
.rb-n { font-size: 11px; letter-spacing: 1px; line-height: 1.1; color: var(--tier); }
.rb-t { font-size: 12px; font-weight: 600; line-height: 1.2; text-align: center; }
.rb-k { position: absolute; top: 3px; right: 5px; font: 10px/1 var(--mono); color: var(--dim); border: 0; padding: 0; background: none; }
.rb-btn.t5 { --tier: var(--tier-5); } .rb-btn.t4 { --tier: var(--tier-4); } .rb-btn.t3 { --tier: var(--tier-3); }
.rb-btn.t2 { --tier: var(--tier-2); } .rb-btn.t1 { --tier: var(--tier-1); }
.rb-btn.on { border-color: var(--tier); color: var(--text); background: color-mix(in srgb, var(--tier) 16%, var(--panel)); }
.rb-clear { min-width: 56px; }
.rb.in-viewer { padding: 8px 12px 2px; }
.rb.in-viewer .rb-btn { background: rgba(255, 255, 255, .04); border-color: rgba(255, 255, 255, .12); }
.rb.in-viewer .rb-btn.on { background: color-mix(in srgb, var(--tier) 22%, #0b0b0c); }
.ql-rate:empty { display: none; }
@media (hover: none) { .rb-k { display: none; } }
@media (max-width: 767px) {
  .rb { gap: 4px; padding: 8px 10px 2px; }
  .rb-btn { min-width: 0; flex: 1 1 0; padding: 5px 2px 4px; }
  .rb-t { font-size: 10.5px; }
  .rb-clear { flex: 0 0 48px; }
}

/* ---------- tiles ---------- */
.vcell.cull-dim [data-part=pic], .vcell.cull-dim .sqimg { opacity: .38; filter: grayscale(.7); transition: opacity .15s; }
.vcell.cull-dim:hover [data-part=pic], .vcell.cull-dim:hover .sqimg { opacity: .7; }
.vcell.cull-ghost [data-part=pic], .vcell.cull-ghost .sqimg { outline: 1.5px dashed rgba(224, 182, 74, .55); outline-offset: -1.5px; }
.cull-badge { position: absolute; top: 8px; left: 8px; z-index: 2; display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 999px;
  background: rgba(12, 12, 14, .78); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); color: var(--text); font-size: 11px; font-weight: 650;
  line-height: 1; white-space: nowrap; pointer-events: none; }
.cull-badge.ghost { color: var(--tier-3); }
.cull-badge.in-list { position: static; height: 18px; margin-left: 8px; background: none; padding: 0; backdrop-filter: none; -webkit-backdrop-filter: none; vertical-align: -3px; color: var(--accent-text); }
.cull-badge.in-list.ghost { color: var(--tier-3); }
.lrow.cull-dim .lname, .lrow.cull-dim .lthumb { opacity: .5; }

/* ---------- header chips ---------- */
.cull-chip { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.cull-toggle, .cull-apply { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 11px; border: 1px solid var(--line-2); border-radius: 999px;
  background: transparent; color: var(--muted); font: inherit; font-size: 12px; cursor: pointer; white-space: nowrap; }
.cull-toggle:hover, .cull-apply:hover { color: var(--text); background: var(--hover); }
.cull-toggle[aria-pressed=true] { background: var(--accent-soft); border-color: transparent; color: #bfdbfe; }
.cull-left { color: var(--faint); font-variant-numeric: tabular-nums; padding-left: 7px; border-left: 1px solid var(--line-2); }
.cull-toggle[aria-pressed=true] .cull-left { color: #bfdbfe; border-color: rgba(191, 219, 254, .3); }
.cull-n { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent-soft); color: var(--accent-text); font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; font-variant-numeric: tabular-nums; }
.cull-apply.done .cull-n { background: rgba(34, 197, 94, .16); color: var(--ok); }
@media (min-width: 768px) { .cull-tool { display: none; } }
@media (max-width: 767px) {
  .vchips .cull-chip { display: none; }
  .cull-tool { flex: 1 1 100%; min-width: 0; }
  .cull-chip { gap: 6px; }
  .cull-toggle, .cull-apply { height: 44px; padding: 0 12px; }
  .cull-chip { width: 100%; }
}

/* ---------- the Apply panel ---------- */
.lib-pop.cull-pop { width: min(380px, calc(100vw - 16px)); }
.cull-pop-body { display: flex; flex-direction: column; gap: 10px; }
.cull-head { color: var(--text-2); font-size: 12px; font-weight: 650; }
.cull-groups { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 220px; overflow: auto; }
.cull-groups li { display: grid; grid-template-columns: auto 1fr; column-gap: 8px; align-items: baseline; font-size: 12.5px; color: var(--text-2); }
.cull-g-n { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--accent-text); min-width: 28px; text-align: right; }
.cull-g-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cull-g-new, .cull-g-sub { grid-column: 2; font-size: 11px; color: var(--faint); }
.cull-g-new { color: var(--warn); }
.cull-more { color: var(--faint); }
.cull-note { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.45; }

/* ---------- inspector ---------- */
.rate-tier { color: var(--text-2); font-size: 12px; font-weight: 600; min-height: 16px; }
.cull-ins { display: flex; flex-direction: column; gap: 3px; }
.cull-ins-t { font-size: 12.5px; font-weight: 600; color: var(--text); overflow-wrap: anywhere; }
.cull-ins-s { font-size: 12px; color: var(--muted); }

/* search: the chip at the end of the search head (the shell's title row is hidden there) */
.cull-search { display: flex; margin-top: 10px; min-width: 0; }
.cull-search[hidden] { display: none; }

/* phones: the viewer has no footer there (viewer.css), so the rating bar alone floats above the action bar
   (and hides with it when the picture is tapped bare) */
@media (max-width: 767px) {
  .viewer .v-bottom:has(> .rb.in-viewer:not([hidden])) { display: block; position: absolute; left: 0; right: 0; z-index: 3; padding: 0; border: 0; background: none;
    bottom: calc(76px + env(safe-area-inset-bottom)); transition: opacity .2s; }
  .viewer .v-bottom:has(> .rb.in-viewer) > :not(.rb) { display: none; }
  .viewer .rb.in-viewer { padding: 4px 10px; }
  .viewer .rb.in-viewer .rb-btn { background: rgba(11, 11, 12, .62); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
  .viewer.bare .v-bottom { opacity: 0; pointer-events: none; }
  .viewer:has(.v-bottom > .rb.in-viewer:not([hidden])) .v-info { bottom: calc(136px + env(safe-area-inset-bottom)); }
}
