.cv-wrap { max-width: 1100px; margin: 0 auto; padding: 96px 16px 48px; color: var(--text-primary); box-sizing: border-box;
  --cv-accent: var(--color-primary, #6366f1); --cv-warn: var(--color-warning, #f59e0b); --cv-err: var(--color-danger-hover, #f87171); --cv-ok: #4ade80; }
:root[data-theme="light"] .cv-wrap { --cv-accent: #4f46e5; --cv-warn: #b45309; --cv-err: #b91c1c; --cv-ok: #15803d; }
.cv-wrap *, .cv-wrap *::before, .cv-wrap *::after { box-sizing: border-box; }
.cv-wrap [hidden] { display: none !important; }
.cv-intro h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); margin: 0 0 8px; }
.cv-intro p { color: var(--text-secondary); margin: 0 0 16px; max-width: 70ch; }

/* drop zone */
.cv-drop { position: relative; display: grid; justify-items: center; gap: 10px; text-align: center; padding: 28px 16px; border: 2px dashed var(--border-color);
  border-radius: 14px; background: var(--bg-secondary); transition: border-color .15s, background .15s; }
.cv-drop.is-over { border-color: var(--cv-accent); background: color-mix(in srgb, var(--cv-accent) 10%, var(--bg-secondary)); }
.cv-drop-icon { width: 40px; height: 40px; color: var(--cv-accent); }
.cv-drop-title { font-weight: 700; font-size: 1.1rem; margin: 0; }
.cv-file { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
@media (hover: none) { .cv-drop-title { display: none; } } /* touch: no dragging, the button is the way in */

.cv-msg { margin: 10px 0 0; font-weight: 600; color: var(--cv-warn); overflow-wrap: anywhere; }
.cv-msg:empty { display: none; }

/* layout: stacked on phones, settings beside the list on wide screens */
.cv-cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; margin-top: 16px; align-items: start; }
@media (min-width: 900px) {
  .cv-cols { grid-template-columns: 300px minmax(0, 1fr); }
  .cv-settings { position: sticky; top: 88px; }
}
.cv-card { background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: 12px; padding: 18px 16px; display: grid; gap: 14px; min-width: 0; }
.cv-card h2 { font-size: 1.15rem; margin: 0; }

/* settings */
.cv-field { display: grid; gap: 6px; min-width: 0; }
.cv-label { font-weight: 600; font-size: 0.95rem; }
.cv-labelrow { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.cv-out { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--cv-accent); }
.cv-input { width: 100%; max-width: 100%; min-width: 0; padding: 9px 10px; border-radius: 8px; border: 1px solid var(--border-color);
  background: var(--bg-primary); color: var(--text-primary); font: inherit; min-height: 42px; }
.cv-input:focus-visible, .cv-range:focus-visible { outline: 2px solid var(--cv-accent); outline-offset: 1px; }
.cv-range { width: 100%; accent-color: var(--cv-accent); min-height: 32px; }
.cv-custom { display: flex; align-items: center; gap: 8px; }
.cv-custom .cv-input { flex: 1 1 auto; }
.cv-unit { color: var(--text-secondary); font-weight: 600; }
.cv-check { display: flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; min-height: 32px; }
.cv-check input { width: 20px; height: 20px; accent-color: var(--cv-accent); margin: 0; flex: 0 0 auto; }
.cv-seg { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--border-color); border-radius: 10px; overflow: hidden; background: var(--bg-primary); }
.cv-seg button { border: 0; background: transparent; color: var(--text-primary); font: inherit; font-weight: 600; padding: 8px 6px; cursor: pointer; min-height: 42px; }
.cv-seg button + button { border-left: 1px solid var(--border-color); }
.cv-seg button[aria-pressed="true"] { background: var(--cv-accent); color: #fff; }
.cv-seg button:focus-visible { outline: 2px solid var(--cv-accent); outline-offset: -3px; }
.cv-hint { color: var(--text-secondary); font-size: 0.88rem; margin: 0; overflow-wrap: anywhere; }
.cv-privacy { margin: 0; padding: 10px 12px; border-radius: 10px; font-size: 0.9rem; border: 1px solid var(--border-color); background: var(--bg-primary); color: var(--text-secondary);
  display: flex; gap: 8px; align-items: flex-start; }
.cv-privacy::before { content: "\2713"; flex: 0 0 auto; color: var(--cv-ok); font-weight: 800; }

/* list */
.cv-listhead { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.cv-count { color: var(--text-secondary); font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.cv-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.cv-row { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 8px 12px; align-items: center; padding: 10px; border: 1px solid var(--border-color);
  border-radius: 10px; background: var(--bg-primary); min-width: 0; }
.cv-row[data-status="done"] { border-color: color-mix(in srgb, var(--cv-ok) 45%, var(--border-color)); }
.cv-row[data-status="error"] { border-color: color-mix(in srgb, var(--cv-err) 55%, var(--border-color)); }
.cv-row[data-status="working"] { border-color: var(--cv-accent); }
.cv-thumbbox { width: 56px; height: 56px; border-radius: 8px; overflow: hidden; background: var(--bg-secondary); display: grid; place-items: center;
  color: var(--text-secondary); font-size: 0.7rem; font-weight: 700; letter-spacing: .03em; }
.cv-thumb { width: 100%; height: 100%; object-fit: cover; display: block; }
.cv-main { display: grid; gap: 2px; min-width: 0; }
.cv-name { font-weight: 600; overflow-wrap: anywhere; line-height: 1.3; }
.cv-size { font-size: 0.88rem; color: var(--text-secondary); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.cv-size b { color: var(--text-primary); }
.cv-status { font-size: 0.85rem; color: var(--text-secondary); overflow-wrap: anywhere; }
.cv-row[data-status="done"] .cv-status { color: var(--cv-ok); font-weight: 600; }
.cv-row[data-status="stale"] .cv-status, .cv-row .cv-status.is-warn { color: var(--cv-warn); font-weight: 600; }
.cv-row[data-status="error"] .cv-status { color: var(--cv-err); font-weight: 600; }
.cv-row[data-status="working"] .cv-status { color: var(--cv-accent); font-weight: 600; }
.cv-rowbtns { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
@media (min-width: 600px) {
  .cv-row { grid-template-columns: 56px minmax(0, 1fr) auto; }
  .cv-rowbtns { grid-column: auto; flex-wrap: nowrap; }
}
.cv-progress { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.cv-progress:empty { display: none; }
.cv-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* buttons (own classes; never .nav-cta) */
.cv-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--border-color); background: var(--bg-primary);
  color: var(--text-primary); border-radius: 10px; padding: 9px 16px; cursor: pointer; font: inherit; font-weight: 600; text-decoration: none; line-height: 1.2; min-height: 42px; }
.cv-btn:hover:not(:disabled) { border-color: var(--cv-accent); }
.cv-btn--primary { background: var(--cv-accent); border-color: var(--cv-accent); color: #fff; }
.cv-btn--primary:hover:not(:disabled) { background: var(--color-primary-active, #4f46e5); color: #fff; }
.cv-btn--quiet { background: transparent; color: var(--text-secondary); }
.cv-btn--sm { padding: 6px 12px; min-height: 36px; font-size: 0.88rem; }
.cv-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.cv-btn:focus-visible { outline: 2px solid var(--cv-accent); outline-offset: 2px; }
.cv-x { width: 36px; padding: 0; font-size: 1.1rem; }

.img-foot { text-align: center; padding: 24px 16px; font-size: 0.875rem; }
.img-foot a { color: var(--text-secondary); }
.cv-lic { margin: 8px auto 0; max-width: 60ch; color: var(--text-secondary); font-size: 0.8rem; overflow-wrap: anywhere; }
@media (max-width: 480px) {
  .cv-actions .cv-btn { flex: 1 1 100%; }
  .cv-rowbtns .cv-btn:not(.cv-x) { flex: 1 1 auto; }
}
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
[tabindex="-1"]:focus { outline: none; }
/* error rows have only Remove: keep it beside the text */
.cv-row[data-status="error"] { grid-template-columns: 56px minmax(0, 1fr) auto; }
.cv-row[data-status="error"] .cv-rowbtns { grid-column: auto; }
.cv-row[data-status="done"] .cv-status.is-warn { color: var(--cv-warn); }
