/* Art hand-ins: the picker, the file boxes with their checks, the by-eye ticks (js/hand-in/). */
.hi-search { width: 100%; }
.hi-group { margin: 10px 0 4px; }
.hi-group h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 0 0 6px; }
.hi-group h3 .count { margin-left: 6px; }
.hi-items { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.hi-item { width: 100%; display: grid; gap: 2px; text-align: left; padding: 9px 12px; border: 2px solid var(--line); border-radius: var(--radius-s); background: var(--raised); color: var(--ink); font: inherit; cursor: pointer; }
.hi-item:hover, .hi-item:focus-visible { border-color: var(--accent); background: var(--accent-soft); }
.hi-item-title { font-weight: 600; }
.hi-item-meta { font-size: 12.5px; color: var(--muted); }
.hi-loose { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.hi-loose .hint { flex-basis: 100%; }
.hi-started { list-style: none; margin: 0; padding: 0; }
.hi-started li { padding: 8px 0; border-top: 1px solid var(--line); }
.hi-started li:first-child { border-top: 0; }
.hi-started-title { font-weight: 600; }

.hi-status { margin: -6px 0 12px; }
.hi-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 4px 16px; }
.hi-fields textarea, .hi-fields input, .hi-fields select { width: 100%; }

.hi-slots { display: grid; gap: 12px; }
.hi-slot { border: 2px solid var(--line); border-radius: var(--radius); padding: 12px; background: var(--surface); }
.hi-slot.dropping { border-color: var(--accent); background: var(--accent-soft); }
.hi-slot-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.hi-slot-head h3 { margin: 0; font-size: 15px; }
.hi-slot-add { margin-left: auto; }
.hi-slot .dropzone { margin-top: 8px; }
.hi-file { display: flex; gap: 12px; margin-top: 10px; align-items: flex-start; }
.hi-file + .hi-file { border-top: 1px solid var(--line); padding-top: 10px; }
/* A checkerboard, so transparent art shows as transparent. */
.hi-preview { flex: 0 0 auto; width: 112px; height: 112px; border-radius: var(--radius-s); border: 1px solid var(--line-strong); overflow: hidden;
  background: repeating-conic-gradient(#D9DBEE 0 25%, #FFFFFF 0 50%) 0 0 / 16px 16px; display: grid; place-items: center; }
.hi-preview img { max-width: 100%; max-height: 100%; display: block; }
.hi-file-body { min-width: 0; flex: 1 1 auto; }
.hi-file-name { margin: 0 0 4px; overflow-wrap: anywhere; }
.hi-checks { list-style: none; margin: 0 0 6px; padding: 0; display: grid; gap: 3px; font-size: 13.5px; }
.hi-check { display: flex; gap: 8px; align-items: baseline; }
.hi-mark { flex: 0 0 18px; height: 18px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 11px; font-weight: 800; line-height: 1; }
.hi-ok .hi-mark { background: var(--done-bg); color: var(--done-ink); }
.hi-warn .hi-mark { background: var(--warn-bg); color: var(--warn-ink); }
.hi-fail .hi-mark { background: var(--danger-bg); color: var(--danger); }
.hi-fail { color: var(--danger); font-weight: 600; }
.hi-path { font-family: var(--mono); font-size: 12.5px; overflow-wrap: anywhere; }

.hi-ticks { list-style: none; margin: 0; display: grid; gap: 6px; }
.hi-tick { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.hi-tick input { margin-top: 3px; flex: 0 0 auto; }
.hi-left { margin: 6px 0 0; padding-left: 20px; }
.hi-ready { box-shadow: inset 0 6px 0 var(--face-green), var(--slab); padding-top: 18px; }
.hi-done { box-shadow: inset 0 6px 0 var(--face-green), var(--slab); padding-top: 18px; }
.hi-layout { display: grid; gap: 6px; }
.hi-layout code { font-family: var(--mono); font-size: 12.5px; overflow-wrap: anywhere; }

:root[data-theme="dark"] .hi-preview { background: repeating-conic-gradient(#2A3080 0 25%, #1B2068 0 50%) 0 0 / 16px 16px; }
@media (max-width: 560px) {
  .hi-file { flex-direction: column; }
  .hi-preview { width: 100%; height: 180px; }
}

/* The Locky traits and loomlock keys areas, side by side above Other art. */
.hi-areas { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; align-items: start; margin-bottom: 16px; }
.hi-areas > .panel { margin: 0; }
.hi-area { box-shadow: inset 0 6px 0 var(--area-face, var(--accent)), var(--slab); padding-top: 18px; }
.hi-area-trait { --area-face: var(--face-green); }
.hi-area-key { --area-face: var(--face-blue); }
.hi-spec { margin: 0; padding-left: 30px; display: grid; gap: 2px; font-size: 13.5px; }
.hi-area .hi-items { max-height: 320px; overflow-y: auto; }

/* One trait in many colours (js/hand-in/colours.js, views/colour-set*.js). */
.cs-swatch { flex: 0 0 auto; display: inline-block; width: 16px; height: 16px; border-radius: 4px; border: 1px solid var(--line-strong); vertical-align: -3px; }
.cs-swatch-none { background: repeating-linear-gradient(45deg, transparent 0 3px, var(--line) 3px 5px); }
.cs-chips { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.cs-chips:empty { display: none; }
.cs-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 4px 3px 8px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--raised); color: var(--ink); font: inherit; font-size: 13px; }
.cs-chip-x { border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 16px; line-height: 1; padding: 0 6px; min-height: 24px; cursor: pointer; border-radius: 999px; }
.cs-chip-x:hover, .cs-chip-x:focus-visible { color: var(--danger); background: var(--danger-bg); }
.cs-quick { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.cs-quick:empty { display: none; }
.cs-chip-add { padding-right: 10px; cursor: pointer; border-style: dashed; }
.cs-chip-add:hover, .cs-chip-add:focus-visible { border-color: var(--accent); background: var(--accent-soft); }
.cs-preview { border-top: 1px solid var(--line); padding-top: 8px; }
.cs-preview-list { margin: 4px 0 0; padding-left: 20px; display: grid; gap: 2px; font-size: 13.5px; }
@media (max-width: 560px) { .cs-form .row2 { grid-template-columns: minmax(0, 1fr); } }

.cs-rows { list-style: none; margin: 0; padding: 0 16px 8px; }
.cs-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.cs-row:first-child { border-top: 0; }
.cs-row.is-done .cs-row-title { color: var(--muted); }
.cs-row-main { flex: 1 1 180px; min-width: 0; display: grid; gap: 1px; }
.cs-row-title { font-weight: 600; overflow-wrap: anywhere; }
.cs-row-side { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.cs-stage { max-width: 160px; }
.cs-more { padding: 0 16px 12px; }
.cs-more summary { cursor: pointer; font-weight: 600; padding: 6px 0; }
.cs-add { padding: 0; display: grid; gap: 8px; }
.cs-ref { overflow-wrap: anywhere; }

.cs-drop { margin-bottom: 8px; }
.cs-drop p { margin: 0; }
.cs-matches { display: grid; gap: 8px; margin-top: 8px; }
.cs-match-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.cs-match { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface); }
.cs-match.is-unmatched { border-color: var(--warn-ink); background: var(--warn-bg); }
.cs-match-name { flex: 1 1 200px; min-width: 0; font-family: var(--mono); font-size: 12.5px; overflow-wrap: anywhere; }
.cs-match-picks { display: flex; flex-wrap: wrap; gap: 6px; flex: 1 1 260px; min-width: 0; }
.cs-match-picks select { flex: 1 1 110px; width: auto; min-width: 0; max-width: 200px; padding-left: 10px; padding-right: 26px; font-size: 14px; }
.cs-match-picks select:first-child { flex-basis: 96px; }
.cs-match-picks select:last-child { flex-grow: 1.4; }
.cs-match-why { flex-basis: 100%; margin: 0; }
/* On a phone the new set form's × sits beside the file name, and the pickers stack full width so colours aren't cut off. */
@media (max-width: 560px) {
  .cs-match-name { order: -2; flex-basis: 0; }
  .cs-match-out { order: -1; }
  .cs-match-picks { flex-basis: 100%; }
  .cs-match-picks select, .cs-match-picks select:first-child { flex-basis: 100%; max-width: none; }
}

.cs-cards { list-style: none; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.cs-card { display: grid; gap: 6px; align-content: start; padding: 10px 12px; border: 2px solid var(--line); border-radius: var(--radius-s); background: var(--surface); min-width: 0; }
.cs-card.is-ready { border-color: var(--face-green); }
.cs-card-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cs-card .hint { margin: 0; overflow-wrap: anywhere; }
.cs-files { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; font-size: 13px; }
.cs-file { display: flex; gap: 8px; align-items: center; }
.cs-file.hi-fail { font-weight: 400; }
.cs-missing { color: var(--muted); }
.cs-missing .hi-mark { background: var(--line); color: var(--muted); }
.cs-results { list-style: none; margin: 0; display: grid; gap: 4px; }

.cs-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 0 0 10px; }
.cs-strip-set { padding: 3px 10px; border: 1px solid var(--line-strong); border-radius: 999px; font-size: 13px; background: var(--raised); }
.cs-tag { display: inline-block; font-size: 12px; color: var(--muted); margin: 2px 0; }
.tt-title .cs-tag { display: block; }
