/* Collage Strip -- shared by Photo Tickets and Photo Tickets 2.
   Background color = whose turn it is (blue Trevor, pink Sunsets, grey
   done/waiting), same palette as the ticket strips. */

.cs {
    --cs-w: 60px;
    --cs-h: 75px;
    --cs-bg: #e7eff8;
    --cs-border: #c7d6e8;
    --cs-text: #5b4a3a;
    position: relative;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    padding: 8px 10px 8px;
    background: var(--cs-bg);
    border: 2px solid var(--cs-border);
    border-radius: 12px;
    color: var(--cs-text);
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}
.cs--wide { --cs-w: 88px; --cs-h: 110px; padding: 10px 14px 10px; }
.cs--blue { --cs-bg: #e7eff8; --cs-border: #c7d6e8; }
.cs--pink { --cs-bg: #fbe6ea; --cs-border: #f0c7d0; }
.cs--grey { --cs-bg: #8e8e8e; --cs-border: #737373; --cs-text: #fff; }
.cs--droptarget { box-shadow: 0 0 0 3px var(--primary-color, #bb5d4c); }

.cs-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cs-title { font-size: 0.82rem; font-weight: 700; letter-spacing: 0.02em; }
.cs-count { font-weight: 500; opacity: 0.7; margin-left: 4px; }
.cs-swatches { display: flex; gap: 6px; }
.cs-created { font-size: 0.66rem; opacity: 0.6; line-height: 1.2; margin: 1px 2px 3px; }
.cs-created:empty { display: none; }
.cs-sw {
    width: 20px; height: 20px; padding: 0; border-radius: 50%;
    border: 2px solid transparent; cursor: pointer;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.18);
}
.cs-sw--blue { background: #a7c0d9; }
.cs-sw--pink { background: #e8a9b3; }
.cs-sw--grey { background: #8e8e8e; }
.cs-sw--on { border-color: #fff; box-shadow: 0 0 0 2px #4a3a2c; }

.cs-track-wrap { min-width: 0; }
.cs-track {
    position: relative;
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 6px;
    min-height: calc(var(--cs-h) + 4px);
    padding: 2px 2px 4px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}
.cs-empty {
    align-self: center;
    font-size: 0.75rem;
    opacity: 0.75;
    padding: 0 6px;
}
.cs-card {
    position: relative;
    flex: 0 0 var(--cs-w);
    width: var(--cs-w);
    height: var(--cs-h);
    border-radius: 8px;
    overflow: hidden;
    background: #eee2d0;
    cursor: grab;
    touch-action: none;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.cs-card img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.cs-card-num {
    position: absolute; left: 4px; bottom: 3px;
    font-size: 10px; font-weight: 700; color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7); pointer-events: none;
}
.cs-card--armed { transform: scale(1.06) translateY(-3px); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25); z-index: 10; }
.cs-card--dragging { z-index: 100; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3); opacity: 0.95; cursor: grabbing; transition: box-shadow 0.1s; }
.cs-card--pending { display: flex; align-items: center; justify-content: center; cursor: default; opacity: 0.7; }
.cs-spin {
    width: 18px; height: 18px; border-radius: 50%;
    border: 2px solid rgba(90, 70, 45, 0.25); border-top-color: #7a6855;
    animation: cs-spin 0.8s linear infinite;
}
@keyframes cs-spin { to { transform: rotate(360deg); } }

.cs-card--selectable { cursor: pointer; }
.cs-card--selectable:not(.cs-card--selected) img { opacity: 0.85; }
.cs-card--selected { box-shadow: 0 0 0 3px #6B3F2A; }
.cs-card-check {
    position: absolute; top: 4px; left: 4px; width: 20px; height: 20px; border-radius: 50%;
    border: 2px solid #fff; background: rgba(255, 255, 255, 0.35); color: #fff;
    font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}
.cs-card--selected .cs-card-check { background: #6B3F2A; border-color: #6B3F2A; }

.cs-drop-marker {
    position: absolute; top: 0; bottom: 0; width: 3px; border-radius: 2px;
    background: var(--primary-color, #bb5d4c); pointer-events: none; z-index: 20;
}

.cs-bottom, .cs-selbar { display: flex; align-items: flex-start; gap: 6px; flex-wrap: wrap; }
.cs-bottom.hidden, .cs-selbar.hidden { display: none; }
.cs-notes {
    flex: 1 1 120px; min-width: 0; box-sizing: border-box;
    resize: none; overflow-y: auto;
    padding: 5px 8px; min-height: 30px; max-height: 96px;
    border: 1px solid rgba(0, 0, 0, 0.18); border-radius: 8px;
    background: rgba(255, 255, 255, 0.85); color: #3b2c1e;
    font: inherit; font-size: 0.82rem; line-height: 1.3;
    -webkit-user-select: text; user-select: text;
}
.cs-btn {
    flex: 0 0 auto; padding: 5px 10px; min-height: 30px;
    border: 1px solid rgba(0, 0, 0, 0.18); border-radius: 8px;
    background: rgba(255, 255, 255, 0.9); color: #5b4a3a;
    font: inherit; font-size: 0.78rem; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.cs-btn:hover:not(:disabled) { background: #fff; }
.cs-btn:disabled { opacity: 0.45; cursor: default; }
.cs-btn--danger { color: #a33; }
.cs-selmsg { flex: 1 1 100%; font-size: 0.8rem; font-weight: 600; }


/* ── Versions (build 533) ───────────────────────────────────────────── */
.cs-wrap { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.cs-stack { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.cs-bar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cs-bar-label { font-size: 0.75rem; font-weight: 700; color: #7a6855; letter-spacing: 0.02em; }
.cs-chips { display: flex; gap: 5px; flex-wrap: wrap; }
.cs-chip {
    min-width: 28px; height: 26px; padding: 0 8px; border-radius: 13px; cursor: pointer;
    border: 2px solid transparent; font: inherit; font-size: 0.78rem; font-weight: 700;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.18); color: #4a3a2c;
}
.cs-chip--blue { background: #a7c0d9; }
.cs-chip--pink { background: #e8a9b3; }
.cs-chip--grey { background: #8e8e8e; color: #fff; }
.cs-chip--on { border-color: #fff; box-shadow: 0 0 0 2px #4a3a2c; }
.cs-bar .cs-expand { margin-left: auto; }
.cs-bar .cs-btn { min-height: 26px; padding: 3px 9px; }
.cs-ver { font-weight: 600; opacity: 0.85; margin-left: 4px; }
.cs-card--lifted { opacity: 0.3; }
.cs-bar .cs-layout { margin-left: auto; }
.cs-bar .cs-layout + .cs-expand { margin-left: 0; }

/* "View all": photos wrap into rows instead of one scrolling strip */
.cs-wrap--grid .cs-track { flex-wrap: wrap; overflow-x: visible; overflow-y: visible; align-content: flex-start; row-gap: 6px; }
/* a vertical swipe on a photo scrolls the pane (the strip itself never scrolls sideways here) */
.cs-wrap--grid .cs-card { touch-action: pan-y; }
/* the open slot a photo is being dragged into */
.cs-ph { flex: 0 0 auto; box-sizing: border-box; border-radius: 8px; border: 2px dashed rgba(0, 0, 0, 0.3); background: rgba(255, 255, 255, 0.35); }
.cs-sheet-title { padding: 10px 14px 6px; font-size: 0.82rem; font-weight: 600; color: #7a6855; text-align: center; }

/* Photo being dragged in from a ticket's tray */
.cs-ghost {
    position: fixed; z-index: 6000; width: 56px; height: 70px;
    transform: translate(-50%, -50%) rotate(3deg);
    border-radius: 8px; overflow: hidden; pointer-events: none;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35); opacity: 0.92;
}
.cs-ghost img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cs-tray-armed { transform: scale(1.04); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25); }

/* ── Photo Tickets (Sunsets' page): permanent strip + bottom tray ───── */
.pt-collage { margin: 0 0 10px; }
/* never cover the bottom 40% of the window: strips scroll inside past 60% */
.pt-collage { overflow-y: auto; }
.pt-collage .cs { --cs-w: 80px; --cs-h: 100px; }
/* Pinned under the site header on every non-phone screen, including short
   laptop windows (the strip just gets smaller there so the gallery still
   has room). */
@media (min-width: 821px) {
    .pt-collage { max-height: calc(60vh - var(--pt-header-h, 0px)); position: sticky; top: var(--pt-header-h, 0px); z-index: 400; padding: 6px 0 4px; background: #f5f2ed; }
}
@media (min-width: 821px) and (max-height: 760px) {
    .pt-collage .cs { --cs-w: 56px; --cs-h: 70px; padding-top: 6px; padding-bottom: 6px; gap: 4px; }
}
@media (max-width: 820px) {
    .pt-collage .cs { --cs-w: 64px; --cs-h: 80px; }
}
.pt-gallery-tile--tray .pt-gallery-tile-img { box-shadow: 0 0 0 3px var(--primary-color, #bb5d4c); }
body.pt-tray-open .pt-main { padding-bottom: 230px; }

.cs-tray {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 450;
    background: #fdf8f2; border-top: 2px solid #d9c9b4;
    box-shadow: 0 -6px 20px rgba(60, 40, 20, 0.15);
    padding: 8px 14px 12px;
}
.cs-tray.hidden { display: none; }
.cs-tray-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.cs-tray-title { flex: 1 1 auto; min-width: 0; font-size: 0.85rem; font-weight: 600; color: #7a6855; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs-tray-close { flex: 0 0 auto; border: none; background: none; font-size: 1.6rem; line-height: 1; color: #7a6855; cursor: pointer; padding: 0 4px; }
.cs-tray-body { display: flex; gap: 18px; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 2px; }
.cs-tray-group { flex: 0 0 auto; display: flex; flex-direction: column; gap: 4px; }
.cs-tray-label { font-size: 0.7rem; font-weight: 600; color: #7a6855; }
.cs-tray-thumbs { display: flex; gap: 8px; }
.cs-tray .pt-thumb { flex: 0 0 76px; width: 76px; height: 96px; aspect-ratio: auto; cursor: pointer; }
.cs-tray-empty { font-size: 0.8rem; color: #b3a693; }
body:has(.pt-selection-bar:not(.hidden)) .cs-tray { display: none; }
@media (max-width: 820px) {
    .cs-tray .pt-thumb { flex-basis: 64px; width: 64px; height: 80px; }
    body.pt-tray-open .pt-main { padding-bottom: 200px; }
}

/* Archive (build 543) */
.cs-archived.hidden { display: none; }
.cs-archived { font-size: 0.78rem; opacity: .8; }
.cs-arch-sheet { max-height: 80vh; overflow-y: auto; }
.cs-arch-empty { padding: 14px; text-align: center; color: #7a6855; font-size: .9rem; }
.cs-arch-row { margin: 8px 10px; padding: 8px 10px; border-radius: 12px; background: #f4efe7; border: 1px solid #e2d8c8; }
.cs-arch-meta { font-size: .8rem; font-weight: 600; color: #6b5a47; margin-bottom: 6px; }
.cs-arch-thumbs { display: flex; gap: 4px; overflow: hidden; }
.cs-arch-thumbs img { width: 44px; height: 58px; object-fit: cover; border-radius: 6px; background: #ddd; }
.cs-arch-notes { font-size: .8rem; color: #7a6855; margin-top: 6px; white-space: pre-wrap; max-height: 3.6em; overflow: hidden; }
.cs-arch-btns { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }

.cs-hist-list { max-height: 55vh; overflow-y: auto; padding: 4px 2px; }
.cs-hist-row { padding: 6px 4px; font-size: 14px; border-bottom: 1px solid rgba(0,0,0,0.07); }
.cs-hist-row:last-child { border-bottom: 0; }
.cs-reset, .cs-hist { font-size: 16px; line-height: 1; }

.cs-name { cursor: text; border-bottom: 1px dashed transparent; }
.cs-name:hover { border-bottom-color: currentColor; }
.cs-name-input { font: inherit; font-size: 0.82rem; font-weight: 700; width: 11em; max-width: 60vw; padding: 1px 4px; border: 1px solid rgba(0,0,0,0.3); border-radius: 4px; }
