/* Packshot Flow — library (sidebar strip) */
  /* ========= LIBRARY ========= */
  .library-panel { min-height: 0; }
  .library-search {
    position: relative;
    margin-bottom: 8px;
  }
  .library-search input {
    width: 100%;
    padding: 8px 10px 8px 32px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    outline: none;
    font-size: 12.5px;
    transition: all 0.15s;
  }
  .library-search input:focus {
    background: #fff;
    border-color: var(--text-1);
    box-shadow: 0 0 0 3px var(--accent-soft);
  }
  .library-search svg {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-3);
    width: 14px;
    height: 14px;
    pointer-events: none;
  }

  .library-filters {
    display: flex;
    justify-content: center;
    flex-wrap: nowrap;
    gap: 4px;
    margin-bottom: 12px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .library-filters::-webkit-scrollbar { display: none; }
  .filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    border-radius: 999px;
    white-space: nowrap;
    flex-shrink: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-2);
    font-size: 11.5px;
    font-weight: 500;
    transition: all 0.15s;
  }
  .filter-pill:hover { background: #fff; color: var(--text-1); }
  .filter-pill.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
  }
  .filter-pill .count {
    opacity: 0.7;
    font-size: 10.5px;
  }
  .filter-pill.active .count { opacity: 0.85; }

  .library-grid {
    /* Uniform grid: every card is the same 3:4 portrait box, rows line up. The
       image inside is shown in full (object-fit:contain); the few odd-shaped
       product shots are filled by a soft blurred backdrop instead of bars. */
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    align-content: start;
    padding: 2px 1px 4px;
    /* Show ~2 rows, then scroll — grows on taller screens to show more */
    max-height: max(320px, 45vh);
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: var(--border-strong) transparent;
    min-height: 0;
  }
  .library-grid::-webkit-scrollbar { width: 5px; }
  .library-grid::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }

  .lib-card {
    position: relative;
    aspect-ratio: 3 / 4;
    border-radius: 10px;
    border: 1.5px solid var(--border);
    overflow: hidden;
    min-width: 0;
    cursor: grab;
    background: var(--surface);
    transition: all 0.15s ease;
  }
  .lib-card:hover {
    border-color: var(--text-1);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
  }
  .lib-card:active { cursor: grabbing; }
  .lib-card.selected {
    border-color: var(--target-ring);
    box-shadow: 0 0 0 2px var(--target-soft);
  }
  /* Whole image shown inside the uniform 3:4 box; empty space (only on the few
     odd-shaped products) is just the clean card background — no blur. */
  .lib-card img, .lib-card svg {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    pointer-events: none;
  }
  .lib-card-tag {
    position: absolute;
    top: 4px; left: 4px;
    padding: 2px 5px;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(4px);
    border-radius: 4px;
    font-size: 9px;
    font-weight: 600;
    color: var(--text-1);
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }
  .lib-card-name {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 6px;
    background: linear-gradient(0deg, rgba(0,0,0,0.7), transparent);
    color: #fff;
    font-size: 10px;
    font-weight: 500;
    opacity: 0;
    transition: opacity 0.15s;
    text-align: center;
    pointer-events: none;
  }
  .lib-card:hover .lib-card-name { opacity: 1; }

  .lib-add-card {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1.5px dashed var(--border-strong);
    background: transparent;
    color: var(--text-3);
    aspect-ratio: 3 / 4;
    align-self: start;
    border-radius: 10px;
    transition: all 0.15s;
  }
  .lib-add-card:hover {
    border-color: var(--text-1);
    color: var(--text-1);
    background: var(--surface);
  }

  .lib-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 20px 16px;
    color: var(--text-3);
    font-size: 12px;
  }

  /* Settings */
  .settings-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
  }
  .setting-cell {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    cursor: pointer;
    transition: all 0.15s;
    position: relative;
  }
  .setting-cell:hover { border-color: var(--border-strong); background: #fff; }
  .setting-cell-label {
    font-size: 9.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-3);
  }
  .setting-cell-value {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-1);
  }
  .setting-cell-value svg { color: var(--text-3); }
  /* Secondary note in a setting label, e.g. when a control only applies to sets. */
  .cell-hint {
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
    color: var(--border-strong);
  }

  .dd-menu {
    position: fixed;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
    padding: 4px;
    z-index: 200;
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
    pointer-events: none;
    transition: opacity 0.14s ease, transform 0.14s ease;
    min-width: 120px;
    max-height: 320px;
    overflow-y: auto;
  }
  .setting-cell.open .dd-menu { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
  .dd-menu-title {
    padding: 6px 10px 4px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-3);
  }
  .dd-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 10px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-1);
    cursor: pointer;
    transition: background 0.1s;
  }
  .dd-option:hover { background: var(--surface); }
  .dd-option-check { width: 14px; height: 14px; opacity: 0; }
  .dd-option.selected .dd-option-check { opacity: 1; }
  .dd-option-box {
    width: 16px; height: 16px;
    border: 1.5px solid var(--border-strong);
    border-radius: 4px;
    background: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
  }
  .dd-option.selected .dd-option-box { background: var(--accent); border-color: var(--accent); }
  .dd-option-box svg { width: 11px; height: 11px; opacity: 0; }
  .dd-option.selected .dd-option-box svg { opacity: 1; }

  /* Styling panel — pose / footwear */
  .styling-stack {
    display: flex;
    flex-direction: column;
    gap: 8px;
    /* Air below the Footwear box so the panel edge sits a bit under it —
       matches the IMAGES panel above. */
    margin-bottom: 16px;
  }

  /* Generate */
  .generate {
    width: 100%;
    padding: 14px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: -0.005em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.08);
    transition: all 0.2s cubic-bezier(0.2, 0.7, 0.2, 1);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
  }
  .generate::after {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
    transition: left 0.6s ease;
  }
  .generate:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(0,0,0,0.16); }
  .generate:hover:not(:disabled)::after { left: 100%; }
  .generate:disabled { background: #ededed; color: #aaa; cursor: not-allowed; box-shadow: none; }

