/* Polish (polish.js) and the Polish list in the Workshop. Built on app.css tokens; everything is pl- prefixed.
   Shaky fields: amber edge + reason. Soft notes: muted. Changed fields: accent edge. */
:root { --pl-warn: #A4561A; --pl-warn-bg: color-mix(in srgb, #C77B3A 13%, var(--surface)); }
@media (prefers-color-scheme: dark) { :root { --pl-warn: #E8A66A; --pl-warn-bg: color-mix(in srgb, #C77B3A 20%, var(--surface)); } }
.pl { display: grid; gap: 16px; padding-top: 6px; padding-bottom: 120px; }
.pl-top { display: flex; align-items: flex-start; gap: 12px; }
.pl-h1 { font-size: 26px; line-height: 1.15; margin-top: 4px; overflow-wrap: anywhere; }
.pl-file { margin-top: 4px; overflow-wrap: anywhere; }
.pl-pill { flex: none; font-size: 12px; font-weight: 600; padding: 5px 10px; border-radius: 999px; white-space: nowrap; }
.pl-pill.warn { background: var(--pl-warn-bg); color: var(--pl-warn); }
.pl-pill.ok { background: var(--accent-soft); color: var(--accent); }
.pl-grid { display: grid; gap: 16px; }
.pl-main { padding: 16px; display: grid; gap: 14px; min-width: 0; }
.pl-row { display: flex; gap: 14px; align-items: flex-start; }
.pl-col { display: grid; gap: 14px; }
.pl-pair { display: flex; gap: 10px; align-items: flex-start; }
.pl-num { width: 92px; flex: none; }
.pl-field { display: grid; gap: 6px; min-width: 0; padding-left: 10px; border-left: 3px solid transparent; margin-left: -13px; }
.pl-field.shaky { border-left-color: var(--pl-warn); }
.pl-field.changed { border-left-color: var(--accent); }
.pl-lab { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.pl-lab label, .pl-k { font-size: 13px; font-weight: 600; }
.pl-src { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.pl-field.changed .pl-src { color: var(--accent); }
.pl-why { font-size: 13px; padding: 7px 10px; border-radius: 10px; background: var(--pl-warn-bg); color: var(--ink); overflow-wrap: anywhere; }
.pl-why.soft { background: var(--line-soft); color: var(--muted); }
.pl-in { width: 100%; min-height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); padding: 0 12px; font-size: 16px; }
.pl-field.shaky .pl-in { border-color: color-mix(in srgb, var(--pl-warn) 60%, var(--line)); }
select.pl-in { appearance: auto; }
.pl-ta { padding: 10px 12px; line-height: 1.45; resize: vertical; min-height: 120px; }
.pl-mates { font-size: 13px; color: var(--muted); }
.pl-mates .link { padding: 0 0 0 4px; font-size: 13px; }
.pl-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
.pl-chip { display: inline-flex; align-items: center; gap: 2px; padding: 4px 4px 4px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--ink); font-size: 13px; }
.pl-chip button { border: 0; background: none; color: var(--muted); width: 26px; height: 26px; border-radius: 50%; font-size: 16px; line-height: 1; }
.pl-chipin { flex: 1; min-width: 120px; min-height: 34px; border: 0; background: transparent; color: var(--ink); font-size: 16px; padding: 0 6px; }
.pl-chipin:focus { outline: none; }
.pl-coverbox { width: 120px; flex: none; display: grid; gap: 6px; justify-items: start; }
.pl-cov { width: 120px; height: 180px; border-radius: 8px; overflow: hidden; background: var(--line-soft); box-shadow: 0 6px 18px rgba(27,26,23,.18); outline: 3px solid transparent; outline-offset: 2px; }
.pl-cov.shaky { outline-color: var(--pl-warn); }
.pl-cov.changed { outline-color: var(--accent); }
.pl-cov img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pl-cov .cover { width: 120px !important; height: 180px !important; }
.pl-nocover { width: 100%; height: 100%; display: grid; place-items: center; color: var(--muted); font-size: 13px; text-align: center; }
.pl-nocover.sm { width: 64px; height: 96px; flex: none; border-radius: 6px; background: var(--line-soft); font-size: 11px; }
.pl-coverbox .pl-why { font-size: 12px; }
.pl-coverbox .link { padding: 0; }
.pl-side { min-width: 0; }
.pl-find { padding: 16px; display: grid; gap: 10px; }
.pl-h2 { font-size: 18px; }
.pl-q { display: flex; gap: 8px; }
.pl-q .pl-in { flex: 1; min-width: 0; }
.pl-hits { display: grid; gap: 2px; }
.pl-hit { display: flex; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line-soft); align-items: flex-start; }
.pl-hit img { width: 64px; height: 96px; object-fit: cover; border-radius: 6px; flex: none; background: var(--line-soft); }
.pl-ht { font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; }
.pl-hit .small { overflow-wrap: anywhere; }
.pl-hbtns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.pl-bar { position: fixed; left: 0; right: 0; bottom: calc(64px + env(safe-area-inset-bottom, 0px)); z-index: 12; padding: 10px max(16px, env(safe-area-inset-left, 0px)); background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-top: 1px solid var(--line); }
.pl-bar-in { max-width: 560px; margin: 0 auto; display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.pl-bar .pill { flex: 1 1 auto; }
body.desk .pl-bar { left: 248px; bottom: 0; }
body.desk .pl-bar-in { max-width: 1240px; }
body.desk .pl-bar .pill { flex: 0 0 auto; }
body.desk .pl-grid { grid-template-columns: minmax(0, 1.25fr) minmax(320px, 1fr); align-items: start; }
body.desk .pl-side { position: sticky; top: 84px; }
body.desk .pl-hits { max-height: calc(100vh - 300px); overflow-y: auto; }
@media (max-width: 380px) { .pl-coverbox, .pl-cov, .pl-cov .cover { width: 96px !important; } .pl-cov, .pl-cov .cover { height: 144px !important; } }

/* the Polish list in the Workshop (workshop.js) */
.pl-list .ws-row { display: grid; gap: 8px; }
.pl-flags { display: flex; flex-wrap: wrap; gap: 6px; }
.pl-flag { font-size: 12px; padding: 2px 8px; border-radius: 8px; background: var(--pl-warn-bg); color: var(--pl-warn); overflow-wrap: anywhere; }
.pl-flag.ok { background: var(--accent-soft); color: var(--accent); }
.pl-flag.note { background: var(--line-soft); color: var(--muted); }
.pl-flag.fixed { background: var(--accent-soft); color: var(--accent); }
.pl-fixed { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; font-size: 13px; padding: 7px 10px; border-radius: 10px; background: var(--accent-soft); color: var(--ink); overflow-wrap: anywhere; }
.pl-fixed b { color: var(--accent); font-weight: 600; }
.pl-fixed .link { padding: 0; font-size: 13px; }
.pl-field.autofixed { border-left-color: var(--accent); }
.pl-serieshead { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 0 2px; font-weight: 600; }
.pl-serieshead .link { padding: 4px 0; font-size: 13px; }
.pl-auto { font-size: 13px; color: var(--muted); }
.pl-auto .link { padding: 0; font-size: 13px; }
.pl-sn { display: grid; grid-template-columns: 1fr 84px; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line-soft); }
.pl-sn span { overflow-wrap: anywhere; font-size: 14px; }
/* toasts sit above the Approve bar, never on it */
body:has(.pl-bar) #toasts { bottom: calc(150px + env(safe-area-inset-bottom, 0px)); }
body.desk:has(.pl-bar) #toasts { bottom: 92px; }
.pl-ser { color: var(--accent); font-weight: 500; }
.pl-srcchip { display: inline-block; margin-top: 4px; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 6px; background: var(--line-soft); color: var(--muted); }
/* checking a match before taking it */
.pl-review .sub { margin-top: 0; }
.pl-rvlist { display: grid; margin-top: 10px; max-height: 60vh; overflow-y: auto; }
.pl-rv { display: grid; grid-template-columns: 26px 110px minmax(0, 1fr) minmax(0, 1fr); gap: 4px 12px; align-items: start; padding: 10px 0; border-bottom: 1px solid var(--line-soft); cursor: pointer; }
.pl-rv input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--accent); }
.pl-rv-info { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; color: var(--muted); border: 1px solid var(--line); }
.pl-rv-k { font-size: 13px; font-weight: 600; }
.pl-rv-k small { display: block; font-weight: 500; color: var(--muted); }
.pl-rv-m, .pl-rv-n { font-size: 14px; overflow-wrap: anywhere; min-width: 0; }
.pl-rv-n { color: var(--muted); }
.pl-rv-n small, .pl-rv-m small { display: none; }
.pl-rv img { width: 64px; height: 96px; object-fit: cover; border-radius: 6px; display: block; background: var(--line-soft); }
.pl-rv.none { cursor: default; }
.pl-rv.none .pl-rv-k { color: var(--muted); }
.pl-rv.same .pl-rv-m { color: var(--muted); }
@media (max-width: 640px) {
  .pl-rv-head { display: none !important; }
  .pl-rv { grid-template-columns: 26px minmax(0, 1fr); }
  .pl-rv-k { grid-column: 2; }
  .pl-rv-m, .pl-rv-n { grid-column: 2; }
  .pl-rv-n small, .pl-rv-m small { display: inline; font-weight: 600; margin-right: 6px; color: var(--muted); }
  .pl-rv-n img { display: inline-block; vertical-align: top; }
}
body.desk .sheet:has(.pl-review) { width: min(860px, calc(100vw - 48px)); max-height: 86vh; }
.pl-rv-head { cursor: default; padding: 0 0 6px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); position: sticky; top: 0; background: var(--surface); z-index: 1; }
/* the note when Check-in filled the page from the best match on its own */
.pl-auto { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 10px 12px; margin: 10px 0 4px; border-radius: 12px; background: var(--accent-soft); color: var(--ink); font-size: 13.5px; line-height: 1.4; }
.pl-auto span { flex: 1 1 200px; min-width: 0; }
.pl-auto-top { margin: 0 0 14px; }
