/* Historical Catalog Intake — Merphi orange, card previews (no giant Excel tables) */
.hci-shell {
  --hci-accent: var(--merphi-orange, #e85d04);
  --hci-accent-soft: color-mix(in srgb, var(--hci-accent) 14%, transparent);
  --hci-border: color-mix(in srgb, var(--hci-accent) 22%, #d8d2ca);
  display: grid;
  gap: 1rem;
}

.hci-step-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.hci-step-pill {
  border: 1px solid var(--hci-border);
  background: #fff;
  color: #3a342e;
  border-radius: 999px;
  padding: 0.28rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 600;
}

.hci-step-pill[aria-current="step"] {
  background: var(--hci-accent-soft);
  border-color: var(--hci-accent);
  color: #7a3200;
}

.hci-lead {
  margin: 0;
  color: #5c534a;
  font-size: 0.92rem;
  line-height: 1.45;
}

.hci-card-list {
  display: grid;
  gap: 0.75rem;
}

.hci-release-card {
  border: 1px solid var(--hci-border);
  border-radius: 12px;
  padding: 0.9rem 1rem;
  background: linear-gradient(180deg, #fffdfb 0%, #faf6f1 100%);
  display: grid;
  gap: 0.55rem;
}

.hci-release-card[data-status="ready"] { border-left: 3px solid #2f9e44; }
.hci-release-card[data-status="warning"],
.hci-release-card[data-status="review"] { border-left: 3px solid #e67700; }
.hci-release-card[data-status="blocked"],
.hci-release-card[data-status="failed"] { border-left: 3px solid #c92a2a; }
.hci-release-card[data-status="added"] { border-left: 3px solid var(--hci-accent); }

.hci-release-card h4 {
  margin: 0;
  font-size: 1rem;
}

.hci-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.85rem;
  font-size: 0.82rem;
  color: #5c534a;
}

.hci-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  background: #f3eee7;
  font-size: 0.75rem;
  font-weight: 600;
}

.hci-chip.ok { background: #e6f4ea; color: #1b6b2c; }
.hci-chip.warn { background: #fff3bf; color: #7a4f00; }
.hci-chip.bad { background: #ffe3e3; color: #a61e1e; }

.hci-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.hci-filters button[aria-pressed="true"] {
  background: var(--hci-accent-soft);
  border-color: var(--hci-accent);
}

.hci-track-editor {
  display: grid;
  gap: 0.55rem;
}

.hci-track-row {
  display: grid;
  grid-template-columns: 2.2rem 1fr;
  gap: 0.5rem;
  align-items: start;
  padding: 0.55rem 0.65rem;
  border: 1px dashed var(--hci-border);
  border-radius: 10px;
  background: #fff;
}

.hci-track-row .hci-track-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
}

.hci-notice {
  display: flex;
  gap: 0.55rem;
  align-items: flex-start;
  padding: 0.7rem 0.85rem;
  border-radius: 10px;
  background: var(--hci-accent-soft);
  border: 1px solid var(--hci-border);
  font-size: 0.88rem;
  color: #4a3424;
}

.hci-badge-imported {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: 0.35rem;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  border: 1px solid var(--hci-border);
  background: #fff8f2;
  color: #8a4b16;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  vertical-align: middle;
}

.hci-dates {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.7rem;
  font-size: 0.75rem;
  color: #6b6258;
}

.hci-mobile-hint {
  display: none;
  margin: 0;
  font-size: 0.82rem;
  color: #6b6258;
}

.hci-scope-bar {
  position: sticky;
  bottom: 0.5rem;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 0.9rem;
  border-radius: 12px;
  border: 1px solid var(--hci-border);
  background: rgba(255, 253, 250, 0.96);
  box-shadow: 0 8px 24px rgba(60, 40, 20, 0.08);
}

.hci-paste-area {
  min-height: 8rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8rem;
}

.hci-import-chooser {
  display: grid;
  gap: 1rem;
  width: 100%;
  min-width: 0;
}

.hci-transfer-nav {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
  padding: 0.35rem;
  border: 1px solid #e2ddd7;
  border-radius: 1rem;
  background: #f5f2ee;
}

.hci-transfer-nav button {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
  min-height: 3.7rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid transparent;
  border-radius: 0.75rem;
  background: transparent;
  color: #4d4640;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.hci-transfer-nav button > :first-child {
  width: 1.4rem;
  height: 1.4rem;
  object-fit: contain;
}

.hci-transfer-nav button.is-spotify {
  grid-template-columns: 5rem minmax(0, 1fr);
}

.hci-transfer-nav button.is-spotify > img {
  width: 5rem;
  height: auto;
  max-height: 1.4rem;
}

.hci-transfer-nav button > span,
.hci-transfer-nav button strong,
.hci-transfer-nav button small {
  display: block;
  min-width: 0;
}

.hci-transfer-nav button strong {
  font-size: 0.84rem;
  font-weight: 800;
}

.hci-transfer-nav button small {
  margin-top: 0.12rem;
  color: #746b62;
  font-size: 0.72rem;
  line-height: 1.25;
}

.hci-transfer-nav button[aria-current="page"] {
  border-color: #ff6a00;
  background: #fff;
  color: #2f2924;
  box-shadow: 0 0.3rem 1rem rgba(73, 43, 22, 0.08);
  cursor: default;
}

.hci-transfer-nav button.is-unavailable {
  border-style: dashed;
  color: #766f68;
  background: rgba(255, 255, 255, 0.52);
}

.hci-transfer-nav button.is-unavailable > img {
  filter: grayscale(1);
  opacity: 0.62;
}

.hci-import-methods {
  display: grid;
  gap: 0.7rem;
}

.hci-import-method {
  display: grid;
  grid-template-columns: 2.6rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  padding: 1rem;
  border: 1px solid #ddd6ce;
  border-radius: 1rem;
  background: linear-gradient(135deg, #fff 0%, #fcfaf7 100%);
  color: #29241f;
  text-align: left;
  cursor: pointer;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.hci-import-method:hover,
.hci-import-method:focus-visible {
  border-color: var(--hci-accent);
  box-shadow: 0 10px 24px rgba(72, 45, 24, 0.1);
  transform: translateY(-1px);
  outline: none;
}

.hci-import-method.is-spotify {
  grid-template-columns: 7rem minmax(0, 1fr) auto;
  border-color: color-mix(in srgb, #1ed760 48%, #d8d2ca);
  background: linear-gradient(135deg, color-mix(in srgb, #1ed760 10%, #fff) 0%, #fff 72%);
}

.hci-import-method.is-unavailable {
  border-color: #d8d2ca;
  background: linear-gradient(135deg, #f7f5f2 0%, #fff 100%);
}

.hci-import-method.is-unavailable .hci-import-method-icon-spotify {
  filter: grayscale(1);
  opacity: 0.68;
}

.hci-import-method.is-unavailable .hci-import-method-arrow {
  color: #948b82;
}

.hci-availability-pill {
  display: inline-flex;
  align-items: center;
  margin-left: 0.55rem;
  padding: 0.18rem 0.45rem;
  border-radius: 999px;
  color: #6a625a;
  background: #ece8e3;
  font-size: 0.66rem;
  font-weight: 750;
  vertical-align: middle;
}

.hci-import-method-icon {
  display: grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 0.8rem;
  background: var(--hci-accent-soft);
  color: #8a3d00;
  font-size: 1.2rem;
  font-weight: 800;
}

.hci-import-method-icon.hci-import-method-icon-spotify {
  width: 6.2rem;
  padding: 0.45rem;
  background: #0f1712;
}

.hci-import-method-icon-spotify img {
  display: block;
  width: 100%;
  height: auto;
}

.hci-import-method.is-spotify .hci-import-method-icon-spotify {
  background: #0f1712;
}

.hci-import-method strong,
.hci-import-method small {
  display: block;
}

.hci-import-method strong {
  margin-bottom: 0.25rem;
  font-size: 0.98rem;
}

.hci-import-method small {
  color: #6b6258;
  line-height: 1.4;
}

.hci-import-method-arrow {
  color: #8a3d00;
  font-size: 1.25rem;
}

.hci-bulk-shell {
  width: min(62rem, calc(100vw - 4rem));
  max-width: 100%;
  gap: 1.1rem;
}

.hci-bulk-steps ol {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.hci-bulk-steps button {
  width: 100%;
  min-height: 3.25rem;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid #ddd7d0;
  border-radius: 12px;
  background: #fff;
  color: #514a43;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.hci-bulk-steps button > span {
  width: 1.65rem;
  height: 1.65rem;
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: #f1ede8;
  color: #655d55;
  font-size: 0.75rem;
}

.hci-bulk-steps button[aria-current="step"] {
  border-color: var(--hci-accent);
  background: var(--hci-accent-soft);
  color: #713100;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--hci-accent) 35%, transparent);
}

.hci-bulk-steps button[aria-current="step"] > span {
  background: var(--hci-accent);
  color: #fff;
}

.hci-bulk-steps button:disabled {
  cursor: default;
  opacity: 0.55;
}

.hci-bulk-steps button:focus-visible,
.hci-upload-drop:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--hci-accent) 36%, transparent);
  outline-offset: 2px;
}

.hci-bulk-stage {
  display: grid;
  gap: 1rem;
  min-height: 20rem;
}

.hci-bulk-heading {
  display: grid;
  gap: 0.28rem;
}

.hci-bulk-heading > span {
  color: var(--hci-accent);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hci-bulk-heading h3,
.hci-bulk-completion h3 {
  margin: 0;
  font-size: clamp(1.15rem, 2vw, 1.45rem);
}

.hci-bulk-org {
  max-width: 34rem;
}

.hci-org-picker {
  position: relative;
  width: 100%;
}

.hci-org-trigger {
  width: 100%;
  min-height: 58px;
  padding: 9px 12px;
  border: 1px solid var(--border, #d9dee8);
  border-radius: 14px;
  background: var(--surface, #fff);
  color: var(--ink, #111827);
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 22px;
  gap: 10px;
  align-items: center;
  text-align: left;
  cursor: pointer;
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.hci-org-trigger:hover,
.hci-org-picker.is-open .hci-org-trigger {
  border-color: color-mix(in srgb, var(--brand-orange, #ff5a00) 62%, var(--border, #d9dee8));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-orange, #ff5a00) 12%, transparent);
}

.hci-org-trigger:focus-visible,
.hci-org-option:focus-visible,
.hci-org-search input:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--brand-orange, #ff5a00) 24%, transparent);
  outline-offset: 2px;
}

.hci-org-trigger-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--brand-orange, #ff5a00);
  background: var(--brand-orange-soft, #fff1e8);
  font-size: 18px;
  font-weight: 800;
}

.hci-org-trigger-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.hci-org-trigger-copy small {
  color: var(--muted, #667085);
  font-size: 11px;
  font-weight: 650;
}

.hci-org-trigger-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hci-org-trigger-chevron {
  color: var(--muted, #667085);
  font-size: 18px;
  transition: transform 140ms ease;
}

.hci-org-picker.is-open .hci-org-trigger-chevron {
  transform: rotate(180deg);
}

.hci-org-popover {
  position: absolute;
  z-index: 24;
  inset: calc(100% + 7px) 0 auto;
  padding: 8px;
  border: 1px solid var(--border, #d9dee8);
  border-radius: 16px;
  background: var(--surface, #fff);
  box-shadow: 0 18px 45px rgba(17, 24, 39, .17);
}

.hci-org-search {
  display: block;
  padding: 2px 2px 8px;
}

.hci-org-search input {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--border, #d9dee8);
  border-radius: 10px;
  background: var(--surface-subtle, #f8fafc);
  color: inherit;
}

.hci-org-options {
  max-height: 248px;
  overflow: auto;
  display: grid;
  gap: 4px;
}

.hci-org-option {
  width: 100%;
  min-height: 42px;
  padding: 8px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: inherit;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  text-align: left;
  cursor: pointer;
}

.hci-org-option:hover {
  background: var(--surface-subtle, #f8fafc);
}

.hci-org-option.is-selected {
  background: var(--brand-orange-soft, #fff1e8);
  color: var(--ink, #111827);
  font-weight: 720;
}

.hci-org-option-mark {
  width: 22px;
  height: 22px;
  border: 1px solid var(--border, #d9dee8);
  border-radius: 7px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 12px;
}

.hci-org-option.is-selected .hci-org-option-mark {
  border-color: var(--brand-orange, #ff5a00);
  background: var(--brand-orange, #ff5a00);
}

.hci-template-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
}

.hci-template-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: center;
  min-width: 0;
  padding: 0.85rem;
  border: 1px solid #ddd5cd;
  border-radius: 0.9rem;
  background: #fff;
  color: #332d28;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.hci-template-card:hover,
.hci-template-card:focus-visible {
  border-color: var(--hci-accent);
  box-shadow: 0 0.4rem 1.1rem rgba(75, 43, 20, 0.08);
  outline: none;
}

.hci-template-card > svg {
  color: var(--hci-accent);
}

.hci-template-card strong,
.hci-template-card small {
  display: block;
}

.hci-template-card small {
  margin-top: 0.18rem;
  color: #6d655d;
  line-height: 1.35;
}

.hci-template-card > span:last-child {
  color: #8a3d00;
  font-size: 0.76rem;
  font-weight: 800;
}

.hci-template-card.is-compact {
  grid-column: 1 / -1;
}

.hci-upload-drop {
  min-height: 10.5rem;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 0.4rem;
  padding: 1.25rem;
  border: 2px dashed #cfc6bc;
  border-radius: 16px;
  background: linear-gradient(180deg, #fff 0%, #fcfaf7 100%);
  color: #3e3934;
  text-align: center;
  cursor: pointer;
  transition: border-color 140ms ease, background-color 140ms ease, transform 140ms ease;
}

.hci-upload-drop:hover,
.hci-upload-drop.is-dragging {
  border-color: var(--hci-accent);
  background: var(--hci-accent-soft);
}

.hci-upload-drop.is-dragging {
  transform: translateY(-1px);
}

.hci-upload-drop small {
  color: #6d655d;
}

.hci-upload-icon {
  width: 2.65rem;
  height: 2.65rem;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--hci-accent-soft);
  color: var(--hci-accent);
  font-size: 1.35rem;
  font-weight: 800;
}

.hci-bulk-secondary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.hci-bulk-summary,
.hci-asset-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.hci-bulk-summary > span:first-child {
  padding-right: 0.35rem;
}

.hci-clear-assets {
  justify-self: start;
}

.hci-asset-list {
  display: grid;
  gap: 0.45rem;
  max-height: min(22rem, 42vh);
  overflow: auto;
  padding-right: 0.2rem;
}

.hci-asset-row {
  display: grid;
  grid-template-columns: minmax(5.5rem, 0.5fr) minmax(12rem, 2fr) minmax(7.5rem, 0.75fr);
  gap: 0.75rem;
  align-items: center;
  padding: 0.65rem 0.75rem;
  border: 1px solid #e3ddd6;
  border-left-width: 3px;
  border-radius: 10px;
  background: #fff;
  font-size: 0.8rem;
}

.hci-asset-row[data-state="matched"] { border-left-color: #2f9e44; }
.hci-asset-row[data-state="missing"] { border-left-color: #e67700; }
.hci-asset-row[data-state="ambiguous"] { border-left-color: #c92a2a; }

.hci-asset-row small {
  display: block;
  margin-top: 0.15rem;
  color: #6d655d;
  overflow-wrap: anywhere;
}

.hci-asset-kind {
  color: #655d55;
  font-weight: 700;
}

.hci-asset-state {
  justify-self: end;
  color: #514a43;
  font-weight: 700;
  text-align: right;
}

.hci-rights-confirm {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.75rem;
  align-items: start;
  padding: 0.9rem 1rem;
  border: 1px solid var(--hci-border);
  border-radius: 12px;
  background: #fffaf5;
  cursor: pointer;
}

.hci-rights-confirm input {
  width: 1.1rem;
  height: 1.1rem;
  margin-top: 0.1rem;
  accent-color: var(--hci-accent);
}

.hci-rights-confirm small {
  display: block;
  margin-top: 0.25rem;
  color: #655d55;
  line-height: 1.4;
}

.hci-bulk-completion {
  display: grid;
  gap: 0.85rem;
  padding: 1rem 1.1rem;
  border: 1px solid #a8d5b2;
  border-radius: 14px;
  background: #f2fbf4;
}

.hci-bulk-completion[data-tone="warning"] {
  border-color: #f0c36d;
  background: #fff9e9;
}

.hci-bulk-errors {
  margin: 0;
  padding-left: 1.15rem;
  color: #8b2b2b;
  font-size: 0.82rem;
}

.hci-bulk-status {
  min-height: 1.25rem;
  margin: 0;
  color: #5f574f;
  font-size: 0.82rem;
}

.hci-bulk-status[data-tone="error"] {
  color: #a61e1e;
}

.hci-bulk-actions {
  position: sticky;
  bottom: 0;
  z-index: 4;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  padding: 0.8rem 0;
  border-top: 1px solid #e8e2db;
  background: color-mix(in srgb, #fff 94%, transparent);
  backdrop-filter: blur(8px);
}

.hci-bulk-actions-spacer {
  flex: 1 1 auto;
}

.hci-spotify-shell {
  display: grid;
  gap: 1rem;
  width: min(100%, 72rem);
}

.modal.modal-historical-catalog {
  width: min(1180px, calc(100vw - 40px));
  max-width: 1180px;
  max-height: min(920px, calc(100dvh - 40px));
}
.modal.modal-historical-catalog .modal-header { flex: 0 0 auto; background: #fff; }
.modal.modal-historical-catalog .modal-body { min-height: 0; padding: 20px 22px 0; overscroll-behavior: contain; }
.modal.modal-historical-catalog .hci-spotify-shell { min-height: 100%; }
.modal.modal-historical-catalog .hci-bulk-actions {
  margin: 0 -22px;
  padding: 14px 22px calc(14px + env(safe-area-inset-bottom, 0px));
  background: rgba(255,255,255,.98);
}

.hci-spotify-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.hci-spotify-steps li {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--border, #dfe4ea);
  border-radius: 14px;
  color: var(--muted, #64748b);
  font-size: .86rem;
  font-weight: 700;
}

.hci-spotify-steps li span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  border-radius: 999px;
  background: #eef2f7;
}

.hci-spotify-steps li.is-active {
  border-color: #1ed760;
  background: #f0fff5;
  color: #087b34;
}

.hci-spotify-steps li.is-active span {
  background: #1ed760;
  color: #092e18;
}

.hci-spotify-steps li.is-complete {
  color: #087b34;
}

.hci-spotify-steps li.is-complete span {
  background: #dff8e8;
  color: #087b34;
}

.hci-spotify-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.65rem;
  align-items: end;
}

.hci-spotify-search-control {
  display: block;
  width: 100%;
  min-width: 0;
}

.hci-spotify-search-control .control {
  width: 100%;
  min-width: 0;
  min-height: 46px;
}

.hci-spotify-attribution {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.55rem 0.75rem;
  border-radius: 0.7rem;
  background: #f4f1ed;
  color: #5f574f;
  font-size: 0.8rem;
  font-weight: 700;
}

.hci-spotify-attribution img {
  width: 5rem;
  height: auto;
  flex: 0 0 auto;
}

.hci-spotify-selection-summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 16px;
  padding: 12px 14px;
  border: 1px solid var(--border, #dfe4ea);
  border-radius: 14px;
  background: #fff;
  color: var(--muted, #64748b);
  font-size: .88rem;
}

.hci-spotify-selection-summary strong {
  color: var(--text, #111827);
}

.hci-spotify-load-more {
  width: 100%;
  justify-content: center;
}

.hci-spotify-artists,
.hci-spotify-albums {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  margin-top: 0.65rem;
}

.hci-release-card-head {
  display: grid;
  grid-template-columns: 4.5rem minmax(0, 1fr);
  gap: 0.75rem;
  align-items: start;
}

.hci-release-cover,
.hci-release-cover-placeholder {
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 0.7rem;
  object-fit: cover;
  background: #f0ece7;
  display: grid;
  place-items: center;
  color: #8a7b6c;
}

.hci-spotify-albums {
  grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr));
  padding: 0.2rem;
}

.hci-spotify-artist,
.hci-spotify-album {
  display: grid;
  grid-template-columns: 3.5rem minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: center;
  min-width: 0;
  padding: 0.7rem;
  border: 1px solid #e4ddd5;
  border-radius: 0.9rem;
  background: #fff;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.hci-spotify-album {
  position: relative;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  gap: 0.55rem;
  padding: 0.5rem;
}

.hci-spotify-artist:hover,
.hci-spotify-album:hover,
.hci-spotify-album.is-selected {
  border-color: #ff6a00;
  box-shadow: 0 0.45rem 1.2rem rgba(62, 37, 16, 0.08);
}

.hci-spotify-album.is-selected {
  background: #fff7f0;
}

.hci-spotify-album.is-selected::after {
  content: "✓";
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  display: grid;
  place-items: center;
  width: 1.8rem;
  height: 1.8rem;
  border: 2px solid #fff;
  border-radius: 999px;
  background: #ff6a00;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 900;
  box-shadow: 0 0.25rem 0.8rem rgba(52, 28, 10, 0.22);
}

.hci-spotify-album > input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.hci-spotify-artist img,
.hci-spotify-cover-placeholder {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 0.7rem;
  object-fit: cover;
  background: #f0ece7;
}

.hci-spotify-album img,
.hci-spotify-album > .hci-spotify-cover-placeholder {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  border-radius: 0.7rem;
  object-fit: cover;
  background: #f0ece7;
}

.hci-spotify-cover-placeholder {
  display: grid;
  place-items: center;
}

.hci-spotify-artist > span,
.hci-spotify-album > span {
  display: grid;
  min-width: 0;
  gap: 0.18rem;
}

.hci-spotify-artist strong,
.hci-spotify-album strong,
.hci-spotify-artist small,
.hci-spotify-album small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hci-spotify-album a {
  width: fit-content;
  color: #8a3d00;
  font-size: 0.78rem;
  font-weight: 700;
}

.hci-spotify-claim,
.hci-spotify-preview-head {
  display: grid;
  gap: 0.8rem;
  padding: 1rem;
  border: 1px solid #e8e2db;
  border-radius: 1rem;
  background: #fcfaf8;
}

.hci-spotify-preview-head {
  margin-bottom: 0.75rem;
}

.hci-spotify-preview-head h3,
.hci-spotify-preview-head p {
  margin: 0;
}

.hci-spotify-preview-head .button {
  justify-self: start;
}

@media (max-width: 768px) {
  .hci-import-chooser {
    min-width: 0;
  }

  .hci-import-method {
    grid-template-columns: 2.4rem minmax(0, 1fr);
  }

  .hci-import-method.is-spotify {
    grid-template-columns: 5.5rem minmax(0, 1fr);
  }

  .hci-import-method-icon.hci-import-method-icon-spotify {
    width: 5.5rem;
  }

  .hci-import-method-arrow {
    display: none;
  }

  .hci-transfer-nav {
    grid-template-columns: 1fr;
  }

  .hci-transfer-nav button {
    min-height: 3.2rem;
  }

  .hci-template-actions {
    grid-template-columns: 1fr;
  }

  .hci-template-card.is-compact {
    grid-column: auto;
  }

  .hci-spotify-steps {
    grid-template-columns: 1fr;
  }

  .hci-spotify-albums {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: none;
  }
  .hci-track-row .hci-track-fields {
    grid-template-columns: 1fr;
  }
  .hci-mobile-hint {
    display: block;
  }
  .modal.modal-create-release .hci-shell,
  .modal .hci-shell {
    max-width: 100%;
  }

  .hci-bulk-shell {
    width: 100%;
  }

  .hci-bulk-stage {
    min-height: 0;
  }

  .hci-bulk-steps ol {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }

  .hci-bulk-steps button {
    min-height: 2.55rem;
  }

  .hci-asset-row {
    grid-template-columns: 1fr;
    gap: 0.3rem;
  }

  .hci-asset-state {
    justify-self: start;
    text-align: left;
  }

  .hci-bulk-actions .button {
    flex: 1 1 auto;
  }

  .hci-bulk-actions-spacer {
    display: none;
  }

  .hci-spotify-search,
  .hci-spotify-artists,
  .hci-spotify-albums {
    grid-template-columns: 1fr;
  }

  .hci-spotify-search .button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hci-upload-drop {
    transition: none;
  }
}

/* Catalog transfer modals share the Spotify modal frame: the shell fills the
   modal so the sticky footer spans its width, and manual step fields get
   regular vertical rhythm instead of touching each other. */
.modal.modal-historical-catalog .hci-bulk-shell {
  width: 100%;
}

.modal.modal-historical-catalog .mr-create-wizard .mr-wizard-footer {
  margin: 0 -22px;
  padding: 14px 22px calc(14px + env(safe-area-inset-bottom, 0px));
  background: #fff;
  border-top: 1px solid #e8e2db;
}

#hci-single-form [data-hci-step-body] {
  display: grid;
  gap: 16px;
  align-content: start;
}

#hci-single-form [data-hci-step-body] > .mr-wizard-step-title {
  margin: 0;
}

#hci-single-form [data-hci-step-body] > .hci-lead {
  margin: -8px 0 4px;
}

#hci-single-form [data-hci-step-body] > .hci-lead:empty {
  display: none;
}

/* The sticky footer must sit on the modal's bottom edge: no body padding below
   it, otherwise scrolled content shows through the gap. */
html.ui-v2 .modal.modal-historical-catalog .modal-body {
  padding-bottom: 0 !important;
}

@media (max-width: 760px) {
  html.ui-v2 .modal.modal-historical-catalog .hci-shell > * + * {
    margin-top: 16px;
  }

  html.ui-v2 #hci-single-form .hci-step-nav {
    gap: 8px;
  }
}
