/* Design library pull — harvest shell overrides */
.dl-shell {
  --nav-w: 300px;
  --work-w: minmax(420px, 1fr);
}

.dl-panel {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-bottom: 0;
}

.dl-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  flex: 1;
}

.dl-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--subtle);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.dl-input {
  width: 100%;
  margin: 0;
}

.dl-tags {
  border: 0;
  margin: 4px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dl-tags .check { font-size: 12px; color: var(--muted); }

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
}

.check input { accent-color: var(--accent); }

.dl-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.dl-actions .btn { flex: 1; }

.dl-foot {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding: 12px;
}

.dl-foot__bucket {
  margin: 0 0 6px;
  font-size: 11px;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  word-break: break-all;
}

.dl-foot__hint {
  margin: 0;
  font-size: 11px;
  color: var(--subtle);
  line-height: 1.45;
}

.dl-foot__hint code { font-size: 10px; color: var(--muted); }

.dl-status {
  margin: 0 16px 12px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.dl-status--ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.dl-status--error { background: var(--danger-soft); color: #fecaca; border-color: transparent; }
.dl-status[hidden] { display: none !important; }

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 12px;
  padding: 0 16px 24px;
}

.media-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface);
  cursor: pointer;
  text-align: left;
  color: inherit;
  padding: 0;
}

.media-card:hover,
.media-card.is-selected {
  border-color: rgba(129, 140, 248, 0.45);
  box-shadow: 0 0 0 1px rgba(129, 140, 248, 0.2);
}

.media-card__thumb {
  aspect-ratio: 4 / 3;
  background: var(--preview-stage);
  overflow: hidden;
}

.media-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.media-card__meta {
  padding: 8px 10px;
  border-top: 1px solid var(--line);
}

.media-card__sub {
  font-size: 10px;
  color: var(--subtle);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-card__alt {
  margin-top: 2px;
  font-size: 11px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dl-preview__empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--subtle);
  font-size: 13px;
}

.dl-preview__img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

.dl-preview .preview-pane__stage {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  min-height: 220px;
  max-height: 42vh;
}

.meta-panel {
  border-top: 1px solid var(--line);
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: auto;
  max-height: calc(58vh - 48px);
}

.meta-panel__input,
.meta-panel__textarea {
  width: 100%;
  margin: 0;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font: inherit;
  padding: 8px 10px;
}

.meta-panel__textarea { resize: vertical; min-height: 72px; }
.meta-panel__hint { margin: 4px 0 0; font-size: 11px; color: var(--subtle); line-height: 1.4; }

.media-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.tag--sm {
  font-size: 9px;
  padding: 1px 6px;
}

.filter-bar {
  padding: 0 16px 12px;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  cursor: pointer;
}

.chip:hover { color: var(--text); border-color: rgba(129, 140, 248, 0.35); }

.asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  padding: 0 16px 24px;
}

.asset-card {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 12px;
  align-items: start;
}

.asset-card__thumb {
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  overflow: hidden;
  margin: 0;
}

.asset-card__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.library-card__notes {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

.library-card__body { min-width: 0; }

.library-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
}

.library-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  background: var(--surface);
}

.library-card__head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.library-card__title { margin: 0; font-size: 15px; font-weight: 600; }
.library-card__meta { font-size: 12px; color: var(--subtle); }
.library-card__source { margin: 8px 0 0; font-size: 12px; }
.library-card__tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.library-card__thumbs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 12px;
}
.library-card__thumb {
  aspect-ratio: 4 / 3;
  border-radius: 6px;
  overflow: hidden;
  background: var(--preview-stage);
  border: 1px solid var(--line);
}
.library-card__thumb img { width: 100%; height: 100%; object-fit: cover; }

.tag {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--accent-soft);
  color: #c7d2fe;
}

@media (max-width: 1100px) {
  .dl-shell { grid-template-columns: var(--nav-w) 1fr; }
  .dl-preview { display: none; }
}
